Database Administration (MOSC)

MOSC Banner

Killing user session

edited Jun 29, 2012 3:37AM in Database Administration (MOSC) 14 comments
Hi,

Almost everyday we have requirement to kill user sessions for dev user, I'm thinking to create a procedure for this and grant to the users  so that they can kill it by themself.

Below is the what I got from net, however  appreciate if someone can share few information if  already imlemented in there environment

create or replace procedure kill_session( p_sid     in number,
                                           p_serial# in number)
   is
       ignore          pls_integer;
  BEGIN
      select count(*) into ignore
          from V$session
        where username = USER
        and sid = p_sid
         and serial# = p_serial# ;

     if ( ignore = 1 )
     then
          execute immediate '
              alter system kill session ''' ||

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center