ALIYUN::RDS::MigrateTask类型用于将OSS上的备份文件还原到RDS SQL Server实例中,实现数据上云。

语法

{
  "Type": "ALIYUN::RDS::MigrateTask",
  "Properties": {
    "IsOnlineDB": Boolean,
    "DBInstanceId": String,
    "OssObjectPositions": String,
    "CheckDBMode": String,
    "BackupMode": String,
    "DBName": String,
    "OSSUrls": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
IsOnlineDB Boolean 是否将还原后的数据库带上线。 取值:
  • true:将数据库带上线。
  • false:不将数据库带上线。
说明 当数据库类型为SQL Server 2008 R2版本时,该值恒定为true。
DBInstanceId String 实例ID。
OssObjectPositions String OSS的组成部分。 取值由3段组成,用英文冒号(:)分隔:
  • OSS Endpoint地址:oss-ap-southeast-1.aliyuncs.com
  • OSS Bucket名称:rdsmssqlsingapore
  • OSS上的备份文件Key:autotest_2008R2_TestMigration_FULL.bak
说明
  • 当数据库为SQL Server 2008 R2 版本时,本参数可选。
  • 当数据库为SQL Server 2008 R2以上版本时,本参数必选。

示例:oss-ap-southeast-1.aliyuncs.com:rdsmssqlsingapore:autotest_2008R2_TestMigration_FULL.bak

CheckDBMode String 打开数据库后一致性检查方法。 取值:
  • SyncExecuteDBCheck:同步执行DB检查。
  • AsyncExecuteDBCheck(默认值):异步执行DB检查。

    兼容SQL Server 2008 R2版本。

说明 当 IsOnlineDB参数取值为true时,本参数有效。
BackupMode String 迁移上云任务类型。 取值:
  • FULL:通过全量备份文件执行还原操作。
  • UPDF:通过增量文件或日志文件还原增量部分的数据。
DBName String 目标数据库名称。
OSSUrls String 备份文件所在的OSS共享URL地址(Encode编码后的URL)。 有多个地址时,先使用“|”隔开,在编码后传入参数。
说明 当数据库为SQL Server 2008 R2版本时,本参数必选。

返回值

Fn::GetAtt

MigrateTaskId:迁移任务ID。

示例

  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "IsOnlineDB": {
          "Type": "Boolean",
          "Description": "Specifies whether to bring the restored database online for user access. Note The value for SQL Server 2008 R2 is fixed to True.",
          "AllowedValues": [
            "True",
            "true",
            "False",
            "false"
          ]
        },
        "DBInstanceId": {
          "Type": "String",
          "Description": "The ID of the instance."
        },
        "BackupMode": {
          "Type": "String",
          "Description": "The type of the migration task. Valid values:\nFULL: specifies that full backup files are used to restore data.\nUPDF: specifies that incremental backup files or log files are used to restore incremental data.",
          "AllowedValues": [
            "FULL",
            "UPDF"
          ]
        },
        "DBName": {
          "Type": "String",
          "Description": "The name of the database that you want to restore."
        }
      },
      "Resources": {
        "MigrateTask": {
          "Type": "ALIYUN::RDS::MigrateTask",
          "Properties": {
            "IsOnlineDB": {
              "Ref": "IsOnlineDB"
            },
            "DBInstanceId": {
              "Ref": "DBInstanceId"
            },
            "BackupMode": {
              "Ref": "BackupMode"
            },
            "DBName": {
              "Ref": "DBName"
            }
          }
        }
      },
      "Outputs": {
        "MigrateTaskId": {
          "Description": "The ID of the migrate task.",
          "Value": {
            "Fn::GetAtt": [
              "MigrateTask",
              "MigrateTaskId"
            ]
          }
        }
      }
    }
  • YAML 格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      IsOnlineDB:
        Type: Boolean
        Description: Specifies whether to bring the restored database online for user access. Note The value for SQL Server 2008 R2 is fixed to True.
        AllowedValues:
          - 'True'
          - 'true'
          - 'False'
          - 'false'
      DBInstanceId:
        Type: String
        Description: The ID of the instance.
      BackupMode:
        Type: String
        Description: |-
          The type of the migration task. Valid values:
          FULL: specifies that full backup files are used to restore data.
          UPDF: specifies that incremental backup files or log files are used to restore incremental data.
        AllowedValues:
          - FULL
          - UPDF
      DBName:
        Type: String
        Description: The name of the database that you want to restore.
    Resources:
      MigrateTask:
        Type: ALIYUN::RDS::MigrateTask
        Properties:
          IsOnlineDB:
            Ref: IsOnlineDB
          DBInstanceId:
            Ref: DBInstanceId
          BackupMode:
            Ref: BackupMode
          DBName:
            Ref: DBName
    Outputs:
      MigrateTaskId:
        Description: The ID of the migrate task.
        Value:
          Fn::GetAtt:
            - MigrateTask
            - MigrateTaskId