Kill all oracle session

Situation:
Oracle Forms 9i application, with multiple oracle forms (MDI). When I call a new forms I use OPEN_FORM(v_cm_module, ACTIVATE, session, pl_id) so I create a new oracle session.
Problem:
The user open a lot of windows (oracle forms .fmx with diferent sessions each one) in the oracle forms application, when they close the browser window (X botom of the browser, mozilla, internet explorer), the session are still alive (only kill one session....the first I think).
I know that after 15 minutes oracle kill the rest of the sessions, but if the user was editing a block (locking a record), and close the browser, the table still lock 15 minutes!!!!.
Any sugestions:???
Thanks

Is it necessary to create a session for each form?
If so you could do the following:
in the formsweb.cfg set the seperateframe property on true; and place some JavaScript code into the htmlafterform property:
HTMLafterForm=<script type="text/javascript"> window.moveTo(-10000, -10000); </script>
now you have a seperate frame, the browser window gets moved to a position where you can't see it ;-). when clicking the X button in the seperate frame the current form will be closed; your MDI application is still running...if you wan't you can write a JavaBean, and get the windowlisteners of the seperate frame and replace them with your own...of course you can close the Browser by right clicking and closing it in the taskbar; but that's a thing you must live with...
besides that I have no clue how to get rid of those sessions, as I don't you have any event you can act with when closing the Browser. But if so you could save every sid in every when-new-form-instance trigger (you can get it from v$mystat), and when this event occurs you could kill all those sessions (alter system kill session ....) ;-). but as far as I know that's not possible...
regards
christian

Similar Messages

  • Looking for a script to kill all inactive sessions

    Does anyone have a script to kill all INACTIVE sessions (with EXECUTE IMMEDIATE)?

    I suggest you to specify which OS you are talking about.
    The inactive status on the V$SESSION doesn't mean the user is not doing any thing, it only means the oracle server process is not processing any thing by the time it was queried. On OLTP systems Oracle Server Processes remain INACTIVE for more than 95% of the time, so it is advisable to configure shared servers.
    If you are really concerned about idle time, then I suggest you to configure profiles.
    On the pool mechanism you should address the microsoft side, if this, as far as I understood and guessed, application server is IIS.
    I suggest you further reading on the Killing sessions script and different session status (check the sniped status) here:
    Re: session inactive ??
    Re: make a job to delete the sniped sessions
    Re: How do I put a timeout in my DataBase?
    Re: Killing Session with Locks in Linux
    ~ Madrid

  • How to kill particular Oracle Session from the multiple Session of User

    Hi,
    I am working on Web Application using ASP.NET , C# with Oracle. I am excuting queries from multiple connection of same user. I want to kill particular user session. I have tried to Kill session by using ALTER SYSTEM KILL SESSION 'sid,serial#' it is working fine but how can i identify which session is generated by particular connection so that i can kill that particular session.
    Suppose there us user 'abc' there are multple instance of this user and all are active but same USERNAME. So Please tell me how can i identify that session through which i am executing the query.
    Thanks,
    Nitin

    Some ideas for how to pick the right session:
    -Look at the time the session was connected (logon_time)
    -Look at the time the session last started it's most recent statement (last_call_et)
    -Look at the sql that the session is running (join with sql_address and sql_hash_value over to v$sqltext_with_newlines or one of the other views that show you the sql they are running)
    That usually gets me most of the way, if it's possible to distinguish them. ("Yeah I just started this query and I want you to kill it." is different than "I started five different queries at about the same time and I'm not sure which one I need killed.")

  • Total CPU time consumed by all Oracle sessions combined.

    Hello, I need to summarise total cpu time consumbed by all active Oracle sessions and below is the query thta I could come up with.
    However the problem: even if I execute query in a miliseconds duration, the value of total cpu time is always changing for a given session. Hence, is the query below right?
    SELECT SUM( c.value)
    FROM V$SESSION a,
    v$sesstat c,
    v$statname d
    WHERE a.sid = c.sid
    and c.statistic# = d.statistic#
    AND d.name = 'CPU used by this session'
    AND a.status = 'ACTIVE';
    Thanks,
    R

    Your findings are correct - the statistics is changing all the time. I don't see what is the problem here, you just have to add the time stamp and then you can measure the difference between them.
    If you are on 10g or 11g version then I would suggest you to look at V$SESS_TIME_MODEL which also gives interesting aggregated data for session level and for the database level the V$SYS_TIME_MODEL is probable the thing you are looking for.
    SQL> select stat_name,value from v$sys_time_model where stat_name='DB CPU';
    STAT_NAME                                                             VALUE
    DB CPU                                                           2125109375But I would like to warn you that there are some anomalies with time measurement in the database. Consider the following case:
    SQL> create or replace function f_cpu( p number) return number is
      2  m_date date;
      3  begin
      4    for a in 1..p loop
      5       m_date := sysdate;
      6    end loop;
      7    return 0;
      8  end;
      9  /
    Function created.
    SQL> alter session set events '10046 trace name context forever, level 8';
    Session altered.
    SQL> set arraysize 1
    SQL> select f_cpu(300000) from dual connect by level <= 10;
    F_CPU(300000)
                0
                0
                0
                0
                0
                0
                0
                0
                0
                0
    10 rows selected.
    SQL> alter session set events '10046 trace name context off';
    Session altered.From the other session you run your statement which just looks for the CPU usage in the first session. You will see that the CPU time is increased all the time, not just after every fetch call, but also between them.
    Now comes the funny thing - the SQL_TRACE shows the following ( I have removed all wait events to get more clear picture for my purpose):
    PARSING IN CURSOR #4 len=53 dep=0 uid=88 oct=3 lid=88 tim=347421772231 hv=2194474452 ad='230f2310' sqlid='2m7v6ua1cu1fn'
    select f_cpu(300000) from dual connect by level <= 10
    END OF STMT
    PARSE #4:c=0,e=124,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=347421772223
    EXEC #4:c=0,e=103,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=347421772446
    FETCH #4:c=671875,e=588199,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,tim=347422360764
    FETCH #4:c=1437500,e=1282871,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347423644892
    FETCH #4:c=1156250,e=1182013,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347424827769
    FETCH #4:c=1234375,e=1181276,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347426009910
    FETCH #4:c=1187500,e=1179318,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347427190068
    FETCH #4:c=593750,e=593217,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,tim=347427784188In this output "c=" is CPU time in 0.000001s (microseconds) and "e=" is elapsed time. There are many rows where CPU time > elapsed time, what is a well known problem of reporting for CPU timing. This was a single session so this result is unrealistic: how one can use 1.43s CPU time in only 1.28s time.
    FETCH #4:c=1437500,e=1282871,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347423644892The CPU time is bigger than elapsed time - and you can probably notice as well that CPU time is rounded to 00,25,50,75 .
    There are some interesting problems with time measuring in Oracle and one can easily be caught in this trap. I have written a post about this in my blog: http://joze-senegacnik.blogspot.com/2009/12/measurement-error-in-trace-file.html
    HTH, Joze
    Co-author of the forthcoming book "Expert Oracle Practices"
    http://www.apress.com/book/view/9781430226680
    Oracle related blog: http://joze-senegacnik.blogspot.com/
    Blog about flying: http://jsenegacnik.blogspot.com/
    Blog about Building Ovens, Baking and Cooking: http://senegacnik.blogspot.com

  • Killing a oracle session

    Hi,
    I run a oracle query which has gone to deadlock.now i want to kill that session because it's happening frequently.How can i kill my own oracle process without needed DBA privs.
    Regards
    Anand

    Do not confuse between deadlock and hang.
    See the difference.
    Here a deadlock :
    Session 1:
    SCOTT@demo102> select empno, ename from emp25;
         EMPNO ENAME
          7369 SMITH
          7499 ALLEN
          7521 WARD
          7566 JONES
          7654 MARTIN
          7698 BLAKE
          7782 CLARK
          7788 SCOTT
          7839 KING
          7844 TURNER
          7876 ADAMS
         EMPNO ENAME
          7900 JAMES
          7902 FORD
          7934 MILLER
    14 rows selected.
    SCOTT@demo102> begin
      2                update emp25 set ename = 'TEST' where empno=7369;
      3                dbms_lock.sleep(10);
      4                update emp25 set ename = '2' where empno=7499;
      5            end;
      6  /
    PL/SQL procedure successfully completed.
    SCOTT@demo102> Session 2:
    SCOTT@demo102> l
      1  begin
      2      update emp25 set ename = 'TEST' where empno=7499;
      3      dbms_lock.sleep(10);
      4      update emp25 set ename = '2' where empno=7369;
      5* end;
    SCOTT@demo102> /
    begin
    ERROR at line 1:
    ORA-00060: deadlock detected while waiting for resource
    ORA-06512: at line 4
    SCOTT@demo102> As you can see above, there is no wait, neither of both session hang, so you don't need to kill one of them.
    Here a hang session :
    Session 1:
    SCOTT@demo102> update emp25 set ename = 'TEST' where empno=7369;
    1 row updated.
    SCOTT@demo102> Session 2:
    SCOTT@demo102> update emp25 set ename = 'TEST' where empno=7369;=> Wait event (commit/rollback) from session 1.
    If user which is owner of session1 go at home, session 2 will wait all the week-end.
    You need a third session to unblock situation :
    SYS@DEMO102> DECLARE  
      2     CURSOR lcobj_cur IS
      3        select session_id
      4        ,      oracle_username
      5        ,      os_user_name
      6        ,      object_id obj_id
      7        ,      locked_mode
      8        from   V$LOCKED_OBJECT;
      9       
    10     CURSOR obj_cur(p_obj_id IN NUMBER) IS
    11        select owner||'.'||object_name object_name
    12        ,      object_type
    13        from dba_objects
    14        where object_id = p_obj_id;
    15     l_sid    number;
    16     l_serial number;
    17  BEGIN
    18     DBMS_OUTPUT.PUT_LINE(RPAD('Sid',5)||
    19                          RPAD('Serial',8)||
    20                          RPAD('O-User',10)||
    21                          RPAD('OS-User',10)||
    22                          RPAD('Owner.Object Name',45)||
    23                          RPAD('Object Type',35));
    24 
    25     DBMS_OUTPUT.PUT_LINE(RPAD('-',1,'-')||
    26                          RPAD('-',1,'-')||
    27                          RPAD('-',6,'-')||
    28                          RPAD('-',6,'-')||
    29                          RPAD('-',41,'-')||
    30                          RPAD('-',31,'-'));
    31 
    32     FOR lcobj IN lcobj_cur
    33     LOOP
    34        FOR obj IN obj_cur(lcobj.obj_id)
    35        LOOP
    36           select distinct sid, serial# into l_sid, l_serial from v$session where sid= lcobj.session_id;
    37           DBMS_OUTPUT.PUT_LINE(RPAD(lcobj.session_id,5)||
    38                                RPAD(l_serial,8)||
    39                                RPAD(lcobj.oracle_username,10)||
    40                                RPAD(lcobj.os_user_name,10)||
    41                                RPAD(obj.object_name,45)||
    42                                RPAD(obj.object_type,35));
    43        END LOOP;
    44     END LOOP;
    45  END;
    46  /
    Sid  Serial  O-User    OS-User   Owner.Object Name                            Object Type
    147  121     SCOTT     INKASHI\AdSCOTT.EMP25                                  TABLE
    152  18      SCOTT     INKASHI\AdSCOTT.EMP25                                  TABLE
    PL/SQL procedure successfully completed.
    SYS@DEMO102>
    SYS@DEMO102> select /*+ ORDERED */
      2     blocker.sid blocker_sid
      3  ,  blocked.sid blocked_sid
      4  ,  TRUNC(blocked.ctime/60) min_blocked
      5  ,  blocked.request
      6  from (select *
      7        from v$lock
      8        where block != 0
      9        and type = 'TX') blocker
    10  ,    v$lock            blocked
    11  where blocked.type='TX'
    12  and blocked.block = 0
    13  and blocked.id1 = blocker.id1
    14  /
    BLOCKER_SID BLOCKED_SID MIN_BLOCKED    REQUEST
            152         147           4          6
    SYS@DEMO102>
    SYS@DEMO102> alter system kill session '152,18';
    System altered.
    SYS@DEMO102> Then session1 will be disconnected :
    SCOTT@demo102> select * from emp25;
    select * from emp25
    ERROR at line 1:
    ORA-00028: your session has been killed
    SCOTT@demo102> And session2 can continue his work :
    1 row updated.
    SCOTT@demo102> select * from emp25;
         EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM
        DEPTNO
          7369 TEST       CLERK           7902 17/12/80       8000
            20
    ...Hope this help,
    Nicolas.

  • Changing volume kills all browser sessions

    About half the time I either increase, decrease or mute my volume via my keyboard, all open broswer sessions are killed. I can be logged into multiple websites using both Safari and Firefox and when I hit funtion keys F10, F11 or F12 on my aluminium Apple Extended keyboard, all open browser sessions instantly close. This has been going on since OSX 10.7.0
    I have tried resetting all of my keyboard settings to default and it hasn't helped. It's making me insane!
    Peter
    MacPro Dual Quad Core Intel Xeon
    OSX 10.7.1
    B&W USB Speakers

    Since the new iTunes 10.4.1 Update addresses volume issues with 3rd party keyboards, I thought I'd give it a try even though I am using an Apple keyboard but the issue persists.
    Peter

  • How to kill concurrent request oracle session which is terminated

    Dear,
    In our production environment Concurrent request "Gather Schema Stats" was running 2 days. Hence we cancelled the request.
    Request completed as terminated status. Unfortunately the oracle session of that concurrent request went to "Killed" status. Still utilizing CPU resource.
    If we try, "alter system kill session 'SID,serial#';"
    it gives below message,
    ERROR at line 1:
    ORA-00031: session marked for kill
    Could you please provide steps to kill this oracle session.
    Instance detail:
    Oracle Applications R12.1
    Oracle database 11.1.0.7
    Thanks,
    ...basha
    Edited by: 913932 on Jun 25, 2012 2:32 AM

    In our production environment Concurrent request "Gather Schema Stats" was running 2 days. Hence we cancelled the request.
    Request completed as terminated status. Unfortunately the oracle session of that concurrent request went to "Killed" status. Still utilizing CPU resource.
    If we try, "alter system kill session 'SID,serial#';"
    it gives below message,
    ERROR at line 1:
    ORA-00031: session marked for killTry "alter system kill session 'SID,serial#' immediate".
    Could you please provide steps to kill this oracle session.Concurrent Processing - How to Find Database Session & Process Associated with a Concurrent Program Which is Currently Running. [ID 735119.1]
    Thanks,
    Hussein

  • Kill all sessions of a special user

    Hi all,
    I'm not very familar with PL/SQL but I think this will help my on my "issue".
    Sometimes I need to kill all current sessions (most times 36 sessions) of a single database user.
    All sessions have a different sid and serial# and manually executing "alter system kill session 'xxx,yyyy' isn't really funny.
    Im thinking of a small PL/SQL script which receives the dbuser name as parameter and then killing all sessions of the user.
    Could please anyone give ma a hint or a short example on this??
    Many Thanks
    Joerg
    Edited by: Joerg Lang on 22.06.2009 12:38

    Hey Hoek,
    thanks...
    granting "alter system" to my user, by my self :D, let the procedure run without any errors...
    Strange thing and good to know...
    Ok, but now I'm still having the issue when using the "username" as parameter of the procedure.
    create or replace procedure kill_session(user in varchar2)
    is
    begin
    for sessions in ( select sid, serial#
                        from   v$session
                        where  username = 'user_to_kill')
      loop
        execute immediate 'alter system kill session '''||sessions.sid||','||sessions.serial#||'''';
      end loop;
    end;works fine and all sessions are killed.
    create or replace procedure kill_session(user in varchar2)
    is
    begin
    for sessions in ( select sid, serial#
                        from   v$session
                        where  username = '||user||')
      loop
        execute immediate 'alter system kill session '''||sessions.sid||','||sessions.serial#||'''';
      end loop;
    end;works not, but also now errors ar shown..
    any Idea?

  • Killing Parallel Query Session

    Hi,
    I am running Oracle 11.2.0.1.0 on Solaris 5.10.
    Couple of hours ago, I ran a job through DBMS_JOB (Yes, I need to use dbms_schedular), and in the job I used parallel query. Now I want to remove the job. Also I want to clean up the sessions. I can remove the job by doing DBMS_JOB.remove(job id). Is there a way that I kill one parallel query coordinator session, and it would automatically kill all the slave sessions?
    Thanks and regards
    Edited by: Fahd Mirza on Apr 22, 2010 11:57 AM

    Thanks for the answer.
    I have run the following query with output:
    SQL> select ps.sid,s.username,ps.qcsid
    from v$session s, v$px_session ps
    where s.sid=ps.sid
    and s.username='BIADM';  2    3    4
           SID USERNAME                            QCSID
            91 BIADM                                 147
           267 BIADM                                 147
           290 BIADM                                 147
           332 BIADM                                 147
           345 BIADM                                 147
            69 BIADM                                 147
            92 BIADM                                 147
           102 BIADM                                 147
           222 BIADM                                 147
           112 BIADM                                 147
            73 BIADM                                 147
           126 BIADM                                 147
           136 BIADM                                 147
           145 BIADM                                 147
           170 BIADM                                 147
           180 BIADM                                 147
           276 BIADM                                 147
           190 BIADM                                 147
           221 BIADM                                 147
           234 BIADM                                 147
           214 BIADM                                 147
           246 BIADM                                 147
           270 BIADM                                 147
           256 BIADM                                 147
           278 BIADM                                 147
           291 BIADM                                 147
           309 BIADM                                 147
           298 BIADM                                 147
           323 BIADM                                 147
           344 BIADM                                 147
             2 BIADM                                 147
           331 BIADM                                 147
           134 BIADM                                  94
           125 BIADM                                  94
           156 BIADM                                  94
           168 BIADM                                  94
           181 BIADM                                  94
           205 BIADM                                  94
           191 BIADM                                  94
           215 BIADM                                  94
           232 BIADM                                  94
           245 BIADM                                  94
           255 BIADM                                  94
           269 BIADM                                  94
           292 BIADM                                  94
           302 BIADM                                  94
           280 BIADM                                  94
           311 BIADM                                  94
           147 BIADM                                 147
            94 BIADM                                  94
    50 rows selected.If I kill sessions with sid 147 and 94, shouldn'it it be killing all the sessions of BIADM?
    REGARDS

  • VPN SA rekey drops oracle sessions

    Hello
    We have had this issue for sometime now.  We have solved it for numerous sites with dedicated L2 connections but for some outstanding sites with s2s VPN tunnels (asa to asa) we still run into it.
    Basically when the VPN rekey's the SA (sametime everyday) all Oracle sessions are dropped.  The tunnel stays up and the user stays connected but the oracle sessions ALWAYS drops.  I cant for the life of me find a way to stop this from happening and it only happens with Oracle.   It happens to both remote vpn clients and vpn tunnels.
    Does anyone have any idea what I can do to pinpoint or log the problem from the ASA's?

    Hello,
    I have something similar with ica/metaframe connection.
    Any help will be appreciated.
    Regards
    Sent from Cisco Technical Support iPad App

  • Killing Oracle Sessions

    Please ignore it. By mistakely i posted this thread here.
    Hi All,
    I want to drop one user. If i made a attempt to drop that user, I rec'd "ORA-01940: cannot drop a user that is currently connected." error. So I checked with sessions with the username. No one is using this user. But it resists some inactive sessions.
    SQL> DROP USER test cascade;
    DROP USER test cascade
    ERROR at line 1:
    ORA-01940: cannot drop a user that is currently connected
    SQL>select sid,serial#,username,status from v$session where schemaname='TEST';
    SID SERIAL# USERNAME STATUS
    131 4026 TEST INACTIVE
    143 29325 TEST INACTIVE
    SQL> alter system kill session '131,4026' immediate;
    system altered.
    SQL>alter system kill session '143,29325' immediate;
    system altered.
    SQL> alter system kill session '131,4026' immediate;
    system altered.
    SQL>alter system kill session '143,29325' immediate;
    system altered.
    SQL> alter system kill session '131,4026' immediate;
    system altered.
    SQL>alter system kill session '143,29325' immediate;
    system altered.
    SQL> alter system kill session '131,4026' immediate;
    system altered.
    SQL>alter system kill session '143,29325' immediate;
    system altered.
    Now. I checked in v$sessions,
    SQL>select sid,serial#,username,status from v$session where schemaname='TEST';
    SID SERIAL# USERNAME STATUS
    139 12982 AGILITY_QA INACTIVE
    141 54482 AGILITY_QA INACTIVE
    It shows some other inactive sessions. so i am trying to kill these 2 sessions again some inactive sessions will show.
    Please assist me to fix that problem.
    Message was edited by:
    Moorthy GS

    Try the output of the query to kill all sessions:
    select 'alter system kill session '''||sid||','||'4026''' immediate;' scr
    from v$session
    where schemaname='TEST' and status <> 'KILLED'
    Regards
    RK

  • How to kill oracle session?

    hi there,
    Aside from using tool like TOAD is there a syntax on how to kill oracle session?
    pls help.
    tnx...

    First findout the SID, Serial No for the Particular Session ( syntax is as follows )
    SELECT sid, serial#,osuser, program FROM v$session;
    (Killing the session on SQL Prompt)
    ALTER SYSTEM KILL SESSION 'sid,serial#';
    force to kill the session by adding IMMEDIATE
    ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;
    OS Oracle Kill Session
    First findout the SID, SPID for the Particular Session ( SQL syntax is as follows )
    SELECT s.sid,p.spid, s.osuser ,s.program
    FROM v$process p, v$session s
    WHERE p.addr = s.paddr;
    Windows OS Command for kill Session
    orakill SID SPID
    Regs,
    Naresh

  • Java hibernate oracle sessions never get closed

    Hi all,
    I'm opening some Oracle sessions from a java-hibernate app. When a shutdown my java-hibernate the oracle sessions remain opened, even if the java process is not seen as running with "ps -fea | grep java".
    The problem is that this oracle sessions never die, they remain there and the only way to kill them is to either manually kill oracle process, or to restart the oracle instance or to restart the unix box where oracle resides.
    My java/hibernate app always close the session with a final statement in the source code, no matter what.
    Thanks in advanced.

    Hi all,
    I'm opening some Oracle sessions from a java-hibernate app. When a shutdown my java-hibernate the oracle sessions remain opened, even if the java process is not seen as running with "ps -fea | grep java".
    The problem is that this oracle sessions never die, they remain there and the only way to kill them is to either manually kill oracle process, or to restart the oracle instance or to restart the unix box where oracle resides.
    My java/hibernate app always close the session with a final statement in the source code, no matter what.
    Thanks in advanced.

  • URGENT!!! How to kill a SYS session

    What is the command to kill a SYS session? Let's say someone figured out the SYS password and logged in. Now I want to kill the session. What do I do?
    The ALTER SYSTEM KILL SESSION 'SID,SERIAL#' does not work.
    URGENT!!!!

    Hi,
    >>The ALTER SYSTEM KILL SESSION 'SID,SERIAL#' does not work.
    Why not ?
    C:\>sqlplus sys/******* as sysdba
    SQL*Plus: Release 10.1.0.2.0 - Production on Fri Jun 15 17:06:26 2007
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SYS@ORACLE10> SELECT userenv('ISDBA') from dual;
    USEREN
    TRUE
    SYS@ORACLE10> select sid,serial# from v$session where sid=(select distinct sid from v$mystat);
           SID    SERIAL#
           236      22100
    Other session:
    [pre]
    C:\>sqlplus system/*********
    SQL*Plus: Release 10.1.0.2.0 - Production on Fri Jun 15 17:07:02 2007
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SYSTEM@ORACLE10> alter system kill session '236,22100';
    System altered.
    Back to one ...
    SYS@ORACLE10> select sysdate from dual;
    select sysdate from dual
    ERROR at line 1:
    ORA-00028: your session has been killedCheers

  • Regarding Oracle Sessions

    Oracle Database      : 10g EE Release 10.2.0.1.0
    Webserver           : Weblogic
    Application Language      : Java
    Problem : When i connect to Java application it creates following sessions
    in Oracle server
    SADDR           SID    SERIAL# USERNA MACHINE           PROGRAM
    687CAE3C          9      36980 MYUSER WEBSERVER ADDRESS java.exe
    687D4EAC         26      26646 MYUSER WEBSERVER ADDRESS java.exe
    687ED19C         67      15721 MYUSER WEBSERVER ADDRESS java.exe
    68058310        179      14442 MYUSER WEBSERVER ADDRESS java.exeafterwards when i logout from my java application then it doesn't delete
    the session. these all remain in the v$session.
    And when i am tring to kill the session by following commands.
    SQL> alter system kill session '9, 36980';
    System altered.
    SQL> alter system kill session '26, 26646';
    System altered.
    SQL> alter system kill session '67, 15721';
    System altered.
    SQL> alter system kill session '179, 14442';
    System altered.But when i again query the v$session view it shows me all the session but the
    status is killed..
    But i cann't drop that user by runing following query
    SQL> drop user myuser cascade;
    drop user myuser cascade
    ERROR at line 1:
    ORA-01940: cannot drop a user that is currently connected.
    Is any thing wrong in my process ?
    Any suggestions
    Regards
    Singh

    The vast majority of the time, when you're using a J2EE app server like Weblogic, the application server is going to maintain a connection pool. When the application server starts up, it creates a number of physical database connections. When your Java code opens and closes a connection, it's really just getting a connection from the pool and returning it to the pool. From Oracle's standpoint, nothing happens when you logically open a connection in this way, which is generally good because opening and closing physical connections is relatively expensive.
    So in summary
    - The number of sessions in V$SESSION probably has everything to do with the size of the connection pool you've configured in Weblogic and nothing to do with how many logical connections your application is using at any point in time.
    - Do not kill sessions that are part of a connection pool. Oracle will keep the connection around until the client (in this case Weblogic) tries to re-use it, at which point Oracle will inform the client that the connection has been killed, and Weblogic will report the error to whatever application was requesting the connection.
    - If you shut down Weblogic, the physical connections should go away.
    Justin

Maybe you are looking for