declare
cursor cur_sess is
select sid, serial#
from v$session
where
username like 'NO%';
w_sid number;
w_serial number;
begin
open cur_sess;
loop
fetch cur_sess into w_sid,w_serial;
if cur_sess%notfound then
exit;
end if;
execute immediate 'alter system kill session '''||w_sid|| ', '||w_serial|| '''';
end loop;
end;
oracle通过游标方式删除所有以NO开头的session
最新推荐文章于 2024-04-28 15:35:13 发布