You need to enable JavaScript to run this app.
文档中心
云数据库 SQL Server 版

云数据库 SQL Server 版

复制全文
下载 pdf
备份上云
CreateTosRestore - 创建tos备份上云任务
复制全文
下载 pdf
CreateTosRestore - 创建tos备份上云任务
调用 CreateTosRestore 接口将对象存储 TOS 上的备份文件恢复到云数据库 SQL Server 版实例,实现数据上云。
调试
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
请求参数
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数
Action string 必选 示例值:CreateTosRestore
要执行的操作,取值:CreateTosRestore
Version string 必选 示例值:2022-01-01
API的版本,取值:2022-01-01
TargetDBInstanceId string 必选 示例值:mssql-d59138f3****
实例 ID。
说明
您可以调用 DescribeDBInstances 接口查询实例 ID。
TosObjectPositions string 必选 示例值:tos-cn-beijing.volces.com:backname:slow_query.log
TOS 的对象地址。格式为 <TOS Endpoint 地址>:<TOS Bucket 名称>:<TOS 上的备份文件名称>,用英文冒号(:)分隔。
说明
TOS 上的备份文件格式当前仅支持 .bak.diff.trn.log
Databases object[] 可选 示例值:无
待恢复的数据库信息。
说明
单次最多可恢复 20 个数据库信息。
DBName string 必选 示例值:test
原数据库名称。
NewDBName string 可选 示例值:test_bak
新数据库新名称。命名规则如下:
  • 以字母开头,字母或数字结尾。
  • 长度需要在 2~60 个字符内。
  • 由字母、数字、下划线(_)组成,且字母的大小写不敏感。
  • 不能使用 master、msdb、model、tempdb、resource、rdsadmin、distribution 等预留字。
说明
当调用 CreateTosRestore 接口创建 TOS 备份恢复任务时,需关注以下信息:
  • 当不配置该参数时,默认原数据库名称保持一致。
  • 当设置该参数时,同时 BackupType 选择 Full,那么新库名不可以和已有库名重复,如果 BackupType 选择 Diff 或 LOG,那么新库名必须已存在。
RestoreType string 可选 示例值:FULL
恢复任务类型,取值如下:
  • FULL:全量恢复(默认值)。
  • DIFF:差异恢复。
  • LOG:日志恢复。
IsOnline boolean 可选 示例值:true
是否上线恢复后的数据库,方便访问,取值如下:
  • true:表示上线恢复后的数据库。
  • false:表示不上线恢复后的数据库(默认值)。
IsReplace boolean 可选 示例值:true
恢复时是否覆盖目标实例上已经存在的数据库,当前仅支持取值false,表示恢复时不覆盖目标实例上已经存在的数据库
返回参数
下方仅列出本接口特有的返回参数。更多信息请参见返回结构
RestoreTaskId string 示例值:490
恢复任务 ID。
请求示例
POST /?Action=CreateTosRestore&Version=2022-01-01 HTTP/1.1
Content-Type: application/json
Host: rds-mssql.cn-beijing.volcengineapi.com
X-Date: 20230131T101010Z
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_mssql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****
{
"TargetDBInstanceId":"mssql-1be522b5****",
"TosObjectPositions":"tos-cn-beijing.volces.com:huahua:slow_query.log",
"Databases":[
{
"DBName":"123",
"NewDBName":"testname"
}]
}
返回示例
{
"ResponseMetadata": {
"RequestId": "20230823153339243D5B69711EB66B4DEF",
"Action": "CreateTosRestore",
"Version": "2022-01-01",
"Service": "rds_mssql",
"Region": "cn-beijing"
},
"Result": {
"RestoreTaskId": "490"
}
}
错误码
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
状态码
错误码
错误信息
说明
400
OperationDenied_ImportJobExists
The operation is not permitted due to exist running import job.
当前实例正在执行数据导入任务,无法执行该操作。
400
UserBackupAmountOverTheLimit
The operation is not permitted due to the user backup amount over the limit.
手动备份的数量超过上限。
400
OperationDenied_BackupJobExists
The operation is not permitted due to exist running backup job.
当前实例正在执行备份任务,无法执行该操作。
400
OperationUnsupported
The operation is unsupported for the specified instance.
操作不支持。
400
InstanceIsNotRunning
The specified instance is not running.
当前实例状态不在运行中。
400
OperationDenied_IncrBackupUnsupportRecovery
The operation is not permitted due to incr backup unsupport recovery.
增量备份无法执行该操作。
400
MissingParameter
The input parameter %s that is mandatory for processing this request is not supplied.
缺少 {parameter1} 参数。
400
InvalidDBName_Duplicate
The specified DBName already exists.
数据库已存在。
400
TosRestoreTaskDbVerifyFailed
db verify failed, reason:%s.
DB 校验失败,原因是 {parameter1}。
400
InvalidParameter
The specified parameter %s is not valid.
参数 {parameter1} 值无效。
400
InvalidParameterFormat
The input parameter is not valid.
异常参数。
403
QuotaExceeded_RestoreDB
The quota of restore db exceeds.
恢复数据库超过配额限制。
403
OperationDenied_ResourceSoldOut
The requested resource is sold out in the specified zone; try other types of resources or other regions and zones.
当前可用区资源不足。
404
BackupNotFound
The specified instance does not exist available backup records.
未找到可用的备份记录。
404
InstanceNotFound
The specified instance does not exist.
未找到该实例。
500
InternalError
The request has failed with internal server error.
内部错误。
500
TosRestoreTaskNumExceedLimit
Too many tasks are being executed. Please submit them later.
正在执行的任务数量过多,请稍后再提交。
最近更新时间:2025.12.01 18:11:12
这个页面对您有帮助吗?
有用
有用
无用
无用