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; / 本文转自 rm_rf_db 51CTO博客,原文链接:http://blog.51cto.com/12185273/2066558,如需转载请自行联系原作者