最近更新时间:2020-08-11 10:12:29
实时获取SQL Server错误日志。
英文名称 | 中文名称 | 类型 | 是否必须 | 备注 |
---|---|---|---|---|
Action | 调用接口名称 | String | 是 | 取固定值:ListErrorLogs |
StartTime | 起始时间 | String | 是 | |
EndTime | 终止时间 | String | 是 | |
Marker | 获取记录开始偏移量 | Integer | 否 | 整型,默认值0 |
MaxRecords | 每页结果中包含的最大条数 | Integer | 否 | 取值范围[10,100],默认为10 |
###请求示例
https://sqlserver.console.ksyun.com/i/krds/sql/api?DBInstanceIdentifier=asdf-ghjk-zxcv-bnml®ionKey=cn-beijing-6&Marker=0&MaxRecords=10&StartTime=2020-08-10&EndTime=2020-08-10&Action=ListErrorLogs
###返回参数说明
字段名称 | 字段描述 |
---|---|
Data | 数据部分 |
ErrorLogs | 错误日志部分 |
SqlTest | 错误信息 |
CollectTime | 错误SQL收集时间 |
RequestId | 唯一标志符 |
Marker | 获取记录开始偏移量 |
MaxRecords | 每页结果中包含的最大条数 |
TotalCount | 记录总条数 |
###返回样例
{
"Data": {
"ErrorLogs": [{
"SqlText": "2020-08-10 01:23:24.700000 Log was backed up. Database: default_db, creation date(time): 2020/08/06(21:48:42), first LSN: 20:124:1, last LSN: 20:126:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'\\\\123.123.123.123\\a\\b\\backup\\c\\default_db.log'}). This is an informational message only. No user action is required.\r\n",
"CollectTime": "Aug 10, 2020 1:25:25 AM"
},
{
"SqlText": "2020-08-10 01:23:24.510000 Database backed up. Database: msdb, creation date(time): 2010/04/02(17:35:08), pages dumped: 2443, first LSN: 1806:368:275, last LSN: 1806:488:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'\\\\123.123.123.123\\a\\b\\backup\\c\\d.bak'}). This is an informational message only. No user action is required.",
"CollectTime": "Aug 10, 2020 1:25:25 AM"
},
{
"SqlText": "2020-08-10 01:23:24.150000 Database backed up. Database: model, creation date(time): 2003/04/08(09:13:36), pages dumped: 186, first LSN: 20:160:37, last LSN: 20:184:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'\\\\123.123.123.123\\a\\b\\backup\\c\\e.bak'}). This is an informational message only. No user action is required.",
"CollectTime": "Aug 10, 2020 1:25:25 AM"
}, {
"SqlText": "2020-08-10 01:23:23.930000 Database backed up. Database: master, creation date(time): 2020/08/06(21:48:26), pages dumped: 386, first LSN: 195:368:72, last LSN: 195:408:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'\\\\123.123.123.123\\a\\b\\backup\\c\\f.bak'}). This is an informational message only. No user action is required.",
"CollectTime": "Aug 10, 2020 1:25:25 AM"
},
{
"SqlText": "2020-08-10 00:00:27.270000 This instance of SQL Server has been using a process ID of 1876 since 2020/8/6 21:48:27 (local) 2020/8/6 13:48:27 (UTC). This is an informational message only; no user action is required.\r\n",
"CollectTime": "Aug 10, 2020 12:04:02 AM"
}],
"TotalCount": 5,
"MaxRecords": 10,
"Marker": 5
},
"RequestId": "0ba69ab2-25a0-4f8a-b0fc-sdfsdfsdfsdfs"
}
纯净模式