KILL SESSION Procedure
589737Oct 9 2007 — edited Oct 1 2009i 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;