閱讀939 返回首頁    go 人物


查看慢日誌明細__日誌管理_API 參考_雲數據庫 RDS 版-阿裏雲

描述

說明:用戶可以查詢某日期範圍內、某個用戶實例下、某個DB的慢查詢明細,僅支持MySQL數據庫。

請求參數

名稱 類型 是否必須 描述
Action String 係統規定參數,取值:DescribeSlowLogRecords
DBInstanceId String 實例名
StartTime String 查詢開始日期,格式:YYYY-MM-DD’T’HH:mmZ,如2011-06-11T15:00Z
EndTime String 查詢結束日期,不能小於查詢開始日期,格式:YYYY-MM-DD’T’HH:mmZ,如2011-06-11 T16:00Z
DBName String DB名稱
PageSize Integer 每頁記錄數,取值:30/50/100默認值:30
PageNumber Integer 頁碼,大於0,且不超過Integer的最大值;默認值:1

返回參數

名稱 類型 描述
<公共返回參數> 詳見附錄
Engine String 數據庫類型
TotalRecordCount Integer 總記錄數
PageNumber Integer 頁碼
PageRecordCount Integer 本頁SQL語句個數
Items List<SQLSlowRecord>

SQLSlowLog參數

名稱 類型 描述
HostAddress String 用戶連接數據庫的主機地址
DBName String DB名稱
SQLText String 查詢語句
QueryTimes Long 執行時長,單位:秒
LockTimes Long 鎖定時長,單位:秒
ParseRowCounts Long 解析行數
ReturnRowCounts Long 返回行數
ExecutionStartTime String 執行開始時間;格式:YYYY-MM-DD’T’HH:mm:ss Z,如2011-06-11 T15:00:08Z

示例

  • 請求示例
  1. https://rds.aliyuncs.com/?Action=DescribeSlowLogRecords
  2. &DBInstanceId=riauvjz6zajfiq6ba1370329449201
  3. &StartTime=2011-06-11T15:00Z
  4. &EndTime=2011-06-11T16:00Z
  5. &<公共請求參數>
  • 返回示例

XML格式:

  1. <DescribeSlowLogRecordsResponse>
  2. <RequestId>542BB8D6-4268-45CC-A557-B03EFD7AB30A</RequestId>
  3. <DBInstanceID>riauvjz6zajfiq6ba1370329449201</DBInstanceID>
  4. <Engine>MySQL</Engine>
  5. <TotalRecordCount>1</TotalRecordCount>
  6. <PageNumber>1</PageNumber>
  7. <PageRecordCount>1</PageRecordCount>
  8. <Items>
  9. <SQLSlowRecord>
  10. <HostAddress>192.168.0.123</HostAddress>
  11. <DBName>test</DBName>
  12. <SQLText>update test.zxb set id=0 limit 1</SQLText>
  13. <QueryTimes>123</QueryTimes>
  14. <LockTimes>12</LockTimes>
  15. <ParseRowCounts>125</ParseRowCounts>
  16. <ReturnRowCounts>1</ReturnRowCounts>
  17. <ExecutionStartTime>2011-06-11T15:00:08Z</ExecutionStartTime>
  18. </SQLSlowRecord>
  19. </Items>
  20. </DescribeSlowLogRecordsResponse>

JSON格式:

  1. {
  2. "RequestId":"542BB8D6-4268-45CC-A557-B03EFD7AB30A"
  3. "Engine":"MySQL",
  4. "PageNumber":1,
  5. "PageRecordCount":1,
  6. "TotalRecordCount":1
  7. "Items":
  8. {"SQLSlowRecord":
  9. [
  10. {
  11. HostAddress:”192.168.0.123”
  12. DBName:”test”
  13. SQLText:” update test.zxb set id=0 limit 1”
  14. QueryTimes:”123”
  15. LockTimes”12”
  16. ParseRowCounts:”125”
  17. ReturnRowCounts:”1”
  18. ExecutionStartTime:”2011-06-11T15:00:08Z”
  19. }
  20. ]
  21. }
  22. }

最後更新:2016-12-01 11:32:52

  上一篇:go 查看慢日誌列表__日誌管理_API 參考_雲數據庫 RDS 版-阿裏雲
  下一篇:go 查看錯誤日誌__日誌管理_API 參考_雲數據庫 RDS 版-阿裏雲