Skip to content

Instantly share code, notes, and snippets.

@mjbommar
Created June 15, 2013 12:59
Show Gist options
  • Save mjbommar/5788046 to your computer and use it in GitHub Desktop.
Save mjbommar/5788046 to your computer and use it in GitHub Desktop.
Generate a script to kill (IMMEDIATE) all sqlplus sessions from a given host.
SELECT 'ALTER SYSTEM KILL SESSION ''' || sid || ',' || serial# || ',@' || inst_id || ''' IMMEDIATE;'
FROM gv$session
WHERE module = 'SQL*Plus'
AND machine = 'host.company.com';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment