ALIYUN::HBR::DbPlan類型用于創建備份計劃。

語法

{
  "Type": "ALIYUN::HBR::DbPlan",
  "Properties": {
    "Options": String,
    "InstanceUuid": String,
    "SourceType": String,
    "VaultId": String,
    "Source": Map,
    "ContinuousPlan": String,
    "IncPlan": String,
    "MaxRetrySeconds": Integer,
    "HostUuid": String,
    "CumulativePlan": String,
    "FullPlan": String,
    "LogPlan": String,
    "MaxRateLimit": Integer,
    "DbPlanName": String
  }
}

屬性

屬性名稱 類型 必須 允許更新 描述 約束
Options String 備份選項。 取值為JSON格式的字符串,且不同數據源類型(SourceType)對應的取值不同。
  • 當數據源類型為ORACLE時,取值示例:{"channels":4,"compression":"lzop","offline_backup":false,"archivelog_reserve_hours":24,"custom_commands":""}
    • channels:表示并發的數量。
    • archivelog_reserve_hours:表示備份作業完成后,刪除存檔日志的時間。
    • 其他參數應使用默認值。
    說明 關于備份Oracle的更多信息,請參見備份Oracle。
  • 當數據源類型為MYSQL時,取值示例:{"channels":4,"compression":"lzop","del_binlog":false},

    其中,del_binlog表示備份完成后是否刪除binlog,僅對日志備份或實時備份生效。

    說明 關于備份MYSQL的更多信息,請參見備份MYSQL
  • 當數據源類型為MSSQL時,取值示例:{\"channels\":4,\"verify\":false,\"compression\":\"lzop\",\"backup_new_databases\":false}.
    說明 關于備份MSSQL的更多信息,請參見備份SQL Server。
InstanceUuid String 數據庫實例UUID。
SourceType String 數據源類型。 取值:
  • MYSQL
  • ORACLE
  • MSSQL
VaultId String 倉庫ID。
Source Map 將要備份的數據庫實例。 更多信息,請參見Source語法Source屬性
ContinuousPlan String 連續日志備份計劃。 取值:{"type": "continuous"}
IncPlan String 增量備份計劃。

僅適用于MYSQL和ORACLE類型的數據源。

取值為JSON格式的字符串,具體示例如下:
  • 按日周期備份時:{"type": "daily", "start": "00:00:00", "interval": 3},
  • 按星期周期備份時:{"type":"weekly","start": "03:00:00","days": [1,2,3,4,5],"interval": 1}
說明
  • day表示具體某一天,取值范圍是0~6,其中0表示星期天。
  • interval表示間隔,取值范圍是1~52。
MaxRetrySeconds Integer 斷線重連時間。 備份時,斷開數據庫后重新連接的時間間隔。默認為600秒。
HostUuid String 客戶端主機UUID。
CumulativePlan String 累計增量備份計劃。

僅適用于MSSQL類型的數據源。

取值為JSON格式的字符串,具體示例如下:
  • 按日周期備份時:{"type": "daily", "start": "00:00:00", "interval": 3},
  • 按星期周期備份時:{"type":"weekly","start": "03:00:00","days": [1,2,3,4,5],"interval": 1}
說明
  • day表示具體某一天,取值范圍是0~6,其中0表示星期天。
  • interval表示間隔,取值范圍是1~52。
FullPlan String 完全備份計劃。 取值為JSON格式的字符串,具體示例如下:
  • 按日周期備份時:{"type": "daily", "start": "00:00:00", "interval": 3},
  • 按星期周期備份時:{"type":"weekly","start": "03:00:00","days": [1,2,3,4,5],"interval": 1}
說明
  • day表示具體某一天,取值范圍是0~6,其中0表示星期天。
  • interval表示間隔,取值范圍是1~52。
LogPlan String 日志備份計劃。 取值為JSON格式的字符串,具體示例如下:
  • 按日周期備份時:{"type": "daily", "start": "00:00:00", "interval": 3},
  • 按星期周期備份時:{"type":"weekly","start": "03:00:00","days": [1,2,3,4,5],"interval": 1}
說明
  • day表示具體某一天,取值范圍是0~6,其中0表示星期天。
  • interval表示間隔,取值范圍是1~52。
MaxRateLimit Integer 速度限制。 默認為0,表示不限速。
DbPlanName String 備份計劃的名稱。

Source語法

"Source": {
  "Entries": List
}

Source屬性

屬性名稱 類型 必須 允許更新 描述 約束
Entries List 備份源。 取值:
  • 當數據源類型為ORACLE時:["oracle://${instanceName}", "oracle://${instanceName}/archivelog"]。

    其中${instanceName}為Oracle數據庫實例的名稱,可從dbAgent(ORACLE)資源獲取。

  • 當數據源類型為MYSQL時:["mysql://${instanceName}"]

    其中${instanceName}為MYSQL數據庫實例的名稱,可從dbAgent(MySQL)資源獲取。

  • 當數據源類型為MSSQL時:["mssql://${instanceName}/${databse1}", "mssql://${instanceName}/${databse2}"]

    其中,${database}可以從dbAgent資源(MSSQL)獲取。

返回值

Fn::GetAtt

  • Options:JSON格式的備份選項。
  • InstanceUuid:數據庫實例ID
  • CumulativeUuid:增量計劃ID。
  • SourceType:數據庫類型。
  • PlanId:計劃ID。
  • LogUuid:日志ID。
  • VaultId:倉庫ID。
  • IncUuid:增量備份計劃ID。
  • ContinuousPlan:連續日志備份計劃。
  • IncPlan:增量備份計劃。
  • MaxRetrySeconds:斷線重連時間。
  • Target:要備份的目標。
  • HostUuid:客戶端主機UUID。
  • ContinuousUuid:連續日志備份UUID。
  • CumulativePlan:累計增量備份計劃。
  • FullPlan:完全備份計劃。
  • LogPlan:日志備份計劃。
  • MaxRateLimit:速度限制。
  • FullUuid:完全備份計劃UUID。
  • DbPlanName:備份計劃的名稱。

示例

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Options": {
      "Type": "String",
      "Description": "Backup options in json format, different for each type of database. For Oracle, use {\"channels\":4,\"compression\":\"lzop\",\"offline_backup\":false,\"archivelog_reserve_hours\":24,\"custom_commands\":\"\"}, \"channels\" means numbers of concurrent theads, \"archivelog_reserve_hours\" means how long before the archive log will be deleted after backup job completed, other paramters should use the default value. For Mysql, use {\"channels\":4,\"compression\":\"lzop\",\"del_binlog\":false}, \"del_binlog\" means whether the binlog will be deleted after backup completed, only take effect for log or continuous backup. For SQL Server, use {\\\"channels\\\":4,\\\"verify\\\":false,\\\"compression\\\":\\\"lzop\\\",\\\"backup_new_databases\\\":false}.",
      "Default": "{\"channels\":4,\"compression\":\"lzop\",\"del_binlog\":false}"
    },
    "InstanceUuid": {
      "Type": "String",
      "Description": "Uuid of database instance.",
      "Default": "d12729b82116154****"
    },
    "SourceType": {
      "Type": "String",
      "Description": "Database type, allowed value: MYSQL, ORACLE, MSSQL",
      "Default": "MYSQL"
    },
    "VaultId": {
      "Type": "String",
      "Description": "Vault ID to create backup plan, the backup data will be stored to the vault.",
      "Default": "v-df****"
    },
    "Source": {
      "Type": "Json",
      "Description": "Which database instance or database will be backup.",
      "Default": "{\n  \"Entries\": [\n    \"mysql://MYSQL-3306\"\n  ]\n}"
    },
    "ContinuousPlan": {
      "Type": "String",
      "Description": "Continuous backup plan schedule. Use {   \"type\": \"continuous\" }.",
      "Default": "continuous"
    },
    "IncPlan": {
      "Type": "String",
      "Description": "Incremental backup plan schedule. Only for mysql and oracle. More details see FullPlan.",
      "Default": "{\n    \"interval\": 1,\n    \"start\": \"00:00:00\",\n    \"type\": \"daily\"\n  }"
    },
    "MaxRetrySeconds": {
      "Type": "Number",
      "Description": "Max retry seconds on network failure.",
      "Default": "600"
    },
    "HostUuid": {
      "Type": "String",
      "Description": "Uuid of the host of the database instance.",
      "Default": "701781640b3afc****"
    },
    "FullPlan": {
      "Type": "String",
      "Description": "Full backup plan schedule. daily: {\"type\": \"daily\", \"start\": \"00:00:00\", \"interval\": 3}, weekly {\"type\":\"weekly\",\"start\": \"03:00:00\",\"days\": [1,2,3,4,5],\"interval\": 1}, days can be 0 - 6, 0 means Sunday, and interval can be 1 - 52.",
      "Default": "{\n    \"days\": [\n      6\n    ],\n    \"interval\": 1,\n    \"start\": \"18:00:00\",\n    \"type\": \"weekly\"\n  }"
    },
    "DbPlanName": {
      "Type": "String",
      "Description": "Display name of the backup plan.",
      "Default": "test"
    }
  },
  "Resources": {
    "HBRDbPlan": {
      "Type": "ALIYUN::HBR::DbPlan",
      "Properties": {
        "Options": {
          "Ref": "Options"
        },
        "InstanceUuid": {
          "Ref": "InstanceUuid"
        },
        "SourceType": {
          "Ref": "SourceType"
        },
        "VaultId": {
          "Ref": "VaultId"
        },
        "Source": {
          "Ref": "Source"
        },
        "ContinuousPlan": {
          "Ref": "ContinuousPlan"
        },
        "IncPlan": {
          "Ref": "IncPlan"
        },
        "MaxRetrySeconds": {
          "Ref": "MaxRetrySeconds"
        },
        "HostUuid": {
          "Ref": "HostUuid"
        },
        "FullPlan": {
          "Ref": "FullPlan"
        },
        "DbPlanName": {
          "Ref": "DbPlanName"
        }
      }
    }
  },
  "Outputs": {
    "Options": {
      "Description": "Backup options in json format, different for each type of database. For Oracle, use {\"channels\":4,\"compression\":\"lzop\",\"offline_backup\":false,\"archivelog_reserve_hours\":24,\"custom_commands\":\"\"}, \"channels\" means numbers of concurrent theads, \"archivelog_reserve_hours\" means how long before the archive log will be deleted after backup job completed, other paramters should use the default value. For Mysql, use {\"channels\":4,\"compression\":\"lzop\",\"del_binlog\":false}, \"del_binlog\" means whether the binlog will be deleted after backup completed, only take effect for log or continuous backup. For SQL Server, use {\\\"channels\\\":4,\\\"verify\\\":false,\\\"compression\\\":\\\"lzop\\\",\\\"backup_new_databases\\\":false}.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "Options"
        ]
      }
    },
    "InstanceUuid": {
      "Description": "Uuid of database instance.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "InstanceUuid"
        ]
      }
    },
    "CumulativeUuid": {
      "Description": "Uuid of cumulative plan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "CumulativeUuid"
        ]
      }
    },
    "SourceType": {
      "Description": "Database type, allowed value: MYSQL, ORACLE, MSSQL",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "SourceType"
        ]
      }
    },
    "PlanId": {
      "Description": "Id of the backup plan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "PlanId"
        ]
      }
    },
    "LogUuid": {
      "Description": "Uuid of the log backup plan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "LogUuid"
        ]
      }
    },
    "VaultId": {
      "Description": "Vault ID to create backup plan, the backup data will be stored to the vault.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "VaultId"
        ]
      }
    },
    "IncUuid": {
      "Description": "Uuid of the incremental bakcup plan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "IncUuid"
        ]
      }
    },
    "ContinuousPlan": {
      "Description": "Continuous backup plan schedule. Use {   \"type\": \"continuous\" }.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "ContinuousPlan"
        ]
      }
    },
    "IncPlan": {
      "Description": "Incremental backup plan schedule. Only for mysql and oracle. More details see FullPlan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "IncPlan"
        ]
      }
    },
    "MaxRetrySeconds": {
      "Description": "Max retry seconds on network failure.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "MaxRetrySeconds"
        ]
      }
    },
    "Target": {
      "Description": "Target vault to backup.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "Target"
        ]
      }
    },
    "HostUuid": {
      "Description": "Uuid of the host of the database instance.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "HostUuid"
        ]
      }
    },
    "ContinuousUuid": {
      "Description": "Uuid of continuous backup plan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "ContinuousUuid"
        ]
      }
    },
    "CumulativePlan": {
      "Description": "Cumulative plan schedule, only for mssql. More details see FullPlan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "CumulativePlan"
        ]
      }
    },
    "FullPlan": {
      "Description": "Full backup plan schedule. daily: {\"type\": \"daily\", \"start\": \"00:00:00\", \"interval\": 3}, weekly {\"type\":\"weekly\",\"start\": \"03:00:00\",\"days\": [1,2,3,4,5],\"interval\": 1}, days can be 0 - 6, 0 means Sunday, and interval can be 1 - 52.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "FullPlan"
        ]
      }
    },
    "LogPlan": {
      "Description": "Log backup plan schedule.More details see FullPlan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "LogPlan"
        ]
      }
    },
    "MaxRateLimit": {
      "Description": "Max rate limit for backup job,",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "MaxRateLimit"
        ]
      }
    },
    "FullUuid": {
      "Description": "Uuid of full backup plan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "FullUuid"
        ]
      }
    },
    "DbPlanName": {
      "Description": "Display name of the backup plan.",
      "Value": {
        "Fn::GetAtt": [
          "HBRDbPlan",
          "DbPlanName"
        ]
      }
    }
  }
}