【翻譯自mos文章】在RAC database中怎么獨(dú)立于instance來kill session?
來源:程序員人生 發(fā)布時(shí)間:2015-03-23 08:23:43 閱讀次數(shù):3862次
來源于:
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.
目標(biāo):
你可以在RAC database中來kill session,而不用斟酌該session是從哪一個(gè)intance上產(chǎn)生的。這是11g的新特性。
解決方案:
To kill a session in RAC database use the following syntax.
sql> conn / as sysdba
sql> 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.
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈