Files
doc-exports/docs/rds/api-ref/rds_06_0102.html
wangdengke2 1ddaec1a62 rds_api
Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: wangdengke2 <wangdengke2@huawei.com>
Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
2026-01-29 11:28:26 +00:00

172 lines
14 KiB
HTML

<a name="rds_06_0102"></a><a name="rds_06_0102"></a>
<h1 class="topictitle1">Querying Slow Query Log Files (SQL Server)</h1>
<div id="body0000002474825692"><div class="section" id="rds_06_0102__section61759636"><h4 class="sectiontitle">Function</h4><p id="rds_06_0102__p33831530">This API is used to query slow query log files.</p>
<ul id="rds_06_0102__ul12259155218373"><li id="rds_06_0102__en-us_topic_0240111818_li836513175363">Before calling an API, you need to understand the API in <a href="rds_03_0001.html">Authentication</a>.</li><li id="rds_06_0102__en-us_topic_0240111818_li1991981933613">Before calling this API, obtain the required <a href="https://docs.otc.t-systems.com/en-us/endpoint/index.html" target="_blank" rel="noopener noreferrer">region and endpoint</a>.</li></ul>
</div>
<div class="section" id="rds_06_0102__section2563029124413"><h4 class="sectiontitle">Constraints</h4><p id="rds_06_0102__en-us_topic_0000001496953953_p121571021134413">This API is available only for Microsoft SQL Server.</p>
</div>
<div class="section" id="rds_06_0102__section18965813"><h4 class="sectiontitle">URI</h4><ul id="rds_06_0102__ul13194498"><li id="rds_06_0102__li41603465301">URI format<p id="rds_06_0102__p11160246123012"><a name="rds_06_0102__li41603465301"></a><a name="li41603465301"></a>GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/slowlog-files?offset={offset}&amp;limit={limit}</p>
</li></ul>
<ul id="rds_06_0102__ul55999443"><li id="rds_06_0102__li21405046">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_06_0102__table58427690" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="rds_06_0102__row1482002"><th align="left" class="cellrowborder" valign="top" width="19.42%" id="mcps1.3.3.3.1.1.2.5.1.1"><p id="rds_06_0102__p52933326"><strong id="rds_06_0102__b84235270691445">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.01%" id="mcps1.3.3.3.1.1.2.5.1.2"><p id="rds_06_0102__p59740974"><strong id="rds_06_0102__b1882434014210">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="11.709999999999999%" id="mcps1.3.3.3.1.1.2.5.1.3"><p id="rds_06_0102__p1185141063914"><strong id="rds_06_0102__b22529312413">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50.86000000000001%" id="mcps1.3.3.3.1.1.2.5.1.4"><p id="rds_06_0102__p7180698"><strong id="rds_06_0102__b842352706163417">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_06_0102__row44765691"><td class="cellrowborder" valign="top" width="19.42%" headers="mcps1.3.3.3.1.1.2.5.1.1 "><p id="rds_06_0102__en-us_topic_0000001789916316_p69633355250">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="18.01%" headers="mcps1.3.3.3.1.1.2.5.1.2 "><p id="rds_06_0102__en-us_topic_0000001789916316_p13963113520251">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="11.709999999999999%" headers="mcps1.3.3.3.1.1.2.5.1.3 "><p id="rds_06_0102__p14625317612">String</p>
</td>
<td class="cellrowborder" valign="top" width="50.86000000000001%" headers="mcps1.3.3.3.1.1.2.5.1.4 "><p id="rds_06_0102__p28182251">Specifies the project ID of a tenant in a region.</p>
<p id="rds_06_0102__p27281110194">For details about how to obtain the project ID, see <a href="rds_03_0002.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="rds_06_0102__row5992637"><td class="cellrowborder" valign="top" width="19.42%" headers="mcps1.3.3.3.1.1.2.5.1.1 "><p id="rds_06_0102__en-us_topic_0000001789916316_p3963163516252">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="18.01%" headers="mcps1.3.3.3.1.1.2.5.1.2 "><p id="rds_06_0102__en-us_topic_0000001789916316_p20963335192520">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="11.709999999999999%" headers="mcps1.3.3.3.1.1.2.5.1.3 "><p id="rds_06_0102__p13625615610">String</p>
</td>
<td class="cellrowborder" valign="top" width="50.86000000000001%" headers="mcps1.3.3.3.1.1.2.5.1.4 "><p id="rds_06_0102__p64450739155220">Specifies the DB instance ID.</p>
</td>
</tr>
<tr id="rds_06_0102__row241814298545"><td class="cellrowborder" valign="top" width="19.42%" headers="mcps1.3.3.3.1.1.2.5.1.1 "><p id="rds_06_0102__p161463213617">offset</p>
</td>
<td class="cellrowborder" valign="top" width="18.01%" headers="mcps1.3.3.3.1.1.2.5.1.2 "><p id="rds_06_0102__p1314622115615">No</p>
</td>
<td class="cellrowborder" valign="top" width="11.709999999999999%" headers="mcps1.3.3.3.1.1.2.5.1.3 "><p id="rds_06_0102__p15955134122710">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50.86000000000001%" headers="mcps1.3.3.3.1.1.2.5.1.4 "><p id="rds_06_0102__p12501184214333">Index offset. The query starts from the next piece of data indexed by this parameter.</p>
<p id="rds_06_0102__p6152162703711">The value must be a non-negative number.</p>
<p id="rds_06_0102__p34651093715">The default value is <strong id="rds_06_0102__b122463133015">0</strong>, indicating that the query starts from the first data record.</p>
</td>
</tr>
<tr id="rds_06_0102__row205151333105411"><td class="cellrowborder" valign="top" width="19.42%" headers="mcps1.3.3.3.1.1.2.5.1.1 "><p id="rds_06_0102__p114610212069">limit</p>
</td>
<td class="cellrowborder" valign="top" width="18.01%" headers="mcps1.3.3.3.1.1.2.5.1.2 "><p id="rds_06_0102__p101466211263">No</p>
</td>
<td class="cellrowborder" valign="top" width="11.709999999999999%" headers="mcps1.3.3.3.1.1.2.5.1.3 "><p id="rds_06_0102__p4955941102711">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50.86000000000001%" headers="mcps1.3.3.3.1.1.2.5.1.4 "><p id="rds_06_0102__p8445142711377">Number of records to be queried.</p>
<p id="rds_06_0102__en-us_topic_0291571266_p14921123723811">The value ranges from 1 (inclusive) to 100 (inclusive).</p>
<p id="rds_06_0102__p72931151193516">The default value is <strong id="rds_06_0102__b86393404544">10</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="rds_06_0102__section36474591"><h4 class="sectiontitle">Request</h4><ul id="rds_06_0102__ul1183180183717"><li id="rds_06_0102__li1283110163719">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_06_0102__table12536623333" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="rds_06_0102__row153612211337"><th align="left" class="cellrowborder" valign="top" width="19.7%" id="mcps1.3.4.2.1.1.2.5.1.1"><p id="rds_06_0102__p95111733143318">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.780000000000001%" id="mcps1.3.4.2.1.1.2.5.1.2"><p id="rds_06_0102__p13511123373311">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.959999999999999%" id="mcps1.3.4.2.1.1.2.5.1.3"><p id="rds_06_0102__p125111433133312">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.559999999999995%" id="mcps1.3.4.2.1.1.2.5.1.4"><p id="rds_06_0102__p551110331335">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="rds_06_0102__row05378213331"><td class="cellrowborder" valign="top" width="19.7%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="rds_06_0102__p1163015550331">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="13.780000000000001%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="rds_06_0102__p1963035563316">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.959999999999999%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="rds_06_0102__p1630105520331">String</p>
</td>
<td class="cellrowborder" valign="top" width="53.559999999999995%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><p id="rds_06_0102__p1086851153317">Specifies the user token.</p>
<p id="rds_06_0102__p1057635831">The user token is a response to the API used to <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0057845583.html" target="_blank" rel="noopener noreferrer">obtain a user token</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="rds_06_0102__ul51575500564"><li id="rds_06_0102__li4411135064210">URI example<pre class="screen" id="rds_06_0102__screen061062711542">GET https://rds.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/slowlog-files</pre>
</li></ul>
</div>
<div class="section" id="rds_06_0102__section59835867"><h4 class="sectiontitle">Response</h4><ul id="rds_06_0102__ul66273227"><li id="rds_06_0102__li59588135">Normal response
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_06_0102__table29752153" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="rds_06_0102__row62070345"><th align="left" class="cellrowborder" valign="top" width="19.040000000000003%" id="mcps1.3.5.2.1.1.2.4.1.1"><p id="rds_06_0102__p61642077"><strong id="rds_06_0102__b232101342">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.26%" id="mcps1.3.5.2.1.1.2.4.1.2"><p id="rds_06_0102__p26952341"><strong id="rds_06_0102__b842352706164541">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="66.7%" id="mcps1.3.5.2.1.1.2.4.1.3"><p id="rds_06_0102__p35656026"><strong id="rds_06_0102__b518355602">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_06_0102__row49943891183823"><td class="cellrowborder" valign="top" width="19.040000000000003%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="rds_06_0102__p136063283314">list</p>
</td>
<td class="cellrowborder" valign="top" width="14.26%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="rds_06_0102__p28299952183823">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="66.7%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="rds_06_0102__p5607152816312">Slow log file information. For details, see <a href="#rds_06_0102__response_SlowLogFile">Table 4</a>.</p>
</td>
</tr>
<tr id="rds_06_0102__row6331999514368"><td class="cellrowborder" valign="top" width="19.040000000000003%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="rds_06_0102__p1460762893117">total_count</p>
</td>
<td class="cellrowborder" valign="top" width="14.26%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="rds_06_0102__p1160732816310">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="66.7%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="rds_06_0102__p18607928133115">Total number of files.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="rds_06_0102__response_SlowLogFile"></a><a name="response_SlowLogFile"></a><table cellpadding="4" cellspacing="0" summary="" id="rds_06_0102__response_SlowLogFile" frame="border" border="1" rules="all"><caption><b>Table 4 </b>SlowLogFile field data structure description</caption><thead align="left"><tr id="rds_06_0102__row15370514123413"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.5.2.1.2.2.4.1.1"><p id="rds_06_0102__p193721214193417"><strong id="rds_06_0102__b7404105216426">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.5.2.1.2.2.4.1.2"><p id="rds_06_0102__p13373151416343"><strong id="rds_06_0102__b13261850152610">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.5.2.1.2.2.4.1.3"><p id="rds_06_0102__p3373141453411"><strong id="rds_06_0102__b2661135132611">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_06_0102__row163701814183419"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="rds_06_0102__p13374111403410">file_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="rds_06_0102__p23751314183416">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="rds_06_0102__p7376201423412">File name.</p>
</td>
</tr>
<tr id="rds_06_0102__row0370151463414"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="rds_06_0102__p13768140341">file_size</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="rds_06_0102__p8378151417348">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="rds_06_0102__p53781714143413">File size in bytes.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="rds_06_0102__ul26818564"><li id="rds_06_0102__li40040492">Example normal response<pre class="screen" id="rds_06_0102__screen10937165102918">{
"total_count" : 1,
"list" : [ {
"file_name" : "SQLTrace.trc",
"file_size" : "1024"
} ]
}</pre>
</li><li id="rds_06_0102__li15461118163817">Abnormal Response<p id="rds_06_0102__p46896054"><a name="rds_06_0102__li15461118163817"></a><a name="li15461118163817"></a>For details, see <a href="en-us_topic_0032488197.html">Abnormal Request Results</a>.</p>
</li></ul>
</div>
<div class="section" id="rds_06_0102__section4778540915440"><h4 class="sectiontitle">Status Code</h4><ul id="rds_06_0102__en-us_topic_0032347778_ul7858132212142"><li id="rds_06_0102__en-us_topic_0032347778_li58581622171411">Normal<p id="rds_06_0102__en-us_topic_0032347778_p1040982941020"><a name="rds_06_0102__en-us_topic_0032347778_li58581622171411"></a><a name="en-us_topic_0032347778_li58581622171411"></a>200</p>
</li><li id="rds_06_0102__en-us_topic_0032347778_li11583183218149">Abnormal<p id="rds_06_0102__en-us_topic_0032347778_p0723374409"><a name="rds_06_0102__en-us_topic_0032347778_li11583183218149"></a><a name="en-us_topic_0032347778_li11583183218149"></a>For details, see <a href="en-us_topic_0032488240.html">Status Codes</a>.</p>
</li></ul>
</div>
<div class="section" id="rds_06_0102__section1183074220016"><h4 class="sectiontitle">Error Code</h4><p id="rds_06_0102__en-us_topic_0032347778_p19357163913406">For details, see <a href="en-us_topic_0032488241.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0056887472.html">Log Information Queries</a></div>
</div>
</div>