|
-
Modify this according to your requirement.
declare
V_STRING VARCHAR2(400);
V_SID VARCHAR2(40);
V_SERIAL VARCHAR2(40);
cursor cur1 IS
select SID,SERIAL# from v$session where serial#!=1 and status!='ACTIVE' and type !='BACKGROUND';
begin
For x in cur1 LOOP
V_SID:=x.SID;
V_SERIAL:=x.SERIAL#;
V_STRING := 'ALTER SYSTEM KILL SESSION '''||V_SID||', '||V_SERIAL||'''';
EXECUTE IMMEDIATE V_STRING;
end loop;
end;
/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|