Kill Inactive Sessions

There are a lot of inactive sessions in my server, and I want to make a procedure to kill.But I can not use command like 'alert system kill session ...' in the procedure.
How can I do it.

Hi,
Use the dbms_sql package to do the job.
procedure(v_sid varchar2, v_serial varchar2);
c number;
n number;
ssql varchar2(1000);
begin
c:=dbms_sql.open_cursor;
sqlstr:='alter system kill session '| |
''''| |v_sid| |', '| |v_serial| |''''| |';';
dbms_sql.parse(c, ssql, dbms_sql.native);
n:=dbms_sql.execute(c);
dbms_sql.close_cursor(c);
end;
null

Similar Messages

  • PL/SQL procedure to kill inactive session

    Hi all ,
    Please i am trying to write a procedure to kill inactive sessions of the shema 'TESTSCHEMA' .This is my first procedure , am not use to pl/sql but i went through many turtorial but have some errors at compliation .when i try to compile the procedure the errors are as below :
    15:50:28 Start Find Objects [TESTSCHEMA@TESTDB_UNIX(2)] ...
    15:50:28 End Find Objects [TESTSCHEMA@ TESTDB_UNIX(2)]
    15:50:32 Start Compiling 1 object(s) ...
    15:50:32 Executing ALTER PROCEDURE fib_dead_cnx_cleanup COMPILE ...
    15:50:32 [13:2] PL/SQL: ORA-00933: SQL command not properly ended
    15:50:32 [9:3] PL/SQL: SQL Statement ignored
    15:50:32 [18:12] PLS-00103: Encountered the symbol "(" when expecting one of the following:
    15:50:32 constant exception <an identifier>
    15:50:32 <a double-quoted delimited-identifier> table LONG_ double ref
    15:50:32 char time timestamp interval date binary national character
    15:50:32 nchar
    15:50:32 The symbol "<an identifier>" was substituted for "(" to continue.
    15:50:32 [18:21] PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
    15:50:32 := ; not null default character
    15:50:32 The symbol "; was inserted before "LOOP" to continue.
    15:50:32 [27:8] PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
    15:50:32 begin case declare exit for goto if loop mod null pragma
    15:50:32 raise return select update while with <an identifier>
    15:50:32 <a double-quoted delimited-identifier> <a bind variable> <<
    15:50:32 close current delete fetch lock insert open rollback
    15:50:32 savepoint set sql execute commit forall merge pipe
    15:50:32 Compilation complete - 5 error(s) found
    15:50:32 End Compiling 1 object(s)
    below is the procedure code :
    CREATE OR REPLACE
    PROCEDURE fib_dead_cnx_cleanup
    AS
    l_serial     CHAR(100);
    l_sid CHAR (100);
    l_sid_serial CHAR(100);
    l_count      NUMBER(10,0);
    CURSOR session_cur IS
              SELECT sid,serial#,sid||','||serial# as sid_serial
         FROM v$session
         WHERE username='EBBFCAT' and schemaname='TESTSCHEMA'
         and status='INACTIVE'
    BEGIN
         BEGIN
         l_count := 0;
                   OPEN session_cur;
                        WHILE ( 1 = 1) LOOP
                             BEGIN
                                  FETCH session_cur INTO l_sid ,l_serial,l_sid_serial ;
                                       EXIT WHEN session_cur%NOTFOUND ;
                                  BEGIN
                                       alter system kill session 'l_sid_serial' ;
                                  END;     
                             END;
                        END;
                   CLOSE session_cur;
         END;
    END FIB_DEAD_CNX_CLEANUP;
    Thanks

    Hi,
    Never write, let alone post, unformatted code.
    When posting any formatted text on this site, type these 6 characters:
    &#123;code&#125;
    (small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
    Among the benefits of formatting: you can indent to show the extent of blocks, such as BEGIN-END.
    Different types of blocks need modifiers after the end, such as "END *IF* " and " END *LOOP* ". If each opening statement (BEGIN, IF, LOOP) is directly above its corresponding END, then it's easy to check if you got the right modifier.
    Here's what you code looks like with some formatting, and a couple of corrections added. Look for -- comments.
    CREATE OR REPLACE
    PROCEDURE fib_dead_cnx_cleanup
    AS
         l_serial     CHAR(100);
         l_sid          CHAR (100);
         l_sid_serial     CHAR(100);
         l_count          NUMBER(10,0);
         CURSOR session_cur IS
                SELECT  sid
                ,       serial#
                ,       sid     || ','
                                      || serial#     as sid_serial
                FROM     v$session
                WHERE      username     = 'EBBFCAT'
                and     schemaname     = 'TESTSCHEMA'
                and     status          = 'INACTIVE';          -- need semicolon here
    BEGIN
         BEGIN                                   -- Why?
              l_count := 0;
              OPEN session_cur;
              WHILE ( 1 = 1)
              LOOP
                    BEGIN                         -- Why?
                         FETCH  session_cur
                         INTO   l_sid
                         ,          l_serial
                         ,          l_sid_serial ;
                               EXIT WHEN session_cur%NOTFOUND ;
                         BEGIN                    -- Why?
                             alter system kill session 'l_sid_serial' ;    -- Not a PL/SQL command
                               END;
                          END;
                END LOOP;                         -- LOOP ends with END LOOP
                CLOSE session_cur;
            END;
    END      FIB_DEAD_CNX_CLEANUP;Take baby steps.
    I've been wrtiing PL/SQL for 20 years, and I would never write that much code at once. If you're a beginner, all the more reason to start small. Write as little as possible, test, debug and test again (if necessary). When you have someting working, add 2 or 3 more lines and test again.
    It looks like you have three BEGIN statements that don't serve any purpose. You should get rid of them (and their corresponding END statements, of course).
    One error I did not fix: ALTER SYSTEM is not a PL/SQL statement. It's a SQL statement. You can run a SQL statement inside PL/SQL by using dynamic SQL, where you construct a string containing the SQL statement, and then use dbms_sql or EXECUTE IMMEDIATE to run it.
    Edited by: Frank Kulash on Aug 18, 2009 12:37 PM

  • AUTOMATICALLY KILL  INACTIVE SESSIONS

    Hi all. we are using oracle 8.1.6 on windows-2000 with 2gb ram. we facing
    ora-12500 listner failed to start a dedicated server.
    error and for this we made certain changes. we also added a parameter in sqlnet.ora at server side sqlnet.expire_time=10.. for automatically killing inactive sessions but it did not helped and many sessions remain in v$session. i wana know what should we do to kill inactive sessions. because i think when the sessions reach more than 300 then we face problem of listner failed. thanks for u'r valueable comments in advance as well.
    best wishes
    muhammad mohsin chattha

    Hi Nicolas, what you say is correct, but, unless the user try to do something (and receives an error),
    those sessions will show up as SNIPED in V$SESSION, and never go away.
    We can create a procedure to kill these sessions, something like this :  1  CREATE OR REPLACE PROCEDURE Kill_Sessions   IS
      2      Stmt           VARCHAR2(200);
      3      V_Sid          VARCHAR2(30);
      4      V_Serial       VARCHAR2(30);
      5      V_Username     VARCHAR2(30);
      6      CURSOR pri IS
      7      SELECT Sid, Serial#, Username
      8      FROM V$Session
      9      WHERE Username Is Not Null
    10      And Username not like 'SYS%'
    11      And Status = 'SNIPED';
    12  BEGIN
    13      FOR usr in pri LOOP
    14      V_Sid     := usr.Sid;
    15      V_Serial  := Usr.Serial#;
    16      Stmt      := 'ALTER SYSTEM KILL SESSION ''' || V_Sid || ',' || V_Serial || '''';
    17      Execute Immediate(Stmt);
    18      END LOOP;
    19* END;
    20  /  and execute it every minute (change 1440 to change the frequence) :SQL> Declare
      2     Out_Var Int;
      3  Begin
      4     Dbms_Job.Submit(Out_Var,
      5     'Kill_Sessions;',
      6     Sysdate,
      7     'Sysdate+1/1440' );
      8* End;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL>

  • Kill inactive sessions with no programs run it

    hi all,
    my database is 10gR2 with developer 6i
    the database have huge number of sessions with no programs running it like oracle form, some of those sessions stack in v$session table due to power failure.
    restart server solve the problem, but it is not efficient.
    is there any method to fined witch of database sessions is actually connect to the database and have application running it ?

    This script will give you the complete detail of Session , PID and Program which is running in dagtabase level.
    You can include the "STATUS" coloumn from v$session to get user status.
    Script is like this:
    set echo off;
    set termout on;
    set linesize 80;
    set pagesize 60;
    set newpage 0;
    select
    rpad(c.name||':',11)||rpad(' current logons='||
    (to_number(b.sessions_current)),20)||'cumulative logons='||
    rpad(substr(a.value,1,10),10)||'highwater mark='||
    b.sessions_highwater Information
    from
    v$sysstat a,
    v$license b,
    v$database c
    where
    a.name = 'logons cumulative'
    ttitle "dbname Database|UNIX/Oracle Sessions";
    set heading off;
    select 'Sessions on database '||substr(name,1,8) from v$database;
    set heading on;
    select
    substr(a.spid,1,9) pid,
    substr(b.sid,1,5) sid,
    substr(b.serial#,1,5) ser#,
    substr(b.machine,1,6) box,
    substr(b.username,1,10) username,
    -- b.server,
    substr(b.osuser,1,8) os_user,
    substr(b.program,1,30) program
    from v$session b, v$process a
    where
    b.paddr = a.addr
    and type='USER'
    order by spid;
    ttitle off;
    spool off;
    Save this script with your desire name and run in Database.
    Mukesh

  • Killing inactive and disconnected sessions

    hi all
    how can i kill inactive sessions from server, can someone provide me query for both selecting and killing inactive sessions.
    Thanks in advance.
    piyush

    There is no valid reason for killing a session simply because it is INACTIVE. It is plain wrong. Bad DBA'ing. Silly.. Clueless.. etc.
    The correct approach is to IDENTIFY the problem (e.g. too many dedicated server connections for the db platform to handle) and then the solution (e.g. using shared server).
    Simply identifying and killing idle sessions? That is fighting a symptom. It is not fixing a problem.

  • Inactive sessions increasing database

    Hi
    We are using oracle11.5.10.2 on windows 2000 server and database version 10.2.0.3
    we are facing problem with inactive sessions,grdually inactive sessions increasing and thats leads database crash.
    Temporary i increased processes parameter value tp 400 prviously it was 200
    Most of inactive session from apps user only
    How can i fix this problem?
    Thanks
    With Regards
    OH

    Hi,
    Please see these threads.
    how to kill inactive sessions????????
    how to kill inactive sessions????????
    Inactive sessions in Database
    Re: Inactive sessions in Database
    Regards,
    Hussein

  • About Inactive Sessions

    Hello everybody:
    I need some help, this is my situation:
    Every day when I arrive to my job I have to kill inactive session from other days, e.g Today I had to kill a lot of Inactive Session of Yesterday.
    How could I did this by other way.
    Thanks

    Hiow are you determining that the session is inactive? If you are only looking at v$session.status then be aware that you cannot determine if a session is truely INACTIVE from this column alone. You must also look at last_call_et.
    The reason is that Oracle only considers a session ACTIVE while it is processing SQL (or pl/sql) and with a dedicated session and a connect pooled front-end or a client like Forms where the user spends a lot of time filling in the screen or reviewing results then while you see an INACTIVE status in two queries of v$session 30 seconds apart while the session may have run 8 fast short SQL statements in between your viewing v$session. The last_call_et column woud reflect the activity but it is unlikely you would catch the ACTIVE status.
    HTH -- Mark D Powell --

  • 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

  • Killing all sessions at once who are locking the objects

    Hello all,
    i am working in 9i Oracle RDBMS on AIX IBM OS
    most of the time we face locking issue and there comes more then different 50 sessions which locking different tables.
    here is my script to find out what sessions are locking what tables.
    set lines 200
    set pages 50000
    col SID for 99999
    col SERIAL# for 999999
    col username format a12
    col sql format a55
    col event format a50
    col program format a40
    col MINS for 9999
    col ID1 for 999999
    col object_name for a35
    col locktype for a8;
    select  /*+ ORDERED */ s.sid,s.serial#,s.status,round(s.last_call_et/60) MINS,s.program,l.ID1,d.object_name,d.object_type,l.type as locktype
    from v$lock l,v$session s, dba_objects d
    where l.sid = s.sid
    and l.ID1 = d.object_id
    and s.username = 'MULDMS'
    and last_call_et > 120 and l.type <> 'TX' order by s.status,MINS,l.ID1,l.type; and the out put it gives something like
      SID SERIAL# STATUS    MINS PROGRAM                                      ID1 OBJECT_NAME                         OBJECT_TYPE        LOCKTY
    8981    1069 ACTIVE       2 frmweb@Appsdms31 (TNS V1-V3)               30407 VH_BTN                              TABLE              TM
    1642     512 ACTIVE      15 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
      690    1057 ACTIVE      17 [email protected] (TNS V1-V3)    28846 AM_DOCS                             TABLE              TM
      699    1787 ACTIVE      17 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
      690    1057 ACTIVE      17 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
      690    1057 ACTIVE      17 [email protected] (TNS V1-V3)    30643 VT_CHECK_INOUT                      TABLE              TM
    10877     895 ACTIVE      18 [email protected] (TNS V1-V3)     28846 AM_DOCS                             TABLE              TM
    6654    1085 ACTIVE      18 [email protected] (TNS V1-V3)    28846 AM_DOCS                             TABLE              TM
    1912    1655 ACTIVE      18 [email protected] (TNS V1-V3)    28846 AM_DOCS                             TABLE              TM
    10877     895 ACTIVE      18 [email protected] (TNS V1-V3)     30407 VH_BTN                              TABLE              TM
    6654    1085 ACTIVE      18 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
    1912    1655 ACTIVE      18 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
    1754    1582 ACTIVE      18 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
    10877     895 ACTIVE      18 [email protected] (TNS V1-V3)     30643 VT_CHECK_INOUT                      TABLE              TM
    6654    1085 ACTIVE      18 [email protected] (TNS V1-V3)    30643 VT_CHECK_INOUT                      TABLE              TM
    10708     982 ACTIVE      19 [email protected] (TNS V1-V3)    28846 AM_DOCS                             TABLE              TM
    5428     855 ACTIVE      19 [email protected] (TNS V1-V3)    28846 AM_DOCS                             TABLE              TM
    10708     982 ACTIVE      19 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
    5428     855 ACTIVE      19 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
    10278     897 ACTIVE      20 [email protected] (TNS V1-V3)     28846 AM_DOCS                             TABLE              TM
    6261    1056 ACTIVE      20 frmweb@appsdms12 (TNS V1-V3)               28846 AM_DOCS                             TABLE              TM
    6598    1413 ACTIVE      20 [email protected] (TNS V1-V3)     28846 AM_DOCS                             TABLE              TM
    1312    1000 ACTIVE      20 [email protected] (TNS V1-V3)    28846 AM_DOCS                             TABLE              TM
    10278     897 ACTIVE      20 [email protected] (TNS V1-V3)     30407 VH_BTN                              TABLE              TM
    6261    1056 ACTIVE      20 frmweb@appsdms12 (TNS V1-V3)               30407 VH_BTN                              TABLE              TM
    1312    1000 ACTIVE      20 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
    3521     717 ACTIVE      20 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
    6598    1413 ACTIVE      20 [email protected] (TNS V1-V3)     30407 VH_BTN                              TABLE              TM
    6598    1413 ACTIVE      20 [email protected] (TNS V1-V3)     30643 VT_CHECK_INOUT                     TABLE              TM
    1312    1000 ACTIVE      20 [email protected] (TNS V1-V3)    30643 VT_CHECK_INOUT                   TABLE              TM
    9131    1002 INACTIVE     2 [email protected] (TNS V1-V3)    30455 VH_PSF                              TABLE              TM
    4887    1040 INACTIVE     2 [email protected] (TNS V1-V3)     30455 VH_PSF                              TABLE              TM
      151    1982 INACTIVE     2 [email protected] (TNS V1-V3)     80224 RD_ENQEXD                           TABLE              TM
      846     988 INACTIVE     3 [email protected] (TNS V1-V3)    29228 GM_VIN                              TABLE              TM
    5364    1149 INACTIVE     3 [email protected] (TNS V1-V3)    30407 VH_BTN                              TABLE              TM
    9934     789 INACTIVE     3 [email protected] (TNS V1-V3)     30455 VH_PSF                              TABLE              TM
    7511    1092 INACTIVE     3 [email protected] (TNS V1-V3)    30455 VH_PSF                              TABLE              TM
    3595    1104 INACTIVE     3 [email protected] (TNS V1-V3)    30455 VH_PSF                              TABLE              TM
      846     988 INACTIVE     3 [email protected] (TNS V1-V3)    30455 VH_PSF                              TABLE              TM
      945     670 INACTIVE     3 [email protected] (TNS V1-V3)    30455 VH_PSF                              TABLE              TMand then i have to kill the session one by one . thaat is a tedious task to do.
    i want to modify this script which will give me all the kill statement and i just have to run it
    can someone help me in this regard as i am weak in sql/plsql
    thanks and many thanks

    >
    i want to modify this script which will give me all the kill statement and i just have to run it
    >
    Karthick's script will 'kill' the sessions but before you use that script you may want to read the docs about the KILL and DISCONNECT clauses.
    See the DISCONNECT SESSION and KILL SESSION clauses in the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_2013.htm#sthref4724
    >
    DISCONNECT SESSION Clause
    Use the DISCONNECT SESSION clause to disconnect the current session by destroying the dedicated server process (or virtual circuit if the connection was made by way of a Shared Sever).
    The IMMEDIATE setting disconnects the session and recovers the entire session state immediately, without waiting for ongoing transactions to complete.
    KILL SESSION Clause
    The KILL SESSION clause lets you mark a session as terminated, roll back ongoing transactions, release all session locks, and partially recover session resources.
    IMMEDIATE Specify IMMEDIATE to instruct Oracle Database to roll back ongoing transactions, release all session locks, recover the entire session state, and return control to you immediately.
    >
    For DISCONNECT the IMMEDIATE clause will recover the session state 'immediately'.
    Using KILL, even with the IMMEDIATE clause, you are telliing Oracle to roll back any ongoing transactions and that can take a lot of time.
    Make sure you are really doing the operation you want to do. If you want to get the locks released immediately you need to use 'DISCONNECT IMMEDIATE'.

  • Inactive sessions

    Iam in need of a script to kill all the inactive sessions in the database and the same script should kill all the pid related in the OS also.
    can anyone send me a scripts or any input on this will be of great help ?
    Kai

    KaiS,
    See both functions and wrap around in your unix script, this should magic for you I suppose :) and you should replace sqlplus "/as sysdba" by sqlplus '/as sysdba'
    *function readSqlstmt {*
    typeset stmt=$1
    echo "
    set feedback off
    set verify off
    set heading off
    set pagesize 0
    whenever sqlerror exit 1
    whenever oserror exit 2
    *$stmt;*
    exit
    *" | sqlplus -S "/as sysdba" &gt;&gt; test.log*
    function killpid {
    killpidsql=killpid.sql
    sqlplus -s "/as sysdba" << ENDOFSQL >> test.log
    whenever sqlerror exit 1
    whenever oserror exit 2
    SET pagesize 0
    SET verify off
    SET feedback off
    SPOOL ${killpidsql}
    SELECT 'ALTER system kill session ''' || s.sid || ',' || s.serial# || ''';'
    FROM v\$session s, v\$process p
    WHERE s.paddr = p.addr AND s.status = 'INACTIVE';
    SPOOL OFF
    @${killpidsql}
    ENDOFSQL
    Example: How to use above readSqlstmt function, to kill unix process id and call "killpid" to kill sessions from oracle.
    *readSqlstmt "SELECT p.spid FROM v\$session s, v\$process p WHERE s.paddr = p.addr AND s.status = 'INACTIVE'" | while read u*
    *do*
    * #echo "kill -9" $u &gt;&gt; test.log*
    * echo $u*
    *done*
    *Regards*
    Edited by: OrionNet on Dec 10, 2008 10:52 PM
    Edited by: OrionNet on Dec 10, 2008 10:54 PM

  • Clear the entry for killed/sniped session in v$session

    Dear all,
    In our production database(11.2.0.1.0) running on windows 2008 server many client session showing inactive from last 4-5 hour and I want to kill those session because all sessions are dedicated so for this I created a resource plan set its idle time after certain interval session status is showing killed but it is not removing entries from v$session but our client demand is it must be clear from v$session so for this i was using DOS command taskkill utility to kill particular os process so I want to know what is the smartest way to do this.

    This is known behavior, not an issue.
    In a dedicated server environment when the session is killed and the rollback completes the process goes away so a join between v$session and v$process will fail. The v$session entry also usually goes away rather quickly, though I have seen cases where the v$session entry hung around till the instance was bounced. But normally Oracle will overlay the v$session entry with a new session using the same sid but a different serial# within seconds on a busy system.
    Mark @ http://dbaspot.com/oracle-server/40419-killed-sessions.html
    Metalink doc id 1023442.6 is also something confirming it.
    See also below link and last reply by Mr. Braj Kishore Mahto.
    http://dbaforums.org/oracle/index.php?showtopic=3039
    Regards
    Girish Sharma
    Edited by: Girish Sharma on Nov 21, 2012 5:35 PM
    So, what is best in this regard :
    ALTER SYSTEM DISCONNECT SESSION
    The ALTER SYSTEM DISCONNECT SESSION syntax is an alternative method for killing Oracle sessions. Unlike the KILL SESSION command which asks the session to kill itself, the DISCONNECT SESSION command kills the dedicated server process (or virtual circuit when using Shared Sever), which is equivalent to killing the server process from the operating system. The basic syntax is similar to the KILL SESSION command with the addition of the POST_TRANSACTION clause. The SID and SERIAL# values of the relevant session can be substituted into one of the following statements.
    SQL> ALTER SYSTEM DISCONNECT SESSION 'sid,serial#' POST_TRANSACTION;
    SQL> ALTER SYSTEM DISCONNECT SESSION 'sid,serial#' IMMEDIATE;
    http://www.oracle-base.com/articles/misc/killing-oracle-sessions.php#disconnect_session

  • Inactive sessions in v$session.  True problem

    Hi,
    I am working in an Oracle 9i/Weblogic/J2EE platform. And when i look for session info in v$session view, i see that there are many sessions that have a status "Inactive". I already figured out what it means- the session is ACTIVE when it is doing an SQL query at the time and the session is INACTIVE when it is not doing an SQL query at that particular moment.
    But i have questions:
    1) If a client logs in to my webapplication and does a SQL query- then the sessions status is ACTIVE. After that, when the client just leaves (logs out just closes the browser) then Oracle marks that connection as 'INACTIVE'- Oracle does not KILL that session.
    Ok let that be, but can another client then log in to my webapplication (from different computer) and get that same INACTIVE connection and start to use it?? If not, then these "abandoned" connection are truly useless, because they still use ORACLE resources (memory).
    2)Another thing is that there are many INACTIVE sessions in v$session that have a name "plsqldev.exe" in PROGRAM column. That is a database client that i use to connect directly to my DB. But basicly i have only one PL/SQL program with one SQL query window open (this session is marked ACTIVE in v$session). So are these other 10 INACTIVE "plsqldev.exe" sessions meant for new plsql clients that may start to use the database or can only that particular user for whom the session was created at first place use that session?
    And finally- sessions that are INACTIVE and have "plsqldev.exe" as a PROGRAM in v$session - is there any chance that a client logs in to webapplication and then gets that INACTIVE session?
    If not, then these 10 INACTIVE plsqldev sessions (allthough the user has maybe shut down the program) are wasteless for webapplication users and they just starve the database.
    Also a screenshot for illustration.
    Waiting for your comments,
    Thanks!

    If connection pooling is in use then yes a different end-user can reuse the "inactive" session. Remember that ACTIVE and INACTIVE really only refers to if the session is executing SQL at the exact moment you query v$session.
    In the case of a dedicated user connection using a product like Oracle Forms where the user spends much of the time reading and filling in screen fields the Oracle background session can show INACTIVE almost constantly because the queries being ran by the user are very fast.
    Take a look at the last_call_et column. This is the time in seconds from when the last SQL statement was issued (not completed). If this value is resetting then the queries are being done.
    If the time is large and the status is INACTIVE then you could have a 'dead' or 'runaway' background process which is a background process without a front-end process. Those can and should be terminated. For that matter sessions that are idle for long periods of time should probably also be killed. If nothing else runaway and idle sessions may make it appear you are using all your licensed connections even if you really are not.
    Most connection pools wil automatically restart a terminated connection so if you clean-up process terminates an idle pooled connection it should not be a problem.
    HTH -- Mark D Powell --

  • Inactive sessions while using Iplanet server

    Hi all,
    I am facing a strange problem. On application level we use 'apps' user to login in oracle. It was working fine earlier. But now a days when we login thru it the performance becomes slow,when I checked the sessions, it shows me 250 inactive sessions.The max limit of sessions is 400.
    Then I have to manually kill the inactive sessions and application starts working fine . Any idea about this problem?
    Oracle version is 10g version 2
    Thanx and regards

    I am not very sure but there must be some property from which you can kill the inactive session which has taken more time.
    Cheers

  • HIgh Inactive sessions

    Hi,
    We are facing a problem of lot of inactive sessions consuming huge resources. We have setup connection pooling from weblogic application and connection timout and resuse parameters have been setup from application side for connection pooling. And we still find high inactive sessions which are not getting released even after application user closes the session properly. What might be the work around for this as we facing this for last one week.
    Oracle 10.2.0.3.0 on solaris box.
    regards
    Jaffy

    Jaffy wrote:
    Hi,
    We are facing a problem of lot of inactive sessions consuming huge resources. We have setup connection pooling from weblogic application and connection timout and resuse parameters have been setup from application side for connection pooling. And we still find high inactive sessions which are not getting released even after application user closes the session properly. What might be the work around for this as we facing this for last one week.
    Oracle 10.2.0.3.0 on solaris box.
    regards
    JaffyHi Jaffy,i suggest you have to configure profile for oracle users.For example if you user will inactive 10 minute then can oracle automatically kill this session.For this you can create profile as:
    create profile test_prof limit idle_time 10;
    alter user <user> profile test_prof;
    /*but first you need change resource limit*/
    alter system set resource_limit=true;

  • Inactive sessions  accumulate exceed the max session

    Hi All,
    once i checked the v$session, always find lots of inactive session.nearly after two month it will exceed the max session value in the init.ora profile.
    I have check the sqlnet.ora profile and the value of expire_time is 10 minuter, while not sure why so many inactive session? and if i need to kill all inactive session?
    Best Regards,
    Chelsea

    INACTIVE users are users not actively running a query, but they are connected to the database.
    If SQL expire time is set, you can verify the logfiles, if users get disconnected because of idle connections.
    For the remainder I agree with the other post.
    Cheers
    FJFranken

Maybe you are looking for

  • Video switching from interlace to progressive on render

    We have a video 29.97 1920x1080i which we are running dynamic linked through after effects, and when we render the video out in premiere it is switching from interlace to progressive. When the video, in the dynamic link is left un-rendered, we can se

  • Saving Location @ Adobe Acrobat XI Pro

    If you open a document with Adobe Acrobat X Pro and sign it, than the Software wants to save the document on the same place, like you opened it. In Adobe Acrobat XI Pro the software wants to save it on an other place. Do anybody know this issue and i

  • Archiving Original Media Files

    This question crops up occasionally. The usual suggestion with tapes is to keep them. This is fine except for one potential problem ....... you need the camera to play them! If you only have one camera, it is reasonable to suppose it will eventually

  • Is there a way to set new tabs to open on a certain page (ie. google)

    I would like new blank tabs to open on a search engine or other url, is there a way to make it so "new tab" opens a tab that isn't blank? I'm using Firefox 3.6.13 on a Macbook Pro thanks!

  • Treasury & Risk management related

    Hi all, I would like to know , when we create any Treasury deal  for example fixed term deposit ( t-code- TM01),  does any FI document gets created for this deal?  If yes than how can we find that out and how to display than document? Thanx & Regard,