Domain name for API request: sqlserver.intl.tencentcloudapi.com.
This API is used to query the commands of creating backups canonically.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: DescribeBackupCommand. |
Version | Yes | String | Common Params. The value used for this API: 2018-03-28. |
Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
BackupFileType | Yes | String | Backup file type. Full: full backup. FULL_LOG: full backup which needs log increments. FULL_DIFF: full backup which needs differential increments. LOG: log backup. DIFF: differential backup. |
DataBaseName | Yes | String | Database name |
IsRecovery | Yes | String | Whether restoration is required. No: not required. Yes: required. |
LocalPath | No | String | Storage path of backup files. If this parameter is left empty, the default storage path will be D:\. |
Parameter Name | Type | Description |
---|---|---|
Command | String | Create a backup command |
RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to query the command to create a full backup and an incremental transaction log backup when you need to import the incremental transaction log backup. The full backup created does not need to be restored.
\\n in the command means a line feed.
https://sqlserver.intl.tencentcloudapi.com/?Action=DescribeBackupCommand
&BackupFileType=FULL
&DataBaseName=db1
&IsRecovery=YES
&LocalPath=E:/
&<Common request parameters>
{
"Response": {
"Command": "declare @dbname varchar(100)\\\\ndeclare @localtime varchar(20)\\\\ndeclare @str varchar(8000)\\\\nset @dbname='db1'\\\\nset @localtime =replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')\\\\nset @str='BACKUP DATABASE [' + @dbname + '] TO DISK = N''E:/' + @dbname + '_' + @localtime + '_2full2_2noreconvery2.bak'' WITH INIT'\\\\nexec(@str)\\\\ngo",
"RequestId": "03199d88-9dda-49eb-a045-7c69eb4d3591"
}
}
This example shows you how to obtain the recovered incremental backup of transaction logs by this API when an incremental import of transaction logs is needed.
\\n in the command means a line feed.
https://sqlserver.intl.tencentcloudapi.com/?Action=DescribeBackupCommand
&BackupFileType=LOG
&DataBaseName=db1
&IsRecovery=YES
&LocalPath=E:/
&<Common request parameters>
{
"Response": {
"Command": "BACKUP DATABASE db1 TO DISK='E:/db1.bak' WITH INIT",
"RequestId": "1de3aea3-5fef-4891-b8b0-faeb4e3b5543"
}
}
This example shows you how to obtain the full backup without recovery by this API when an incremental import of transaction logs is needed.\\n in the command means a line feed.
https://sqlserver.intl.tencentcloudapi.com/?Action=DescribeBackupCommand
&BackupFileType=FULL_LOG
&DataBaseName=db1
&IsRecovery=NO
&LocalPath=E:/
&<Common request parameters>
{
"Response": {
"Command": "declare @dbname varchar(100)\\\\ndeclare @localtime varchar(20)\\\\ndeclare @str varchar(8000)\\\\nset @dbname='db1'\\\\nset @localtime =replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')\\\\nset @str='BACKUP LOG [' + @dbname + '] TO DISK = N''E:/' + @dbname + '_' + @localtime + '_2log2_2reconvery2.bak'' WITH FORMAT, INIT'\\\\nexec(@str)\\\\ngo",
"RequestId": "8d53700f-b80b-415a-8738-0c340eff2057"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InvalidParameter.InputIllegal | Input error. |
InvalidParameter.ParamsAssertFailed | An error occurred while converting parameter assertion. |
UnauthorizedOperation.PermissionDenied | CAM authentication error. |
本页内容是否解决了您的问题?