查看数据库参数

最近更新时间:2018-09-28 14:59:54

1. 接口描述

接口请求域名: dcdb.tencentcloudapi.com 。

本接口(DescribeDBParameters)用于获取数据库的当前参数设置。

默认接口请求频率限制:20次/每秒。

注意:本接口支持金融区地域。由于金融区和非金融区是隔离不互通的,因此当公共参数 Region 为金融区地域(例如 ap-shanghai-fsi )时,需要同时指定带金融区地域的域名,最好和 Region 的地域保持一致,例如:dcdb.ap-shanghai-fsi.tencentcloudapi.com 。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:DescribeDBParameters
Version String 公共参数,本接口取值:2018-04-11
Region String 公共参数,详见产品支持的地域列表
InstanceId String 实例 ID,形如:dcdbt-ow7t8lmc。

3. 输出参数

参数名称 类型 描述
InstanceId String 实例 ID,形如:dcdbt-ow7t8lmc。
Params Array of ParamDesc 请求DB的当前参数值
RequestId String 唯一请求ID,每次请求都会返回。定位问题时需要提供该次请求的RequestId。

4. 示例

示例1 获取数据库当前参数

输入示例

https://dcdb.tencentcloudapi.com/?Action=DescribeDBParameters
&InstanceId=dcdbt-ige1a5k3
&<公共请求参数>

输出示例

{
  "Response": {
    "InstanceId": "dcdbt-ige1a5k3",
    "Params": [
      {
        "Constraint": {
          "Range": {
            "Max": "65535",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "1",
        "Param": "auto_increment_increment",
        "SetValue": "",
        "Value": "1"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "65535",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "1",
        "Param": "auto_increment_offset",
        "SetValue": "",
        "Value": "1"
      },
      {
        "Constraint": {
          "Enum": "ON,OFF",
          "Type": "enum"
        },
        "Default": "ON",
        "Param": "autocommit",
        "SetValue": "",
        "Value": "ON"
      },
      {
        "Constraint": {
          "Enum": "ROW,STATEMENT,MIXED",
          "Type": "enum"
        },
        "Default": "ROW",
        "Param": "binlog_format",
        "SetValue": "",
        "Value": "ROW"
      },
      {
        "Constraint": {
          "Enum": "utf8,latin1,gbk,utf8mb4",
          "Type": "enum"
        },
        "Default": "utf8",
        "Param": "character_set_server",
        "SetValue": "",
        "Value": "utf8"
      },
      {
        "Constraint": {
          "Enum": "latin1_general_cs,latin1_general_ci,latin1_bin,latin1_swedish_ci,gbk_chinese_ci,gbk_bin,utf8_general_ci,utf8_bin,utf8_unicode_ci,utf8mb4_general_ci,utf8mb4_bin,utf8mb4_unicode_ci",
          "Type": "enum"
        },
        "Default": "",
        "Param": "collation_server",
        "SetValue": "",
        "Value": "utf8_general_ci"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "3600",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "10",
        "Param": "connect_timeout",
        "SetValue": "",
        "Value": "10"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "7",
            "Min": "0"
          },
          "Type": "section"
        },
        "Default": "0",
        "Param": "default_week_format",
        "SetValue": "",
        "Value": "0"
      },
      {
        "Constraint": {
          "Enum": "ON,OFF,ALL",
          "Type": "enum"
        },
        "Default": "ON",
        "Param": "delay_key_write",
        "SetValue": "",
        "Value": "ON"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "4294967295",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "100",
        "Param": "delayed_insert_limit",
        "SetValue": "",
        "Value": "100"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "3600",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "300",
        "Param": "delayed_insert_timeout",
        "SetValue": "",
        "Value": "300"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "4294967295",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "1000",
        "Param": "delayed_queue_size",
        "SetValue": "",
        "Value": "1000"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "30",
            "Min": "0"
          },
          "Type": "section"
        },
        "Default": "4",
        "Param": "div_precision_increment",
        "SetValue": "",
        "Value": "4"
      },
      {
        "Constraint": {
          "Enum": "ON,OFF",
          "Type": "enum"
        },
        "Default": "OFF",
        "Param": "event_scheduler",
        "SetValue": "",
        "Value": "OFF"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "18446744073709547520",
            "Min": "4"
          },
          "Type": "section"
        },
        "Default": "1024",
        "Param": "group_concat_max_len",
        "SetValue": "",
        "Value": "1024"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "10000",
            "Min": "100"
          },
          "Type": "section"
        },
        "Default": "5000",
        "Param": "innodb_concurrency_tickets",
        "SetValue": "",
        "Value": "5000"
      },
      {
        "Constraint": {
          "Enum": "OFF,ON",
          "Type": "enum"
        },
        "Default": "OFF",
        "Param": "innodb_large_prefix",
        "SetValue": "",
        "Value": "ON"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "1073741824",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "50",
        "Param": "innodb_lock_wait_timeout",
        "SetValue": "",
        "Value": "20"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "90",
            "Min": "10"
          },
          "Type": "section"
        },
        "Default": "10",
        "Param": "innodb_max_dirty_pages_pct",
        "SetValue": "",
        "Value": "70.000000"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "95",
            "Min": "5"
          },
          "Type": "section"
        },
        "Default": "37",
        "Param": "innodb_old_blocks_pct",
        "SetValue": "",
        "Value": "37"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "1000",
            "Min": "0"
          },
          "Type": "section"
        },
        "Default": "1000",
        "Param": "innodb_old_blocks_time",
        "SetValue": "",
        "Value": "1000"
      },
      {
        "Constraint": {
          "Enum": "4096,8192,16384,32768,65536",
          "Type": "enum"
        },
        "Default": "4096",
        "Param": "innodb_page_size",
        "SetValue": "",
        "Value": "16384"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "1024",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "300",
        "Param": "innodb_purge_batch_size",
        "SetValue": "",
        "Value": "1000"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "64",
            "Min": "0"
          },
          "Type": "section"
        },
        "Default": "56",
        "Param": "innodb_read_ahead_threshold",
        "SetValue": "",
        "Value": "56"
      },
      {
        "Constraint": {
          "Enum": "nulls_equal,nulls_unequal,nulls_ignored",
          "Type": "enum"
        },
        "Default": "nulls_equal",
        "Param": "innodb_stats_method",
        "SetValue": "",
        "Value": "nulls_equal"
      },
      {
        "Constraint": {
          "Enum": "ON,OFF",
          "Type": "enum"
        },
        "Default": "OFF",
        "Param": "innodb_stats_on_metadata",
        "SetValue": "",
        "Value": "OFF"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "4294967296",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "8",
        "Param": "innodb_stats_sample_pages",
        "SetValue": "",
        "Value": "8"
      },
      {
        "Constraint": {
          "Enum": "ON,OFF",
          "Type": "enum"
        },
        "Default": "OFF",
        "Param": "innodb_strict_mode",
        "SetValue": "",
        "Value": "OFF"
      },
      {
        "Constraint": {
          "Enum": "ON,OFF",
          "Type": "enum"
        },
        "Default": "ON",
        "Param": "innodb_table_locks",
        "SetValue": "",
        "Value": "ON"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "128",
            "Min": "0"
          },
          "Type": "section"
        },
        "Default": "0",
        "Param": "innodb_thread_concurrency",
        "SetValue": "",
        "Value": "64"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "3600000",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "10000",
        "Param": "innodb_thread_sleep_delay",
        "SetValue": "",
        "Value": "0"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "86400",
            "Min": "10"
          },
          "Type": "section"
        },
        "Default": "28800",
        "Param": "interactive_timeout",
        "SetValue": "",
        "Value": "28800"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "18446744073709547520",
            "Min": "128"
          },
          "Type": "section"
        },
        "Default": "262144",
        "Param": "join_buffer_size",
        "SetValue": "",
        "Value": "2097152"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "4294967295",
            "Min": "100"
          },
          "Type": "section"
        },
        "Default": "300",
        "Param": "key_cache_age_threshold",
        "SetValue": "",
        "Value": "300"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "16384",
            "Min": "512"
          },
          "Type": "section"
        },
        "Default": "1024",
        "Param": "key_cache_block_size",
        "SetValue": "",
        "Value": "1024"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "100",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "100",
        "Param": "key_cache_division_limit",
        "SetValue": "",
        "Value": "100"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "31536000",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "5",
        "Param": "lock_wait_timeout",
        "SetValue": "",
        "Value": "5"
      },
      {
        "Constraint": {
          "Enum": "ON,OFF",
          "Type": "enum"
        },
        "Default": "OFF",
        "Param": "log_queries_not_using_indexes",
        "SetValue": "",
        "Value": "OFF"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "10",
            "Min": "0.05"
          },
          "Type": "section"
        },
        "Default": "1.000000",
        "Param": "long_query_time",
        "SetValue": "",
        "Value": "1.000000"
      },
      {
        "Constraint": {
          "Enum": "OFF,ON",
          "Type": "enum"
        },
        "Default": "OFF",
        "Param": "low_priority_updates",
        "SetValue": "",
        "Value": "OFF"
      },
      {
        "Constraint": {
          "Enum": "0,1",
          "Type": "enum"
        },
        "Default": "1",
        "Param": "lower_case_table_names",
        "SetValue": "",
        "Value": "0"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "1073741824",
            "Min": "16384"
          },
          "Type": "section"
        },
        "Default": "134217728",
        "Param": "max_allowed_packet",
        "SetValue": "",
        "Value": "1073741824"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "4096",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "2000",
        "Param": "max_connect_errors",
        "SetValue": "",
        "Value": "2000"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "32768",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "4096",
        "Param": "max_connections",
        "SetValue": "",
        "Value": "10000"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "1048576",
            "Min": "0"
          },
          "Type": "section"
        },
        "Default": "16382",
        "Param": "max_prepared_stmt_count",
        "SetValue": "",
        "Value": "200000"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "16777216",
            "Min": "262144"
          },
          "Type": "section"
        },
        "Default": "4194304",
        "Param": "myisam_sort_buffer_size",
        "SetValue": "",
        "Value": "4194304"
      },
      {
        "Constraint": {
          "Enum": "4096,8192,16384,32768,65536,1048576",
          "Type": "enum"
        },
        "Default": "16384",
        "Param": "net_buffer_length",
        "SetValue": "",
        "Value": "16384"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "3153600",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "30",
        "Param": "net_read_timeout",
        "SetValue": "",
        "Value": "30"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "4294967295",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "10",
        "Param": "net_retry_count",
        "SetValue": "",
        "Value": "10"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "3153600",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "60",
        "Param": "net_write_timeout",
        "SetValue": "",
        "Value": "60"
      },
      {
        "Constraint": {
          "Type": "string"
        },
        "Default": "index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,optimize_join_buffer_size=on",
        "Param": "optimizer_switch",
        "SetValue": "",
        "Value": "batched_key_access=off,block_nested_loop=on,condition_fanout_filter=on,derived_merge=on,duplicateweedout=on,engine_condition_pushdown=on,firstmatch=on,index_condition_pushdown=on,index_merge=on,index_merge_intersection=on,index_merge_sort_union=on,index_merge_union=on,loosescan=on,materialization=on,mrr=on,mrr_cost_based=on,semijoin=on,subquery_materialization_cost_based=on,use_index_extensions=on"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "16384",
            "Min": "1024"
          },
          "Type": "section"
        },
        "Default": "8192",
        "Param": "query_alloc_block_size",
        "SetValue": "",
        "Value": "16384"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "1048576",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "1048576",
        "Param": "query_cache_limit",
        "SetValue": "",
        "Value": "1048576"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "104857600",
            "Min": "0"
          },
          "Type": "section"
        },
        "Default": "0",
        "Param": "query_cache_size",
        "SetValue": "",
        "Value": "0"
      },
      {
        "Constraint": {
          "Enum": "OFF,ON,DEMAND",
          "Type": "enum"
        },
        "Default": "OFF",
        "Param": "query_cache_type",
        "SetValue": "",
        "Value": "OFF"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "1048576",
            "Min": "8192"
          },
          "Type": "section"
        },
        "Default": "8192",
        "Param": "query_prealloc_size",
        "SetValue": "",
        "Value": "24576"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "16383",
            "Min": "0"
          },
          "Type": "section"
        },
        "Default": "10",
        "Param": "slave_parallel_threads",
        "SetValue": "",
        "Value": ""
      },
      {
        "Constraint": {
          "Range": {
            "Max": "1024",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "2",
        "Param": "slow_launch_time",
        "SetValue": "",
        "Value": "2"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "1073741824",
            "Min": "32768"
          },
          "Type": "section"
        },
        "Default": "2097152",
        "Param": "sort_buffer_size",
        "SetValue": "",
        "Value": "2097152"
      },
      {
        "Constraint": {
          "Type": "string"
        },
        "Default": "",
        "Param": "sql_mode",
        "SetValue": "",
        "Value": "NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "100",
            "Min": "10"
          },
          "Type": "section"
        },
        "Default": "10",
        "Param": "sqlasyntimeout",
        "SetValue": "",
        "Value": "30"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "2048",
            "Min": "400"
          },
          "Type": "section"
        },
        "Default": "400",
        "Param": "table_definition_cache",
        "SetValue": "",
        "Value": "400"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "524288",
            "Min": "400"
          },
          "Type": "section"
        },
        "Default": "1024",
        "Param": "table_open_cache",
        "SetValue": "",
        "Value": "10240"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "65536",
            "Min": "1"
          },
          "Type": "section"
        },
        "Default": "3",
        "Param": "thread_pool_oversubscribe",
        "SetValue": "",
        "Value": "30"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "67108864",
            "Min": "262144"
          },
          "Type": "section"
        },
        "Default": "33554432",
        "Param": "tmp_table_size",
        "SetValue": "",
        "Value": "33554432"
      },
      {
        "Constraint": {
          "Enum": "REPEATABLE-READ,SERIALIZABLE,READ-COMMITTED,READ-UNCOMMITTED",
          "Type": "enum"
        },
        "Default": "REPEATABLE-READ",
        "Param": "tx_isolation",
        "SetValue": "",
        "Value": "REPEATABLE-READ"
      },
      {
        "Constraint": {
          "Range": {
            "Max": "259200",
            "Min": "60"
          },
          "Type": "section"
        },
        "Default": "28800",
        "Param": "wait_timeout",
        "SetValue": "",
        "Value": "28800"
      }
    ],
    "RequestId": "affa5c39-02b7-482a-a16f-a74e660e7b7f"
  }
}

5. 开发者资源

API Explorer

该工具提供了在线调用、签名验证、 SDK 代码生成和快速检索接口等能力,能显著降低使用云 API 的难度,推荐使用。

SDK

云 API 3.0 提供了配套的开发工具集( SDK ),支持多种编程语言,能更方便的调用 API 。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码

错误码 描述
InternalError.CamAuthFailed CAM鉴权请求失败。
InternalError.DbOperationFailed 查询数据库失败。
InternalError.GetDbConfigFailed 获取数据库实例参数失败。
InvalidParameter.GenericParameterError 参数合法性校验错误。
ResourceUnavailable.InstanceAlreadyDeleted 数据库实例已被删除。
ResourceUnavailable.InstanceStatusAbnormal 数据库实例状态不正确,当前无法操作。
UnauthorizedOperation.PermissionDenied 没有权限操作该接口或资源。