doc-exports/docs/dws/dev/dws_06_0141.html
Lu, Huayi a24ca60074 DWS DEVELOPER 811 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-01-19 13:37:49 +00:00

42 lines
4.0 KiB
HTML

<a name="EN-US_TOPIC_0000001145510663"></a><a name="EN-US_TOPIC_0000001145510663"></a>
<h1 class="topictitle1">ALTER SYSTEM KILL SESSION</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001145510663__s79961ef5d2c34f1983a3fa6eff0c5973"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001145510663__a43cdc530a441439f9f97bc56e7604a9f"><strong id="EN-US_TOPIC_0000001145510663__b474967412215259">ALTER SYSTEM KILL SESSION</strong> ends a session.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001145510663__s6171ddfcaafe4f64b983cc09530e552f"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001145510663__ab0c06538481c4826a4112a3582df1b80">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001145510663__s6649c38ee1a14feeb356302aff6d6096"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001145510663__s5a8cddc5bdd548da9fda4ca5e4994f51"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">ALTER</span><span class="w"> </span><span class="k">SYSTEM</span><span class="w"> </span><span class="n">KILL</span><span class="w"> </span><span class="k">SESSION</span><span class="w"> </span><span class="s1">'session_sid, serial'</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">IMMEDIATE</span><span class="w"> </span><span class="p">];</span><span class="w"></span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001145510663__s4b2e5c70eb634b90b8f99d17f3e98758"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001145510663__u7fd7092118fa43c6b1be640a62fcbd0f"><li id="EN-US_TOPIC_0000001145510663__l4ebd09917cfb4b8f8a58e0b0e5232748"><strong id="EN-US_TOPIC_0000001145510663__a9c9bce77157e4e99b34f4e0adbf76d03">session_sid, serial</strong><p id="EN-US_TOPIC_0000001145510663__a042e506012174158992641c8b4e98084">Specifies <strong id="EN-US_TOPIC_0000001145510663__en-us_topic_0058965816_b84235270611830">SID</strong> and <strong id="EN-US_TOPIC_0000001145510663__en-us_topic_0058965816_b84235270611835">SERIAL</strong> of a session (see examples for format).</p>
<p id="EN-US_TOPIC_0000001145510663__a8fdef61ea7164ba7bb103b68cfdf518a">Value range: The <strong id="EN-US_TOPIC_0000001145510663__b84235270611848">SID</strong>s and <strong id="EN-US_TOPIC_0000001145510663__b84235270611857">SERIAL</strong>s of all sessions that can be queried from the system catalog <strong id="EN-US_TOPIC_0000001145510663__b8423527061193">V$SESSION</strong>.</p>
</li><li id="EN-US_TOPIC_0000001145510663__l1cb60cbf99054758bf8ffed75df185f1"><strong id="EN-US_TOPIC_0000001145510663__a3eb73a4c487d47df90f38694491247d1">IMMEDIATE</strong><p id="EN-US_TOPIC_0000001145510663__af6e54a1c136a44d3bf10a22800e384be">Indicates that a session will be ended instantly after the command is executed.</p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001145510663__s4c7ec9e661584b68bb8ed5cd2d05074d"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001145510663__p1284636163620">Query session information.</p>
<pre class="screen" id="EN-US_TOPIC_0000001145510663__screen889111663714">SELECT sid,serial#,username FROM V$SESSION;
sid | serial# | username
-----------------+---------+----------
140131075880720 | 0 |
140131025549072 | 0 |
140131073779472 | 0 |
140131071678224 | 0 |
140131125774096 | 0 |
140131127875344 | 0 |
140131113629456 | 0 |
140131094742800 | 0 |
(8 rows)</pre>
<p id="EN-US_TOPIC_0000001145510663__p12821236163618">End the session whose SID is 140131075880720.</p>
<pre class="screen" id="EN-US_TOPIC_0000001145510663__screen86816269371">ALTER SYSTEM KILL SESSION '140131075880720,0' IMMEDIATE;</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0118.html">DDL Syntax</a></div>
</div>
</div>