阅读939 返回首页    go 阿里云 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 版-阿里云