å¾å¤æ
åµä¸ï¼æ们éè¦ä½¿ç¨ alter system kill session ç»æ¢æ°æ®åºä¸çæ个 session,éæ¾è¯¥ session æå ç¨çèµæºæ¥è§£å³é®é¢ã
æ¯å¦ï¼daniel æå¨çç¯å¢å°±ç»å¸¸ä½¿ç¨å¦ä¸è¯å¥æ¹éè¯å¥ææ»æ°æ®åºä¸ç session.
select 'ALTER SYSTEM KILL SESSION '''||b.sid||', '||b.serial#||''';'
from gv$access a,gv$session b
where a.SID=b.SID
and b.program like 'dis%'
group by b.sid,b.serial#;
该èæ¬å¨åå®ä¾æ
åµä¸ï¼gv$å
¨é¨æ¿æ¢ä¸º v$ï¼è¿é常åæï¼ç¡®å®è½å¤æææéç session.
ä½æ¯å¨ RAC ç¯å¢ä¸ï¼å¿
é¡»å°çæçèæ¬å¨ææå®ä¾ä¸æ§è¡ï¼æè½ææå
¨é¨éè¦ææç session.
æ们æ¥å
³æ³¨ä¸ä¸ alter system kill session çè¯æ³ï¼
The KILL SESSION clause lets you mark a session as terminated, roll back ongoing transactions, release all session locks, and partially recover session resources. To use this clause, your instance must have the database open. Your session and the session to be terminated must be on the same instance unless you specify integer3.You must identify the session with the following values from the V$SESSION view:
KILL SESSION 'integer1, integer2[, @integer3]' [IMMEDIATE]
For integer1, specify the value of the SID column.
For integer2, specify the value of the SERIAL# column.
For the optional integer3, specify the ID of the instance where the target session to be killed exists. You can find the instance ID by querying the GV$ tables.
IMMEDIATE Specify IMMEDIATE to instruct Oracle Database to roll back ongoing transactions, release all session locks, recover the entire session state, and return control to you immediately.
å¨ RAC ç¯å¢ä¸ï¼æä»¬ä½¿ç¨ gv$session è§å¾ï¼è·åç¸åºç session ä¿¡æ¯ï¼é¤äºè¦è·å session ç sid å serial# å¤ï¼è¿éè¦è·å session æè¿è¡ç inst_id,å¹¶å¨ alter system kill session åå¥ä¸ç¨ @inst_id æå®ï¼æè½ææ该 session,å¦åå¿
é¡»è¿æ¥å°ç¸åºç RAC å®ä¾æè½ææã
温馨提示:答案为网友推荐,仅供参考