Alibaba Cloud DMS Database Read/Write Search for target databases and execute SQL queries and data modifications via Alibaba Cloud DMS OpenAPI. Scenario Description This skill implements the following workflow: 1. Search Target Database — Search databases by keyword to get Database ID 2. Execute SQL Query — Execute SQL statements on the target database Architecture Prerequisites AI-Mode Lifecycle (MUST follow in order) This skill MUST run inside an AI-Mode session. Treat the following five steps as a strict lifecycle — do not skip, reorder, or interleave the setup steps with command execution…

; then\n echo \"Error: --db-id 必须是正整数\" >&2\n exit 1\nfi\nif [[ ${#DB_ID} -gt 19 ]]; then\n echo \"Error: --db-id 超出有效范围 (最大 19 位数字)\" >&2\n exit 1\nfi\n\nif [[ -z \"$SQL\" ]]; then\n echo \"Error: --sql is required\" >&2\n print_help >&2\n exit 1\nfi\n\n# Validate SQL: length 1-10000 characters\nif [[ ${#SQL} -gt 10000 ]]; then\n echo \"Error: SQL 语句长度不能超过 10000 个字符\" >&2\n exit 1\nfi\nif [[ ${#SQL} -lt 1 ]]; then\n echo \"Error: SQL 语句不能为空\" >&2\n exit 1\nfi\n\n# Validate REGION: must match Alibaba Cloud region format\nif ! echo \"$REGION\" | grep -qE '^[a-z]{2,3}-[a-z]+-?[0-9]*

Alibaba Cloud DMS Database Read/Write Search for target databases and execute SQL queries and data modifications via Alibaba Cloud DMS OpenAPI. Scenario Description This skill implements the following workflow: 1. Search Target Database — Search databases by keyword to get Database ID 2. Execute SQL Query — Execute SQL statements on the target database Architecture Prerequisites AI-Mode Lifecycle (MUST follow in order) This skill MUST run inside an AI-Mode session. Treat the following five steps as a strict lifecycle — do not skip, reorder, or interleave the setup steps with command execution…

; then\n echo \"Error: region 格式不正确,应为阿里云 Region ID 格式 (如 cn-hangzhou, cn-shanghai, us-west-1)\" >&2\n exit 1\nfi\n\n# Check if jq is installed\nif ! command -v jq &> /dev/null; then\n echo \"Error: jq is required for JSON parsing. Install with: brew install jq\" >&2\n exit 1\nfi\n\n# Check if aliyun cli is installed\nif ! command -v aliyun &> /dev/null; then\n echo \"Error: aliyun-cli is not installed. Install with: brew install aliyun-cli\" >&2\n exit 1\nfi\n\n# User-Agent for tracking\nUSER_AGENT=\"AlibabaCloud-Agent-Skills/alibabacloud-dms-skill\"\n\n# Timeout settings (in seconds)\nREAD_TIMEOUT=10\nCONNECT_TIMEOUT=10\n\n# Detect write operation type\nSQL_UPPER=$(echo \"$SQL\" | tr '[:lower:]' '[:upper:]')\nIS_WRITE_OP=false\nWRITE_OP_TYPE=\"\"\n\nif echo \"$SQL_UPPER\" | grep -qE '^\\s*INSERT\\s'; then\n IS_WRITE_OP=true\n WRITE_OP_TYPE=\"INSERT\"\nelif echo \"$SQL_UPPER\" | grep -qE '^\\s*UPDATE\\s'; then\n IS_WRITE_OP=true\n WRITE_OP_TYPE=\"UPDATE\"\nelif echo \"$SQL_UPPER\" | grep -qE '^\\s*DELETE\\s'; then\n IS_WRITE_OP=true\n WRITE_OP_TYPE=\"DELETE\"\nelif echo \"$SQL_UPPER\" | grep -qE '^\\s*(DROP|TRUNCATE|ALTER|RENAME)\\s'; then\n # Block destructive DDL operations completely\n echo \"Error: 安全检查失败 - 不允许执行 DDL 破坏性操作 (DROP/TRUNCATE/ALTER/RENAME)\" >&2\n echo \" 这些操作可能导致数据不可恢复丢失,请通过 DMS 控制台执行\" >&2\n exit 1\nfi\n\n# Handle write operations with protective pre-check\nif [[ \"$IS_WRITE_OP\" == \"true\" ]]; then\n echo \"\" >&2\n echo \"========================================\" >&2\n echo \" [警告] 检测到写操作: $WRITE_OP_TYPE\" >&2\n echo \"========================================\" >&2\n echo \" 目标数据库 ID: $DB_ID\" >&2\n echo \" SQL 语句:\" >&2\n echo \" $SQL\" >&2\n echo \"========================================\" >&2\n \n if [[ \"$DRY_RUN\" == \"true\" ]]; then\n echo \"\" >&2\n echo \"[DRY-RUN 模式] 仅预览,不会执行实际操作\" >&2\n echo \"如需执行,请移除 --dry-run 参数并添加 --force 参数\" >&2\n exit 0\n fi\n \n if [[ \"$FORCE\" != \"true\" ]]; then\n echo \"\" >&2\n echo \"此操作将修改数据库数据。\" >&2\n echo \"如需执行,请添加 --force 参数确认操作。\" >&2\n echo \"如需预览,请添加 --dry-run 参数。\" >&2\n echo \"\" >&2\n echo \"示例:\" >&2\n echo \" $0 --db-id $DB_ID --sql \\\"$SQL\\\" --force\" >&2\n echo \" $0 --db-id $DB_ID --sql \\\"$SQL\\\" --dry-run\" >&2\n exit 1\n fi\n \n echo \"\" >&2\n echo \"[--force 已确认] 将执行写操作...\" >&2\n echo \"\" >&2\nfi\n\n# Step 1: Get Tenant ID (Tid)\necho \"Fetching Tenant ID...\" >&2\nTID_RESPONSE=$(aliyun dms-enterprise get-user-active-tenant \\\n --region \"$REGION\" \\\n --user-agent \"$USER_AGENT\" \\\n --read-timeout \"$READ_TIMEOUT\" \\\n --connect-timeout \"$CONNECT_TIMEOUT\" 2>&1)\n\n# Check if the request was successful\nif ! echo \"$TID_RESPONSE\" | jq -e '.Success' > /dev/null 2>&1; then\n echo \"Error: Failed to get Tenant ID\" >&2\n echo \"$TID_RESPONSE\" >&2\n exit 1\nfi\n\nSUCCESS=$(echo \"$TID_RESPONSE\" | jq -r '.Success')\nif [[ \"$SUCCESS\" != \"true\" ]]; then\n ERROR_MSG=$(echo \"$TID_RESPONSE\" | jq -r '.ErrorMessage // \"Unknown error\"')\n echo \"Error: $ERROR_MSG\" >&2\n exit 1\nfi\n\nTID=$(echo \"$TID_RESPONSE\" | jq -r '.Tenant.Tid')\nif [[ -z \"$TID\" || \"$TID\" == \"null\" ]]; then\n echo \"Error: Failed to extract Tid from response\" >&2\n exit 1\nfi\n\necho \"Tenant ID: $TID\" >&2\n\n# Step 2: Execute SQL Script\necho \"Executing SQL on database $DB_ID...\" >&2\n\n# Build command arguments\nCMD_ARGS=(\n \"dms-enterprise\" \"execute-script\"\n \"--tid\" \"$TID\"\n \"--db-id\" \"$DB_ID\"\n \"--script\" \"$SQL\"\n \"--logic\" \"$LOGIC\"\n \"--region\" \"$REGION\"\n \"--user-agent\" \"$USER_AGENT\"\n \"--read-timeout\" \"$READ_TIMEOUT\"\n \"--connect-timeout\" \"$CONNECT_TIMEOUT\"\n)\n\nEXEC_RESPONSE=$(aliyun \"${CMD_ARGS[@]}\" 2>&1)\n\n# Check if the request was successful\nSUCCESS=$(echo \"$EXEC_RESPONSE\" | jq -r '.Success')\nif [[ \"$SUCCESS\" != \"true\" ]]; then\n ERROR_MSG=$(echo \"$EXEC_RESPONSE\" | jq -r '.ErrorMessage // \"Unknown error\"')\n echo \"Error: 执行SQL失败 - $ERROR_MSG\" >&2\n exit 1\nfi\n\n# Extract results\nRESULTS=$(echo \"$EXEC_RESPONSE\" | jq '.Results.Results // []')\n\nif [[ \"$OUTPUT_JSON\" == \"true\" ]]; then\n # Output JSON format\n echo \"$RESULTS\" | jq '.'\nelse\n # Output table format\n RESULT_COUNT=$(echo \"$RESULTS\" | jq 'length')\n \n if [[ \"$RESULT_COUNT\" -eq 0 ]]; then\n echo \"查询完成,无返回结果\"\n else\n for ((i=0; i\u003cRESULT_COUNT; i++)); do\n RESULT=$(echo \"$RESULTS\" | jq \".[$i]\")\n \n if [[ \"$RESULT_COUNT\" -gt 1 ]]; then\n echo \"--- 结果集 $((i+1)) ---\"\n fi\n \n RESULT_SUCCESS=$(echo \"$RESULT\" | jq -r '.Success')\n if [[ \"$RESULT_SUCCESS\" != \"true\" ]]; then\n MSG=$(echo \"$RESULT\" | jq -r '.Message // \"Unknown error\"')\n echo \"错误: $MSG\"\n continue\n fi\n \n # Get column names\n COLUMNS=$(echo \"$RESULT\" | jq -r '.ColumnNames // [] | @tsv')\n if [[ -n \"$COLUMNS\" ]]; then\n echo \"$COLUMNS\"\n echo \"--------------------------------------------------\"\n fi\n \n # Get rows\n ROWS=$(echo \"$RESULT\" | jq -r '.Rows.Row // []')\n ROW_COUNT=$(echo \"$ROWS\" | jq 'length')\n \n for ((j=0; j\u003cROW_COUNT; j++)); do\n ROW_VALUES=$(echo \"$ROWS\" | jq -r \".[$j].RowValue // [] | @tsv\")\n echo \"$ROW_VALUES\"\n done\n \n TOTAL_ROWS=$(echo \"$RESULT\" | jq -r '.RowCount // 0')\n echo \"\"\n echo \"($TOTAL_ROWS rows)\"\n done\n fi\nfi\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":9392,"content_sha256":"c40ff38afd3ff51fbab282b666c4abd37f887e531dc1eed86d8bae0258332957"},{"filename":"scripts/search_database.sh","content":"#!/bin/bash\n# Search DMS databases by keyword using aliyun-cli.\n#\n# Prerequisites:\n# - aliyun-cli installed (brew install aliyun-cli)\n# - aliyun configure set --mode AK --access-key-id \u003cAK> --access-key-secret \u003cSK> --region cn-hangzhou\n# - jq installed for JSON parsing (brew install jq)\n#\n# Usage:\n# ./search_database.sh \u003ckeyword>\n# ./search_database.sh testdb\n# ./search_database.sh testdb --json\n\nset -e\n\n# Default region\nREGION=\"${REGION:-cn-hangzhou}\"\n\n# Parse arguments\nKEYWORD=\"\"\nOUTPUT_JSON=false\n\nwhile [[ $# -gt 0 ]]; do\n case \"$1\" in\n --json)\n OUTPUT_JSON=true\n shift\n ;;\n --region)\n REGION=\"$2\"\n shift 2\n ;;\n -h|--help)\n echo \"Usage: $0 \u003ckeyword> [--json] [--region \u003cregion>]\"\n echo \"\"\n echo \"Arguments:\"\n echo \" keyword Search keyword for database name\"\n echo \" --json Output results in JSON format\"\n echo \" --region Aliyun region (default: cn-hangzhou)\"\n echo \"\"\n echo \"Examples:\"\n echo \" $0 mydb\"\n echo \" $0 mydb --json\"\n echo \" $0 mydb --region cn-shanghai\"\n exit 0\n ;;\n -*)\n echo \"Unknown option: $1\" >&2\n exit 1\n ;;\n *)\n KEYWORD=\"$1\"\n shift\n ;;\n esac\ndone\n\nif [[ -z \"$KEYWORD\" ]]; then\n echo \"Error: keyword is required\" >&2\n echo \"Usage: $0 \u003ckeyword> [--json] [--region \u003cregion>]\" >&2\n exit 1\nfi\n\n# Validate KEYWORD: length 1-128 characters, alphanumeric and common symbols only\nif [[ ${#KEYWORD} -gt 128 ]]; then\n echo \"Error: keyword 长度不能超过 128 个字符\" >&2\n exit 1\nfi\nif ! echo \"$KEYWORD\" | grep -qE '^[a-zA-Z0-9_\\-\\.]+

Alibaba Cloud DMS Database Read/Write Search for target databases and execute SQL queries and data modifications via Alibaba Cloud DMS OpenAPI. Scenario Description This skill implements the following workflow: 1. Search Target Database — Search databases by keyword to get Database ID 2. Execute SQL Query — Execute SQL statements on the target database Architecture Prerequisites AI-Mode Lifecycle (MUST follow in order) This skill MUST run inside an AI-Mode session. Treat the following five steps as a strict lifecycle — do not skip, reorder, or interleave the setup steps with command execution…

; then\n echo \"Error: keyword 只能包含字母、数字、下划线、连字符和点号\" >&2\n exit 1\nfi\n\n# Validate REGION: must match Alibaba Cloud region format\nif ! echo \"$REGION\" | grep -qE '^[a-z]{2,3}-[a-z]+-?[0-9]*

Alibaba Cloud DMS Database Read/Write Search for target databases and execute SQL queries and data modifications via Alibaba Cloud DMS OpenAPI. Scenario Description This skill implements the following workflow: 1. Search Target Database — Search databases by keyword to get Database ID 2. Execute SQL Query — Execute SQL statements on the target database Architecture Prerequisites AI-Mode Lifecycle (MUST follow in order) This skill MUST run inside an AI-Mode session. Treat the following five steps as a strict lifecycle — do not skip, reorder, or interleave the setup steps with command execution…

; then\n echo \"Error: region 格式不正确,应为阿里云 Region ID 格式 (如 cn-hangzhou, cn-shanghai, us-west-1)\" >&2\n exit 1\nfi\n\n# Check if jq is installed\nif ! command -v jq &> /dev/null; then\n echo \"Error: jq is required for JSON parsing. Install with: brew install jq\" >&2\n exit 1\nfi\n\n# Check if aliyun cli is installed\nif ! command -v aliyun &> /dev/null; then\n echo \"Error: aliyun-cli is not installed. Install with: brew install aliyun-cli\" >&2\n exit 1\nfi\n\n# User-Agent for tracking\nUSER_AGENT=\"AlibabaCloud-Agent-Skills/alibabacloud-dms-skill\"\n\n# Timeout settings (in seconds)\nREAD_TIMEOUT=10\nCONNECT_TIMEOUT=10\n\n# Step 1: Get Tenant ID (Tid)\necho \"Fetching Tenant ID...\" >&2\nTID_RESPONSE=$(aliyun dms-enterprise get-user-active-tenant \\\n --region \"$REGION\" \\\n --user-agent \"$USER_AGENT\" \\\n --read-timeout \"$READ_TIMEOUT\" \\\n --connect-timeout \"$CONNECT_TIMEOUT\" 2>&1)\n\n# Check if the request was successful\nif ! echo \"$TID_RESPONSE\" | jq -e '.Success' > /dev/null 2>&1; then\n echo \"Error: Failed to get Tenant ID\" >&2\n echo \"$TID_RESPONSE\" >&2\n exit 1\nfi\n\nSUCCESS=$(echo \"$TID_RESPONSE\" | jq -r '.Success')\nif [[ \"$SUCCESS\" != \"true\" ]]; then\n ERROR_MSG=$(echo \"$TID_RESPONSE\" | jq -r '.ErrorMessage // \"Unknown error\"')\n echo \"Error: $ERROR_MSG\" >&2\n exit 1\nfi\n\nTID=$(echo \"$TID_RESPONSE\" | jq -r '.Tenant.Tid')\nif [[ -z \"$TID\" || \"$TID\" == \"null\" ]]; then\n echo \"Error: Failed to extract Tid from response\" >&2\n exit 1\nfi\n\necho \"Tenant ID: $TID\" >&2\n\n# Step 2: Search Database\necho \"Searching databases with keyword: $KEYWORD\" >&2\nSEARCH_RESPONSE=$(aliyun dms-enterprise search-database \\\n --tid \"$TID\" \\\n --search-key \"$KEYWORD\" \\\n --region \"$REGION\" \\\n --user-agent \"$USER_AGENT\" \\\n --read-timeout \"$READ_TIMEOUT\" \\\n --connect-timeout \"$CONNECT_TIMEOUT\" 2>&1)\n\n# Check if the request was successful\nSUCCESS=$(echo \"$SEARCH_RESPONSE\" | jq -r '.Success')\nif [[ \"$SUCCESS\" != \"true\" ]]; then\n ERROR_MSG=$(echo \"$SEARCH_RESPONSE\" | jq -r '.ErrorMessage // \"Unknown error\"')\n echo \"Error: $ERROR_MSG\" >&2\n exit 1\nfi\n\n# Extract database list\nDATABASES=$(echo \"$SEARCH_RESPONSE\" | jq '.SearchDatabaseList.SearchDatabase // []')\n\nif [[ \"$OUTPUT_JSON\" == \"true\" ]]; then\n # Output JSON format\n echo \"$DATABASES\" | jq '.'\nelse\n # Output table format\n DB_COUNT=$(echo \"$DATABASES\" | jq 'length')\n \n if [[ \"$DB_COUNT\" -eq 0 ]]; then\n echo \"未找到匹配的数据库\"\n else\n echo \"\"\n echo \"共找到 $DB_COUNT 个匹配:\"\n echo \"\"\n printf \"%-15s %-25s %-12s %-30s\\n\" \"DATABASE_ID\" \"SCHEMA_NAME\" \"DB_TYPE\" \"HOST:PORT\"\n printf \"%s\\n\" \"-------------------------------------------------------------------------------------\"\n \n echo \"$DATABASES\" | jq -r '.[] | \"\\(.DatabaseId // \"N/A\")|\\(.SchemaName // \"N/A\")|\\(.DbType // \"N/A\")|\\(.Host // \"N/A\"):\\(.Port // \"N/A\")\"' | \\\n while IFS='|' read -r db_id schema_name db_type host_port; do\n printf \"%-15s %-25s %-12s %-30s\\n\" \"$db_id\" \"$schema_name\" \"$db_type\" \"$host_port\"\n done\n fi\nfi\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":5177,"content_sha256":"f9b8f32c365ec9de6a50cb1e8a380ac827b99cf420203626b0cefe1c297200c7"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Alibaba Cloud DMS Database Read/Write","type":"text"}]},{"type":"paragraph","content":[{"text":"Search for target databases and execute SQL queries and data modifications via Alibaba Cloud DMS OpenAPI.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Scenario Description","type":"text"}]},{"type":"paragraph","content":[{"text":"This skill implements the following workflow:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Search Target Database","type":"text","marks":[{"type":"strong"}]},{"text":" — Search databases by keyword to get Database ID","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Execute SQL Query","type":"text","marks":[{"type":"strong"}]},{"text":" — Execute SQL statements on the target database","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Architecture","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"User Request → Search Database → Get Database ID → Execute SQL → Return Results","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Prerequisites","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"AI-Mode Lifecycle (MUST follow in order)","type":"text"}]},{"type":"paragraph","content":[{"text":"This skill MUST run inside an AI-Mode session. Treat the following five steps as a strict lifecycle — do not skip, reorder, or interleave the setup steps with command execution:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"1. aliyun configure ai-mode enable # Enable AI-Mode\n2. aliyun configure ai-mode set-user-agent AlibabaCloud-Agent-Skills/alibabacloud-dms-skill # Register skill User-Agent\n3. aliyun configure set --auto-plugin-install true && aliyun plugin update # Plugin update\n4. \u003cexecute DMS commands via ./scripts/*.sh> # Execute commands\n5. aliyun configure ai-mode disable # Disable AI-Mode (Cleanup)","type":"text"}]},{"type":"paragraph","content":[{"text":"Steps 1–3 belong to setup (this section). Step 4 is covered by ","type":"text"},{"text":"Core Workflow","type":"text","marks":[{"type":"link","attrs":{"href":"#core-workflow","title":null}}]},{"text":". Step 5 is covered by ","type":"text"},{"text":"Cleanup","type":"text","marks":[{"type":"link","attrs":{"href":"#cleanup","title":null}}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Pre-checks","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Pre-check 0: Aliyun CLI >= 3.3.3 required","type":"text","marks":[{"type":"strong"}]},{"text":" Run ","type":"text"},{"text":"aliyun version","type":"text","marks":[{"type":"code_inline"}]},{"text":" to verify >= 3.3.3. If not installed or version too low, run ","type":"text"},{"text":"curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash","type":"text","marks":[{"type":"code_inline"}]},{"text":" to install/update, or see ","type":"text"},{"text":"references/cli-installation-guide.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for installation instructions.","type":"text"}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Pre-check 1: Enable AI-Mode","type":"text","marks":[{"type":"strong"}]},{"text":" [MUST] run ","type":"text"},{"text":"aliyun configure ai-mode enable","type":"text","marks":[{"type":"code_inline"}]},{"text":" to enable AI-Mode before any other configuration or command. This activates the AI-Mode session that downstream OpenAPI services use to recognize agent-issued traffic.","type":"text"}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Pre-check 2: Register skill User-Agent under AI-Mode","type":"text","marks":[{"type":"strong"}]},{"text":" [MUST] run ","type":"text"},{"text":"aliyun configure ai-mode set-user-agent AlibabaCloud-Agent-Skills/alibabacloud-dms-skill","type":"text","marks":[{"type":"code_inline"}]},{"text":" to register this skill's identifier as the AI-Mode User-Agent for the current session. Run this immediately after ","type":"text"},{"text":"ai-mode enable","type":"text","marks":[{"type":"code_inline"}]},{"text":" and before any plugin update or DMS command.","type":"text"}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Pre-check 3: Aliyun CLI plugin update required","type":"text","marks":[{"type":"strong"}]},{"text":" [MUST] run ","type":"text"},{"text":"aliyun configure set --auto-plugin-install true","type":"text","marks":[{"type":"code_inline"}]},{"text":" to enable automatic plugin installation. [MUST] run ","type":"text"},{"text":"aliyun plugin update","type":"text","marks":[{"type":"code_inline"}]},{"text":" to ensure that any existing plugins are always up-to-date. Plugin update MUST happen AFTER AI-Mode is enabled and the User-Agent is registered, so the plugin manager itself reports the correct identifier.","type":"text"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Aliyun CLI >= 3.3.3","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"jq (for JSON parsing): ","type":"text"},{"text":"brew install jq","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Credentials configured via ","type":"text"},{"text":"aliyun configure","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Pre-check 4: Alibaba Cloud Credentials Required","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"Security Rules:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NEVER","type":"text","marks":[{"type":"strong"}]},{"text":" read, echo, or print AK/SK values (e.g., ","type":"text"},{"text":"echo $ALIBABA_CLOUD_ACCESS_KEY_ID","type":"text","marks":[{"type":"code_inline"}]},{"text":" is FORBIDDEN)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NEVER","type":"text","marks":[{"type":"strong"}]},{"text":" ask the user to input AK/SK directly in the conversation or command line","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NEVER","type":"text","marks":[{"type":"strong"}]},{"text":" use ","type":"text"},{"text":"aliyun configure set","type":"text","marks":[{"type":"code_inline"}]},{"text":" with literal credential values","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ONLY","type":"text","marks":[{"type":"strong"}]},{"text":" use ","type":"text"},{"text":"aliyun configure list","type":"text","marks":[{"type":"code_inline"}]},{"text":" to check credential status","type":"text"}]}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"aliyun configure list","type":"text"}]},{"type":"paragraph","content":[{"text":"Check the output for a valid profile (AK, STS, or OAuth identity).","type":"text"}]},{"type":"paragraph","content":[{"text":"If no valid profile exists, STOP here.","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Obtain credentials from ","type":"text"},{"text":"Alibaba Cloud Console","type":"text","marks":[{"type":"link","attrs":{"href":"https://ram.console.aliyun.com/manage/ak","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Configure credentials ","type":"text"},{"text":"outside of this session","type":"text","marks":[{"type":"strong"}]},{"text":" (via ","type":"text"},{"text":"aliyun configure","type":"text","marks":[{"type":"code_inline"}]},{"text":" in terminal or environment variables in shell profile)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Return and re-run after ","type":"text"},{"text":"aliyun configure list","type":"text","marks":[{"type":"code_inline"}]},{"text":" shows a valid profile","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"[MUST] Per-command CLI User-Agent","type":"text","marks":[{"type":"strong"}]},{"text":" — In addition to the AI-Mode User-Agent registered in Pre-check 2, every ","type":"text"},{"text":"aliyun","type":"text","marks":[{"type":"code_inline"}]},{"text":" CLI command invocation in step 4 MUST also include: ","type":"text"},{"text":"--user-agent AlibabaCloud-Agent-Skills/alibabacloud-dms-skill","type":"text","marks":[{"type":"code_inline"}]},{"text":" The per-command flag and the AI-Mode session-level setting are complementary — both MUST be present so the identifier is sent on every request even if the AI-Mode session expires.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"RAM Permissions","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"[MUST] RAM Permission Pre-check:","type":"text","marks":[{"type":"strong"}]},{"text":" Verify that the current user has the following RAM permissions before execution. See ","type":"text"},{"text":"references/ram-policies.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for the complete permission list.","type":"text"}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Parameter Confirmation","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"IMPORTANT: Parameter Confirmation","type":"text","marks":[{"type":"strong"}]},{"text":" — Before executing any command or API call, ALL user-customizable parameters (e.g., database keyword, SQL statement, db-id, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.","type":"text"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Parameter","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required/Optional","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Default","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"keyword","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Database search keyword (1-128 chars, alphanumeric)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"db-id","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Database ID (positive integer, obtained from search)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"sql","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SQL statement to execute (1-10000 chars)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"logic","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Optional","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Whether to use logic database mode","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"false","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"force","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Optional","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Confirm write operations (INSERT/UPDATE/DELETE)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"false","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"dry-run","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Optional","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Preview write operations without executing","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"false","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Workflow","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Task 1: Search Target Database","type":"text"}]},{"type":"paragraph","content":[{"text":"Search for databases by keyword to get the Database ID:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"./scripts/search_database.sh \u003ckeyword> --json","type":"text"}]},{"type":"paragraph","content":[{"text":"Example:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Search for databases containing \"mydb\"\n./scripts/search_database.sh mydb --json","type":"text"}]},{"type":"paragraph","content":[{"text":"The output includes ","type":"text"},{"text":"database_id","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"schema_name","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"db_type","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"host","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"port","type":"text","marks":[{"type":"code_inline"}]},{"text":", etc.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Task 2: Execute SQL Query","type":"text"}]},{"type":"paragraph","content":[{"text":"Execute SQL using the Database ID obtained in the previous step:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"./scripts/execute_query.sh --db-id \u003cdatabase_id> --sql \"\u003cSQL_statement>\"","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Write Operation Protection","type":"text"}]},{"type":"paragraph","content":[{"text":"For write operations (INSERT/UPDATE/DELETE), the script implements protective pre-check:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Parameter","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--force","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required to confirm and execute write operations","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--dry-run","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Preview write operations without executing","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"DDL Operations (DROP/TRUNCATE/ALTER/RENAME) are completely blocked","type":"text","marks":[{"type":"strong"}]},{"text":" — these must be executed via DMS Console.","type":"text"}]},{"type":"paragraph","content":[{"text":"Examples:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Read operations (no confirmation needed)\n./scripts/execute_query.sh --db-id 78059000 --sql \"SHOW TABLES\"\n./scripts/execute_query.sh --db-id 78059000 --sql \"SELECT * FROM users LIMIT 10\" --json\n\n# Write operations - preview first (recommended)\n./scripts/execute_query.sh --db-id 78059000 --sql \"INSERT INTO users (name) VALUES ('test')\" --dry-run\n\n# Write operations - execute with confirmation\n./scripts/execute_query.sh --db-id 78059000 --sql \"INSERT INTO users (name) VALUES ('test')\" --force\n./scripts/execute_query.sh --db-id 78059000 --sql \"UPDATE users SET name='test' WHERE id=1\" --force\n./scripts/execute_query.sh --db-id 78059000 --sql \"DELETE FROM users WHERE id=1\" --force\n\n# Logic database mode\n./scripts/execute_query.sh --db-id 78059000 --sql \"SELECT 1\" --logic","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Complete Example","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# 1. Search database (assuming searching for \"order\")\n./scripts/search_database.sh order --json\n# Example output:\n# [{\"DatabaseId\": \"78059000\", \"SchemaName\": \"order_db\", ...}]\n\n# 2. Execute query\n./scripts/execute_query.sh --db-id 78059000 --sql \"SELECT COUNT(*) FROM orders\"","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Success Verification","type":"text"}]},{"type":"paragraph","content":[{"text":"After executing SQL, check the returned results:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Script return code is 0","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Output contains query results (column names and row data)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"No error messages","type":"text"}]}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Verify query success\n./scripts/execute_query.sh --db-id \u003cdb-id> --sql \"SELECT 1\" --json\n# Expected output: [{\"Success\": true, \"RowCount\": 1, ...}]","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Cleanup","type":"text"}]},{"type":"paragraph","content":[{"text":"This skill performs read and write operations but does not create persistent resources, so no database resources need to be released.","type":"text"}]},{"type":"paragraph","content":[{"text":"However, the AI-Mode lifecycle requires an explicit teardown step:","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"[MUST] Disable AI-Mode after all tasks complete","type":"text","marks":[{"type":"strong"}]},{"text":" Run ","type":"text"},{"text":"aliyun configure ai-mode disable","type":"text","marks":[{"type":"code_inline"}]},{"text":" once all DMS commands in this skill session have finished (success or failure). This terminates the AI-Mode session and prevents the registered ","type":"text"},{"text":"AlibabaCloud-Agent-Skills/alibabacloud-dms-skill","type":"text","marks":[{"type":"code_inline"}]},{"text":" User-Agent from leaking into subsequent unrelated CLI usage.","type":"text"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"aliyun configure ai-mode disable","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Write Operation Safety","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Operation Type","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Behavior","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SELECT / SHOW / DESC","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Execute directly","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"INSERT / UPDATE / DELETE","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Require ","type":"text"},{"text":"--force","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"--dry-run","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"DROP / TRUNCATE / ALTER / RENAME","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Blocked","type":"text","marks":[{"type":"strong"}]},{"text":" — use DMS Console","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Available Scripts","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Script","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"scripts/search_database.sh","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Search databases by keyword","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"scripts/execute_query.sh","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Execute SQL queries","type":"text"}]}]}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Note:","type":"text","marks":[{"type":"strong"}]},{"text":" Scripts use aliyun-cli credentials configured via ","type":"text"},{"text":"aliyun configure","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Best Practices","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Confirm database","type":"text","marks":[{"type":"strong"}]},{"text":" — Verify the target database before executing SQL","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use --json parameter","type":"text","marks":[{"type":"strong"}]},{"text":" — Facilitates programmatic processing of output","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Preview write operations","type":"text","marks":[{"type":"strong"}]},{"text":" — Always use ","type":"text"},{"text":"--dry-run","type":"text","marks":[{"type":"code_inline"}]},{"text":" first for INSERT/UPDATE/DELETE","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Explicit confirmation","type":"text","marks":[{"type":"strong"}]},{"text":" — Use ","type":"text"},{"text":"--force","type":"text","marks":[{"type":"code_inline"}]},{"text":" only after reviewing the preview","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Avoid DDL operations","type":"text","marks":[{"type":"strong"}]},{"text":" — DROP/TRUNCATE/ALTER/RENAME are blocked; use DMS Console instead","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Reference Links","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Document","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/cli-installation-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/cli-installation-guide.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"CLI Installation Guide","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/ram-policies.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/ram-policies.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"RAM Permission Policies","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/related-apis.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/related-apis.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Related API List","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/acceptance-criteria.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/acceptance-criteria.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Acceptance Criteria","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"alibabacloud-dms-skill","author":"@skillopedia","source":{"stars":133,"repo_name":"alibabacloud-aiops-skills","origin_url":"https://github.com/aliyun/alibabacloud-aiops-skills/blob/HEAD/skills/database/dms/alibabacloud-dms-skill/SKILL.md","repo_owner":"aliyun","body_sha256":"75df1d0cd65b55afa842cb373cc8d88744f3f9c9a943d1d9a7a6814a3b51e864","cluster_key":"637e6df3e679efdc8d8a2b8827c91ca132b8bd4cc9d7c744c12b8dde05c729c2","clean_bundle":{"format":"clean-skill-bundle-v1","source":"aliyun/alibabacloud-aiops-skills/skills/database/dms/alibabacloud-dms-skill/SKILL.md","attachments":[{"id":"4931bfa8-9544-55ee-ad83-b5f3ff8ab1dd","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4931bfa8-9544-55ee-ad83-b5f3ff8ab1dd/attachment.md","path":"references/acceptance-criteria.md","size":5347,"sha256":"f9f59d97996818cc5c49f29493d28361acf4bf3094a1699a3f529a7378a87e21","contentType":"text/markdown; charset=utf-8"},{"id":"6cf96d6f-139f-5956-9472-b25ba995ee3d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6cf96d6f-139f-5956-9472-b25ba995ee3d/attachment.md","path":"references/cli-installation-guide.md","size":11622,"sha256":"93abdd4f4a067822cca6894aa890855a50e723a6f6243f208887f171d6635170","contentType":"text/markdown; charset=utf-8"},{"id":"f9752574-39f5-5b63-bf62-bae5f2fc9639","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f9752574-39f5-5b63-bf62-bae5f2fc9639/attachment.md","path":"references/ram-policies.md","size":2803,"sha256":"68f3b067c8aae263450412598479fb652d25c629ef6b0ea2a28979fa39f6ed23","contentType":"text/markdown; charset=utf-8"},{"id":"a3b4729a-904f-549d-88e2-38223e0d487c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a3b4729a-904f-549d-88e2-38223e0d487c/attachment.md","path":"references/related-apis.md","size":4134,"sha256":"33ce9931986475cfab10c06a3bdf93fc23b5fdd9c1d0de8373c1c411f72d81f9","contentType":"text/markdown; charset=utf-8"},{"id":"09ed228f-433b-5f1c-b1a8-3f9e0347d5a5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/09ed228f-433b-5f1c-b1a8-3f9e0347d5a5/attachment.sh","path":"scripts/execute_query.sh","size":9392,"sha256":"c40ff38afd3ff51fbab282b666c4abd37f887e531dc1eed86d8bae0258332957","contentType":"application/x-sh; charset=utf-8"},{"id":"8cb49068-ff7a-53e5-9058-5ed7023c1132","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8cb49068-ff7a-53e5-9058-5ed7023c1132/attachment.sh","path":"scripts/search_database.sh","size":5177,"sha256":"f9b8f32c365ec9de6a50cb1e8a380ac827b99cf420203626b0cefe1c297200c7","contentType":"application/x-sh; charset=utf-8"}],"bundle_sha256":"c29b4190c3f35699327cb7419bc7fec4512193a47463ae5badc9f8810f2316fd","attachment_count":6,"text_attachments":6,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/database/dms/alibabacloud-dms-skill/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"data-analytics","category_label":"Data"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"data-analytics","import_tag":"clean-skills-v1","description":"Alibaba Cloud DMS Database Read/Write Skill. Use this skill to search for target databases in DMS and execute SQL queries and data modifications.\nTriggers: \"DMS query\", \"database query\", \"execute SQL\", \"search database\", \"DMS SQL\", \"insert data\", \"update data\".\n"}},"renderedAt":1782981425207}

Alibaba Cloud DMS Database Read/Write Search for target databases and execute SQL queries and data modifications via Alibaba Cloud DMS OpenAPI. Scenario Description This skill implements the following workflow: 1. Search Target Database — Search databases by keyword to get Database ID 2. Execute SQL Query — Execute SQL statements on the target database Architecture Prerequisites AI-Mode Lifecycle (MUST follow in order) This skill MUST run inside an AI-Mode session. Treat the following five steps as a strict lifecycle — do not skip, reorder, or interleave the setup steps with command execution…