| How to kill session in Oracle RAC database? |
|
| Tips and technical articles of Oracle DBA |
| In various critical situations Oracle DBA has to decide to kill existing session or kill the background process of Oracle RAC database. At this moment remote Oracle DBA should need to terminate session/process called as murder of session of any instance. |
|
|
Some basic syntax is changed for killing session in Oracle RAC instance. Oracle RAC database contains one or more instances. First oracle RAC DBA should need to identify which session has be killed and in which instance contains said target session.
|
|
|
It is very simple way to kill session using command line of Oracle RAC instance:
|
|
| Using SQL*Plus (kill session with alter system command): |
|
We use v$session for indetifying target session to kill in non-rac database.Here in Oracle RAC instance we should need to check and identify session using gv$session. Because only gv$session contains rac instance identifier column. After identifying target session from gv$session we need command "alter system kill session" with session identifier (sid), serial number (serial#) and instance number of Oracle RAC (instance_no). Here is example to kill or terminate active session from Oracle RAC database or instance.
|
|
|
SQL>select sid,serial#,inst_id from gv$session where machine='GPTWORKGROUP';
SID SERIAL# INST_ID
--------- --------- -------
9 171 1
1 row selected
SQL> alter system kill session '9,171,@1';
System altered.
OR
SQL>alter system kill session '9,171,@1' immediate;
System altered.
And terminated user session will get message in sqlplus that "your session has been killed" in Oracle RAC instance. We can get output of status as "killed" from gv$session for terminated session.
|
|
| Check another articles on same topic of different type.
|
|
| How to kill session using Oracle 11g new feature: |
|
| How to kill session in Oracle using SQL*Plus: |
|
| How to kill session in Oracle using operating system commands: |
|