create or replace procedure sys.kill_session( p_sid in number, p_serial# in number )
as
begin
for x in ( select 1
from v$session
where username = 'USERNAME'
and sid = p_sid
and serial# = p_serial# )
loop
execute immediate 'alter system kill session ''' || p_sid || ',' || p_serial# || '''';
dbms_output.put_line( 'Kill session done' );
end loop;
end;
/
grant execute on sys.kill_session to USERNAME;
grant select on sys.v_$session to USERNAME;
Last active
September 23, 2022 17:33
-
-
Save Tracnac/e771ac08e95b744fe083444f49415261 to your computer and use it in GitHub Desktop.
Procédure Kill session #oracle #sql
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment