set heading off
set feedback off
spool $ORACLE_BASE/util/sql/kill_session.sql
SELECT 'alter system kill session '''||sid||','||serial#||''';'
FROM v$session
WHERE status = 'SNIPED';
spool off
@$ORACLE_BASE/util/sql/kill_session.sql
exit
//-- --------------------2----------------------------------------------------------------------- //
set verify off
begin
for reg in (SELECT sid, serial# FROM v$session WHERE sid = &1) loop
execute immediate 'alter system kill session '''||reg.sid||','||reg.serial#||''' immediate';
end loop;
end;
/