Advertisement
GLASHATAY_007

kill sessions

Jan 19th, 2023
655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Oracle 11 0.54 KB | Software | 0 0
  1. SELECT -- substr(a.spid,1,9) pid,
  2.        b.inst_id,
  3.        b.sid,
  4.        b.serial# AS serial,
  5.        b.machine,
  6.        b.username,
  7. --        b.server,
  8.        b.osuser AS os_user,
  9.        b.program,
  10.        LOWER(b.status) AS status,
  11.        'Alter System Kill Session ''' || b.sid || ', ' || b.serial# || ', @' || b.inst_id || ''' Immediate;'  AS kill_command
  12. FROM gv$session b Left Join v$process a ON (b.paddr=a.addr)
  13. WHERE b.TYPE='USER' AND
  14.       b.machine='etl' AND
  15.       LOWER(b.status)='inactive' AND
  16.       0=0
  17. ORDER BY b.sid, b.serial#;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement