Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

KILL SESSION Procedure

589737Oct 9 2007 — edited Oct 1 2009
i have created a procedure that I will check for open sessions and then kill them. I tried to compile this procedure using sqldeveloper and the output i got was Warning: execution completed with warning. package body Compiled. I then go and look for the package and i don't see it on the database. Here is my package and procedure...what am i doing wrong here? Is my syntax incorrect?

create or replace
package body pkg_sess_kill as
procedure sp_sess_kill is
--DECLARE
v_sid number;
v_serial# number;
v_username varchar2(30);
CURSOR checkuser IS
select sid,serial#,username
from v$session
where username IN ('CMSLOGGER',
'CMS2WIRE',
'SMS2WIRE');
BEGIN
OPEN checkuser;
FETCH checkuser into v_sid,v_serial#,v_username;
EXIT when checkuser%NOTFOUND;
IF v_username is not null THEN
ALTER SYSTEM KILL SESSION 'v_sid,v_serial#' IMMEDIATE;
END IF;
CLOSE checkuser;
END sp_sess_kill;
END pkg_sess_kill;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 29 2009
Added on Oct 9 2007
24 comments
7,640 views