【翻譯自mos文章】在RAC database中怎麼獨立於instance來kill session?,mosrac

來源:互聯網
上載者:User

【翻譯自mos文章】在RAC database中怎麼獨立於instance來kill session?,mosrac

來源於:
How to Kill a Session on RAC Database In Instance Independent Fashion. (文檔 ID 869777.1)

適用於:
Oracle Database - Enterprise Edition - Version 11.1.0.6 and later
Information in this document applies to any platform.

目標:
你可以在RAC database中來kill session,而不用考慮該session是從哪個intance上產生的。這是11g的新特性。

解決方案:

To kill a session in RAC database use the following syntax.

sql> conn / as sysdbasql> alter system kill session 'sid, serial#, @inst_id';

 

For Example :

SQL@racdb1> select inst_id,sid,serial#,username from gv$session where username is not null and username not like 'SYS%'; INST_ID SID SERIAL# USERNAME ---------- ---------- ---------- ------------------------------ 1                123        76       DBSNMP 1 rows selected. SQL@racdb2> conn scott/tiger Connected. SQL@racdb1> select inst_id,sid,serial#,username from gv$session where username is not null and username not like 'SYS%'; INST_ID SID SERIAL# USERNAME ---------- ---------- ---------- ------------------------------ 2                115    17816        SCOTT 1                123         76         DBSNMP 2 rows selected. SQL@racdb1> alter system kill session '115,17816,@2'; System altered. SQL@racdb1> conn scott/tiger Connected. SQL@racdb1> select inst_id,sid,serial#,username from gv$session where username is not null and username not like 'SYS%'; INST_ID SID SERIAL# USERNAME ---------- ---------- ---------- ------------------------------ 1                110      45316         SCOTT 1                123            76         DBSNMP 2 rows selected. sql> alter system kill session '110,45316,@1';System altered.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.