調(diào)用DescribeDrdsSlowSqls接口查看慢SQL。

調(diào)試

您可以在OpenAPI Explorer中直接運(yùn)行該接口,免去您計(jì)算簽名的困擾。運(yùn)行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。

請求參數(shù)

名稱 類型 是否必選 示例值 描述
Action String DescribeDrdsSlowSqls

系統(tǒng)規(guī)定參數(shù)。取值為DescribeDrdsSlowSqls

DbName String test_db

數(shù)據(jù)庫名稱。

DrdsInstanceId String drds***************

實(shí)例ID。

EndTime Long 1568267711000

SQL查詢開始時(shí)間,格式為Unix時(shí)間戳,單位為毫秒(UTC時(shí)間)。

ExeTime Long 1000

SQL執(zhí)行時(shí)間,單位為毫秒(ms)。

StartTime Long 1568269711000

SQL查詢結(jié)束時(shí)間,格式為Unix時(shí)間戳,單位為毫秒(UTC時(shí)間)。

PageNumber Integer 1

頁數(shù)。

PageSize Integer 20

每頁記錄數(shù)。

返回?cái)?shù)據(jù)

名稱 類型 示例值 描述
Items Array of Item

慢SQL詳情。

Item
Host String 10.0.***.***

執(zhí)行機(jī)器的IP。

ResponseTime Long 1568267711

響應(yīng)時(shí)間,單位為毫秒(ms)。

Schema String user

數(shù)據(jù)庫名稱。

SendTime Long 1568267711

慢SQL發(fā)送時(shí)間,單位為毫秒(ms)。

Sql String SELECT count(1) from payment_order where order_status = '08';

慢SQL內(nèi)容。

PageNumber Integer 1

頁數(shù)。

PageSize Integer 20

每頁記錄數(shù)。

RequestId String 509BDE17-505A-4B3B-854D-30D3F0******

請求ID。

Success Boolean true

請求是否成功。

Total Integer 1

總記錄數(shù)。

示例

請求示例

http(s)://drds.cn-hangzhou.aliyuncs.com/?Action=DescribeDrdsSlowSqls
&DbName=test_db
&DrdsInstanceId=drds***************
&EndTime=1568267711000
&ExeTime=1000
&StartTime=1568269711000
&<公共請求參數(shù)>

正常返回示例

XML 格式

<DescribeDrdsSlowSqlsReponse>
  <RequestId>509BDE17-505A-4B3B-854D-30D3F0******</RequestId>
  <PageSize>20</PageSize>
  <PageNumber>1</PageNumber>
  <Total>1</Total>
  <Items>
        <Item>
              <SendTime>1568267711</SendTime>
              <Schema>user</Schema>
              <ResponseTime>1568267711</ResponseTime>
              <Host>10.0.***.***</Host>
              <Sql>SELECT   count(1) from   payment_order where   order_status = '08';</Sql>
        </Item>
  </Items>
  <Success>true</Success>
</DescribeDrdsSlowSqlsReponse>

JSON 格式

{
    "DescribeDrdsSlowSqlsReponse": {
        "RequestId": "509BDE17-505A-4B3B-854D-30D3F0******",
        "PageSize": 20,
        "PageNumber": 1,
        "Total": 1,
        "Items": {
            "Item": {
                "SendTime": 1568267711,
                "Schema": "user",
                "ResponseTime": 1568267711,
                "Host": "10.0.***.***",
                "Sql": "SELECT   count(1) from   payment_order where   order_status = '08';"
            }
        },
        "Success": true
    }
}

錯(cuò)誤碼

HttpCode 錯(cuò)誤碼 錯(cuò)誤信息 描述
400 ActionUnauthorized The specified action is not available for you 指定的action未授權(quán),請您先做RAM授權(quán)再進(jìn)行操作。

訪問錯(cuò)誤中心查看更多錯(cuò)誤碼。