现在的位置: 首页 > 综合 > 正文

阿里云RDS文档概述——日志查询

2019年08月22日 ⁄ 综合 ⁄ 共 5841字 ⁄ 字号 评论关闭

该系列博客的目录:

    概述与请求方式: http://blog.csdn.net/hyzhou33550336/article/details/41620595 (请先看这篇了解公共请求参数)

    实例管理:   http://blog.csdn.net/hyzhou33550336/article/details/41620749

    数据库管理: http://blog.csdn.net/hyzhou33550336/article/details/41620833

    数据迁入:   http://blog.csdn.net/hyzhou33550336/article/details/41620863

    账号管理:   http://blog.csdn.net/hyzhou33550336/article/details/41620879

    备份恢复:   http://blog.csdn.net/hyzhou33550336/article/details/41620899

    监控查询:   http://blog.csdn.net/hyzhou33550336/article/details/41620907

    日志查询:   http://blog.csdn.net/hyzhou33550336/article/details/41620917

    性能优化:   http://blog.csdn.net/hyzhou33550336/article/details/41620931

    参数设置:   http://blog.csdn.net/hyzhou33550336/article/details/41620595

日志查询

  • 查看错误日志
  • 查看BINLOG日志
  • SQL日志明细

 

查看错误日志:

描述:

说明:查看实例某段时间内的错误日志。

请求参数:

名称

类型

是否必须

描述

Action

String

系统规定参数,取值: DescribeErrorLogs

DBInstanceId

String

实例名

StartTime

String

查询开始时间,格式如: 2011-06-11T15:00Z

EndTime

String

查询结束时间,格式如: 2011-06-11T16:00Z,且大于查询开始时间

PageSize

Integer

每页记录数,取值:30|50|100;默认值30

PageNumber

Integer

页码,大于0,且不超过Integer的最大值;默认值:1

返回参数:

名称

类型

描述

TotalRecordCount

Integer

总记录数

PageNumber

Integer

页码

PageRecordCount

Integer

本页错误日志个数

Items

List<ErrorLog>

 

ErrorLog参数:

名称

类型

描述

ErrorInfo

String

错误日志信息

CreateTime

String

生成时间格式:
YYYY-MM-DD’T’HH:mm:ssZ
,如2011-05-30 T12:11:4Z

示例:

请求示例:

https://rds.aliyuncs.com/?Action=DescribeErrorLogs

&DBInstanceId=riauvjz6zajfiq6ba1370329449201

&StartTime=2011-06-11T15:00:00Z

&EndTime=2013-06-05T15:00:00Z

&<公共请求参数>

返回示例:

XML格式:

<DescribeErrorLogsResponse>

<RequestId>98504E07-BB0E-40FC-B152-E4882615812C</RequestId>

<TotalRecordCount>1</TotalRecordCount>

<PageNumber>1</PageNumber>

<PageRecordCount>1<PageRecordCount>

<Items>

<ErrorLog>

<ErrorInfo>

spid52 DBCC TRACEON 3499, server process ID (SPID) 52. This is aninformational message only; no user action is required

</ErrorInfo>

<CreateTime>2013-06-04T15:00:00</CreateTime>

</ErrorLog>

</Items>

</DescribeErrorLogsResponse>

JSON格式:

{

"RequestId":"98504E07-BB0E-40FC-B152-E4882615812C"

"PageNumber":1,

"TotalRecordCount":1,

"PageRecordCount":1

"Items": {

"ErrorLog": [

{

ErrorInfo:

"spid52 DBCC TRACEON 3499, serverprocess ID (SPID) 52. This is an informational message only; no user action isrequired"

CreateTime: "2013-06-04T15:00:00"

}

]

}

}

 

查看BINLOG日志:

描述:

查询实例的BINLOG文件(仅MySQL数据库实例),支持分页。

RDS提供Binloig文件下载。

请求参数:

名称

类型

是否必须

描述

Action

String

系统规定参数,取值: DescribeBinlogFiles

DBInstanceId

String

实例名

StartTime

String

查询开始时间,格式: yyyy-MM-dd’T’HH:mm:ssZ

EndTime

String

查询结束时间,格式: yyyy-MM-dd’T’HH:mm:ssZ,且大于查询开始时间

PageSize

Integer

每页记录数,取值:30|50|100默认值:
30

PageNumber

Integer

页码,大于0,且不超过Integer的最大值默认值:
1

返回参数:

名称

类型

描述

TotalRecordCount

Integer

Binlog文件总数

PageNumber

Integer

页码

PageRecordCount

Integer

本页BINLOG文件个数

Items

List<BinLogFile>

BinLogFile参数名称类型描述

FileSize

Long

BINLOG文件大小,单位:Byte

LogBeginTime

String

BINLOG文件记录的开始时间

LogEndTime

String

BINLOG文件记录的结束时间

DownloadLink

String

支持HTTP协议的下载链接URLNULL表示没有下载链接

LinkExpiredTime

String

URL过期时间,格式如:2011-06-11T15:00:00Z

示例:

请求示例:

https://rds.aliyuncs.com/?Action=DescribeBinlogFiles

&DBInstanceId=riauvjz6zajfiq6ba1370329449201

&StartTime=2011-06-11T15:00:00Z

&EndTime=2013-06-05T15:00:00Z

&<公共请求参数>

返回示例:

XML格式:

<DescribeBinlogFilesResponse>

<RequestId>66816822-CEC1-4C8D-AB26-2530A7D4DCA5</RequestId>

<TotalRecordCount>1</TotalRecordCount>

<PageNumber>1</PageNumber>

<PageRecordCount>1<PageRecordCount>

<Items>

<BinLogFile>

<FileSize>123</FileSize>

<LogBeginTime>2013-06-01T15:00:00Z</LogBeginTime>

<LogEndTime>2013-06-02T18:00:00Z</LogEndTime>

<DownloadLink>http://rdslog-real.oss.aliyuncs.com/custins47742/hostins46770/mysql-bin.000120.zip?spm=0.0.0.0.eMQKjs&OSSAccessKeyId=c9gzsqpauj3duw5whwdv40hb&Expires=1384916927&Signature=07TMgM3G2Jw4sOO6yN8nWDgBJPA%3D</DownloadLink>

<LinkExpiredTime>2013-06-09T18:00:00Z</LinkExpiredTime>

</BinLogFile>

</Items>

</DescribeBinlogFilesResponse>

JSON格式:

{

"RequestId":"66816822-CEC1-4C8D-AB26-2530A7D4DCA5"

"PageNumber":1,

"TotalRecordCount":1,

"PageRecordCount":1

"Items": {

"BinLogFile": [

{

FileSize:"123"

LogBeginTime:"2013-06-01T15:00:00Z"

LogEndTime:"2013-06-02T18:00:00Z"

DownloadLink:"http://rdslog-real.oss.aliyuncs.com/custins47742/hostins46770/mysql-bin.000120.zip?spm=0.0.0.0.eMQKjs&OSSAccessKeyId=c9gzsqpauj3duw5whwdv40hb&Expires=1384916927&Signature=07TMgM3G2Jw4sOO6yN8nWDgBJPA%3D"

LinkExpiredTime:"2013-06-09T18:00:00Z"

}

]

}

}

 

SQL日志明细:

描述:

说明:查询实例的SQL日志明细。

请求参数:

名称

类型

是否必须

描述

Action

String

系统规定参数,取值: DescribeSQLLogRecords

DBInstanceId

String

实例名

QueryKeywords

String

关键字查询,多个关键字以空格分隔,不超过10个关键字。

StartTime

String

查询开始时间,格式如: yyyy-MM-dd'T’HH:mm:ssZ

EndTime

String

查询结束时间,格式如: yyyy-MM-dd'T’HH:mm:ssZ,且大于查询开始时间

PageSize

Integer

每页记录数,取值:30|50|100|200;默认值:
100

PageNumber

Integer

页码,大于0,且不超过Integer的最大值;默认值:
1

返回参数:

名称

类型

描述

TotalRecordCount

Integer

总记录数

PageNumber

Integer

页码

PageRecordCount

Integer

本页SQL日志明细个数

Items

List<SQLRecord>

SQLRecord参数名称类型描述

DBName

String

数据库

AccountName

String

帐号名

HostAddress

String

客户端IP地址

SQLText

String

SQL语句

TotalExecutionTimes

Long

消耗时间,单位:微秒

ReturnRowCounts

Long

返回记录数

ExecuteTime

String

执行时间格式:
yyyy-MM-dd’T’HH:mm:ss Z
,如2011-05-30 T12:11:20Z

示例:

请求示例:

https://rds.aliyuncs.com/?Action=DescribeSQLLogRecords

&DBInstanceId=riauvjz6zajfiq6ba1370329449201

&StartTime=2011-06-11T15:00:00Z

&EndTime=2013-06-05T15:00:00Z

&<公共请求参数>

返回示例:

XML格式:

<DescribeSQLLogRecordsResponse>

<RequestId>08A3B71B-FE08-4B03-974F-CC7EA6DB1828</RequestId>

<TotalRecordCount>1</TotalRecordCount>

<PageNumber>1</PageNumber>

<PageRecordCount>1<PageRecordCount>

<Items>

<SQLRecord>

<DBName>test</DBName>

<AccountName>accounttest</AccountName>

<HostAddress>192.168.0.121</HostAddress>

<SQLText>update test.zxb set id=0 limit 1</SQLText>

<TotalExecutionTimes>12</TotalExecutionTimes>

<ReturnRowCounts>34</ReturnRowCounts>

<ExecuteTime>2011-06-11T15:00:23Z</ExecuteTime>

</SQLRecord>

</Items>

</DescribeSQLLogRecordsResponse>

JSON格式:

{

"PageNumber":1,

"TotalRecordCounts":1,

"ItemsCounts":1

"SQLItems": {

"SQLItem": [

{

"DBName":"test"

"AccountName":"accounttest"

"HostAddress":"192.168.0.121"

"SQLText":"update test.zxb set id=0 limit 1"

"TotalExecutionTimes":12

"ReturnRowCounts":34

"ExecuteTime":"2011-06-11T15:00:23Z"

}

]

},

"RequestId":"08A3B71B-FE08-4B03-974F-CC7EA6DB1828"

}

抱歉!评论已关闭.