Professional Documents
Culture Documents
Multiple Session Killing
Multiple Session Killing
SQL>spool kill12.sql
SQL>spool off
SQL> @kill12.sql
select 'alter system kill session '''||sid||','||serial#||''' immediate;' from GV$SESSION where
type='USER' and username is not null and username not in ('DBA1','DBSNMP','PUBLIC','SYS','SYSTEM')
and username='REPUSER' and machine in ('jbosschkhrtbt1.ds.indianoil.in','jws2.ds.indianoil.in') and
status='INACTIVE';
Note:For RAC Database where we have more than 1 instances,we need to follow step 2 on all the Oracle
instances.
SQL>spool off
Note:For RAC Database where we have more than 1 instances,we need to follow step 2 on all the Oracle
instances.
To kill all ODI sessions in Database:
sqlplus "/as sysdba"
SQL>spool off
Note:For RAC Database where we have more than 1 instances,we need to follow step 2 on all the Oracle
instances.
How to get the list of Users and Processes running ODI sessions:
Note:For RAC Database where we have more than 1 instances,we need to follow step 2 on all the Oracle
instances.
Select 'alter system kill session '''||Sid||','||Serial#||''' immediate;' From Gv$session Where
Blocking_Session Is Not Null And Inst_Id='1' ;
select 'alter system kill session '''||sid||','||serial#||''' immediate;' from GV$SESSION where
blocking_session is not null and inst_id='2' ;
--------------------------------------------------------
select 'alter system kill session '''||sid||','||SERIAL#||''' immediate;' from GV$SESSION where
USERNAME='SMS' and STATUS='INACTIVE' and INST_ID='1';
select 'alter system kill session '''||sid||','||serial#||''' immediate;' from gv$session where
username='SMS' and status='INACTIVE' And Inst_Id='2';