BEGIN
FOR v IN (
SELECT 'alter system kill session ''' || a.sid || ',' || a.serial# || ''' immediate' AS v_sql
FROM v$session a
WHERE a.program in ('plsqldev.exe') ) LOOP
begin
EXECUTE IMMEDIATE v.v_sql;
exception
when others then
commit;
end;
END LOOP;
END;
/
转载于:https://blog.51cto.com/12185273/2066558