Sunday, February 2, 2020

Kill Multiple Oracle Sessions both active and inactive by Loop

--Kill Multiple Oracle Sessions both active and inactive by Loop


BEGIN
  FOR r IN (select sid,serial# from v$session where username = 'USER')
  LOOP
    EXECUTE IMMEDIATE 'alter system kill session ''' || r.sid
      || ',' || r.serial# || '''';
  END LOOP;
END;

No comments:

Post a Comment