Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::DMS::ScriptExecution

Última atualização: Jun 27, 2026

Executa scripts SQL no Data Management Service (DMS).

Sintaxe

{
  "Type": "ALIYUN::DMS::ScriptExecution",
  "Properties": {
    "DbId": Integer,
    "Logic": Boolean,
    "Script": String,
    "Tid": Integer
  }
}

Propriedades

Nome da propriedade

Tipo

Obrigatório

Atualização permitida

Descrição

Restrições

DbId

Integer

Sim

Não

ID do banco de dados.

Nota

Este parâmetro corresponde ao parâmetro DatabaseId em operações de API como SearchDatabase, ListDatabases e GetDatabase. Chame essas operações para obter o ID do banco de dados.

Logic

Boolean

Sim

Não

Indica se o banco de dados é lógico.

Nenhuma

Script

String

Sim

Não

Script SQL a executar.

Aceita instruções DQL (Data Query Language), DDL (Data Definition Language) e DML (Data Manipulation Language). A execução de instruções DDL e DML depende da configuração de controle de segurança da instância.

Tid

Integer

Não

Não

ID do locatário.

Nenhuma

Valor de retorno

Fn::GetAtt

Nenhum

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Script:
    Type: String
    Description:
      en: The SQL script to execute. The script can include Data Query Language (DQL), Data Definition Language (DDL), and Data Manipulation Language (DML) statements. The ability to execute DDL and DML statements depends on the security control configuration of the instance.
    Required: true
    Default: select dt from report_daily
  DbId:
    Type: Number
    Description:
      en: |-
        The database ID.
        > Note: This parameter corresponds to the `DatabaseId` parameter in API operations such as `SearchDatabase`, `ListDatabases`, and `GetDatabase`. You can call these operations to obtain the database ID.
    Required: true
  Logic:
    Type: Boolean
    Description:
      en: Indicates whether the database is a logical database.
    Required: true
Resources:
  ScriptExecution:
    Type: ALIYUN::DMS::ScriptExecution
    Properties:
      Script:
        Ref: Script
      DbId:
        Ref: DbId
      Logic:
        Ref: Logic
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Script": {
      "Type": "String",
      "Description": {
        "en": "The SQL script to execute. The script can include Data Query Language (DQL), Data Definition Language (DDL), and Data Manipulation Language (DML) statements. The ability to execute DDL and DML statements depends on the security control configuration of the instance."
      },
      "Required": true,
      "Default": "select dt from report_daily"
    },
    "DbId": {
      "Type": "Number",
      "Description": {
        "en": "The database ID.\n> Note: This parameter corresponds to the `DatabaseId` parameter in API operations such as `SearchDatabase`, `ListDatabases`, and `GetDatabase`. You can call these operations to obtain the database ID."
      },
      "Required": true
    },
    "Logic": {
      "Type": "Boolean",
      "Description": {
        "en": "Indicates whether the database is a logical database."
      },
      "Required": true
    }
  },
  "Resources": {
    "ScriptExecution": {
      "Type": "ALIYUN::DMS::ScriptExecution",
      "Properties": {
        "Script": {
          "Ref": "Script"
        },
        "DbId": {
          "Ref": "DbId"
        },
        "Logic": {
          "Ref": "Logic"
        }
      }
    }
  }
}