Oracle Kill Session Scripts -1

Hi,

Sometimes application developers or client offers you to kill any session or sessions group like SQL Net Client, or JDBC Client sessions or RMAN sessions.

You need to find session SID and SERIAL# with below script.

select s.SID,s.SERIAL#,S.USERNAME from v$session s where s.sid=63;

 

You can kill any session with its SID and SERIAL# number like below.

alter system kill session '63,1963';

 

Customer offers you to kill sessions group like SQL Net Client, or JDBC Client sessions or RMAN sessions. You can generate kill session script like below. You can change event to kill any other event group sessions.

SELECT 'kill -9 ' || p.spid, s.username,
'alter system kill session ''' || SID || ',' || s.serial# || ''';'
FROM v$session s, v$process p
WHERE s.paddr = p.addr(+)
AND s.SID IN (SELECT SID
FROM v$session_wait
WHERE event LIKE 'SQL*Net message from client%')
and s.username ='DEVECI'
and s.saddr not in ( select SES_ADDR from v$transaction );

 

 

You can read other Kill Session Scripts in Oracle.

 

 

Mehmet Salih Deveci

I am Founder of IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress mehmetsalih.deveci@outlook.com.-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  mehmetsalih.deveci@outlook.com a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *