Kill Session for SQL ID in Oracle

Kill Session for SQL_ID in Oracle

Kill the Session which running SQLID
Put the SQL ID for kill the session

SELECT 'alter system kill session '''|| SID || ',' || SERIAL# || ''' immediate ;'
FROM v$session
WHERE sql_id = '&sql_id';

-- In RAC
SELECT 'alter system kill session '''|| SID|| ','|| SERIAL#|| ',@'|| inst_id|| ''' immediate ;'
FROM gv$session
WHERE sql_id = '&sql_id'

Check the SQL ID from SQL TEXT

SELECT sql_id FROM v$sql WHERE sql_text LIKE 'SELECT * FROM HR.EMP%';

Unknown's avatar

Author: SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply

Discover more from SmartTechWays - Innovative Solutions for Smart Businesses

Subscribe now to keep reading and get access to the full archive.

Continue reading