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%';

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.