Active vs Inactive sessions

We are using Oracle 11 as a backend to PowerSchool (a student information system) with 6 application servers (dc-ps-01 thru -06). Using the following SQL, we are seeing numerous INACTIVE sessions vs ACTIVE.
select
count(b.machine) as mCount,
b.machine box,
b.status,
b.osuser os_user,
b.program program
from
v$session b, v$process a
where
b.paddr = a.addr and type='USER'
group by
b.machine,b.osuser,b.program,b.status
order by
b.status, mCount desc, box;
Sample output:
MCOUNT Box Status OS_USER Program
*2     DC-PS-01*     ACTIVE     powerschool     JDBC Thin Client
1     DC-PS-DB1     ACTIVE     DC-PS-DB1$     OMS
1     DC-PS-DB1     ACTIVE     SYSTEM     ORACLE.EXE (J001)
1     DC-PS-DB1     ACTIVE     SYSTEM     ORACLE.EXE (J000)
406     DC-PS-05     INACTIVE     powerschool     JDBC Thin Client
*44     DC-PS-01*     INACTIVE     powerschool     JDBC Thin Client
36     DC-PS-03     INACTIVE     powerschool     JDBC Thin Client
32     DC-PS-04     INACTIVE     powerschool     JDBC Thin Client
28     DC-PS-02     INACTIVE     powerschool     JDBC Thin Client
17     DC-PS-06     INACTIVE     powerschool     JDBC Thin Client
7     DC-PS-DB1     INACTIVE     DC-PS-DB1$     OMS
While the number of ACTIVE sessions fluctuate, the number of INACTIVE ones do not decrease. Would someone explain the internal working of this?
Thanks!

Note that the status column of v$session only shows ACTIVE while the Oracle session background process is busy performing a SQL statement on behalf of the front-end session. If the application spends most of its time with the user entering data onto or reading results off a screen then the session is going to appear INACTIVE most of the time in Oracle.
Also check the last_call_et to see how long it has been since the session issued a request to Oracle. This is how to tell if the session is truely INACTIVE.
If the front-end application uses connection pooling then depending on how many connections the application is set to grab and what kind of connection pool session management the front-end product provides you can have a lot of basically unneeded and truely inactive sessions.
HTH -- Mark D Powell --

Similar Messages

  • [SOLVED]What is the meaning of any/active/inactive session in polkit?

    Wiki said  「inactive sessions are generally remote sessions (SSH, VNC, etc.) 」.
    So I changed the *.policy file like below to execute the action without password  only when I am logging in remotely.
    (Just for clarifying the difference between any/active/inactive session.)
    <allow_any>no</allow_any>
    <allow_inactive>yes</allow_inactive>
    <allow_active>no</allow_active>
    Contrary to expectations, I couldn't execute the action remotely without password.
    So I changed again like below.
    <allow_any>yes</allow_any>
    <allow_inactive>no</allow_inactive>
    <allow_active>no</allow_active>
    This time, I was able to execute the action remotely without password.
    From the above, I think the remote session is neither active nor inactive.
    Is it true? If so, what is the inactive session?
    What is the definition of active/inactive?
    Last edited by remingtontonpon (2014-08-04 06:16:52)

    'man polkit' explains that 'allow_inactive' and 'allow_active' are for sessions on local consoles.
    Only 'allow_any' applies to any client local or remote.
    This seems confirmed by what you observe on your machine.

  • Active/Inactive sessions

    Within AMserver console --> Sessions, I can view a list of active/inactive sessions. Is there a configuration that will remove all sessions that are inactive? The list does not clear invalid sessions automatically.

    I have the same problem! Is there any solution ?

  • Inactive sessions in v$session

    Hi,
    why there are so many apps user inactive sessions in v$session?
    Regards

    Hi Hussein,
    The process which are arctive are shown as inactive in v$session view,We cannot trust the status column of this view,By default as soon the apps is started the oracle is creating around 82 to 85 apps processes which are inactive but i think they are active.
    The option referenced above is a good one to follow in this situation
    A discussion of Dead Connection Detection, Resource Limits, V$SESSION, V$PROCESS and OS processes
    Thanks Hussein and Anchorage
    Regards

  • 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 --

  • Timing out inactive sessions

    Is there a way to set inactive sessions to timeout after a certain period of time?

    You may consider to use SQLNET.EXPIRE_TIME
    REFERENCE: http://download.oracle.com/docs/cd/B12037_01/network.101/b10776/sqlnet.htm
    ============================================================
    SQLNET.EXPIRE_TIME
    Purpose
    Use parameter SQLNET.EXPIRE_TIME to specify a the time interval, in minutes, to send a probe to verify that client/server connections are active. Setting a value greater than 0 ensures that connections are not left open indefinitely, due to an abnormal client termination. If the probe finds a terminated connection, or a connection that is no longer in use, it returns an error, causing the server process to exit. This parameter is primarily intended for the database server, which typically handles multiple connections at any one time.
    Limitations on using this terminated connection detection feature are:
    * It is not allowed on bequeathed connections.
    * Though very small, a probe packet generates additional traffic that may downgrade network performance.
    * Depending on which operating system is in use, the server may need to perform additional processing to distinguish the
    connection probing event from other events that occur. This can also result in degraded network performance.
    Default 0
    Minimum Value 0
    Recommended Value 10
    Example
    SQLNET.EXPIRE_TIME=10

  • Inactive sessions in Database

    Hi,
    Lot inactive sessions are in database, Before we bounce database ----> max process got reached, For that we have changed max process and bounced the database but i can see still 75 inactive sessions in database,
    SQL> show parameter process
    NAME TYPE VALUE
    aq_tm_processes integer 1
    db_writer_processes integer 1
    gcs_server_processes integer 0
    job_queue_processes integer 2
    log_archive_max_processes integer 2
    processes integer 200
    SQL> show parameter spfile
    NAME TYPE VALUE
    spfile string
    Then i changed processes to 300
    SQL> show parameter process
    NAME TYPE VALUE
    aq_tm_processes integer 1
    db_writer_processes integer 1
    gcs_server_processes integer 0
    job_queue_processes integer 2
    log_archive_max_processes integer 2
    processes integer 300
    even after bouncing still 75 inactive sessions in database

    Hi,
    What are the events/programs of those sessions?
    Have you started the application or not yet?
    Go through the following documents and see if it helps.
    Note: 427759.1 - How To Prevent Inactive JDBC Connections In Oracle Applications
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=427759.1
    Note: 261791.1 - 11i JDBC Thin client connections remain active, MAX PROCESSES REACHED
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=261791.1
    Regards,
    Hussein

  • Inactive sessions increasing over time

    But, the number of open connectios(ie.,other than SYSTEM active session,
    i could see only inactive sessions ) is not staying constant.
    Rather,it grows over time.
    [NOTE:
    I dont know why the application user sessions are always in inactive state.
    If they didn't use that session at all (or) if the session is not doing any operation means , why unnecssarily the have to open these many inactive sessions.]
    Can you please give me a solution to overcome the application's connection leak?

    This appears to be a duplicate of the post I replied to in When we go for shared Server environment?
    Justin

  • SOAINFRA inactive sessions

    Hi,
    When i query the v$session table i can see that there are some 300 odd inactive sessions in the DB for the SOA-INFRA schema. When i bring the manged servers down all the inactive sessions disappear. I have aborted all the running instances but the inactive session count still doesn't come down.
    Please share your views on this.

    Hi,
    What are the events/programs of those sessions?
    Have you started the application or not yet?
    Go through the following documents and see if it helps.
    Note: 427759.1 - How To Prevent Inactive JDBC Connections In Oracle Applications
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=427759.1
    Note: 261791.1 - 11i JDBC Thin client connections remain active, MAX PROCESSES REACHED
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=261791.1
    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 --

  • 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

  • Growing Number of Inactive Sessions

    When using WebDB application with 1.)Oracle Application Server 4.8.1 or 2.)Oracle 9i Application Server (Authentication Mode Basic) I noticed many sessions with status inactive in database.
    What is the methodology to logout the session from application and avoid growing number of inactive sessions?
    null

    -- Submits a dbms_job to cleanup sessions
    -- Expected Parameters:
    -- 1. hours_old - number of hours after session start before
    -- it should be deleted
    -- 2. start_time - when should the first job be run or 'START'
    -- 3. start_time_fmt - date format for start time
    -- 4. interval_hours - how many hours between each run
    -- If 'START' is provided for 2nd parameter, the 3rd parameter is
    -- ignored and it will default the start time to the current time.
    set serverout on
    set verify off
    create or replace package wwctx_patch is
    procedure cleanup_sessions
    p_hours_old IN number default 168 -- (1 week)
    end wwctx_patch;
    show errors package wwctx_patch;
    create or replace package body wwctx_patch as
    * cleanup expired sessions
    procedure cleanup_sessions
    p_hours_old IN number default 168 -- (1 week)
    is
    cursor expired_sessions is
    select rowid
    from wwctx_sso_session$
    where active = 0
    or (session_start_time < sysdate - (p_hours_old/24));
    current_session expired_sessions%rowtype;
    record_count number := 0;
    begin
    if p_hours_old is null then
    return;
    else
    open expired_sessions;
    loop
    fetch expired_sessions into current_session;
    exit when expired_sessions%notfound;
    record_count := record_count + 1;
    delete from wwctx_sso_session$
    where rowid = current_session.rowid;
    -- Note: The reason for doing this deletion in
    -- a loop with a commit in the loop is so as not
    -- to overrun the rollback segment in the case
    -- where there are a lot of sessions to cleanup
    -- with potentially a large amount of session
    -- storage to be deleted.
    -- do more than one per commit
    if record_count >= 10 then
    commit;
    record_count := 0;
    end if;
    end loop;
    close expired_sessions;
    commit;
    end if;
    exception
    when others then
    rollback;
    end;
    end wwctx_patch;
    show errors package body wwctx_patch
    declare
    INVALID_DATE_EXCEPTION exception;
    INVALID_AGE_EXCEPTION exception;
    INVALID_INTERVAL_EXCEPTION exception;
    v_jobid binary_integer;
    v_path varchar2(100) := 'oracle.portal.session';
    v_name varchar2(100) := 'cleanup_jobid';
    v_starttime date;
    v_hours_old number;
    v_interval_hours number;
    p_hours_old varchar2(30) := '&1';
    p_start_time varchar2(60) := '&2';
    p_start_time_fmt varchar2(60) := '&3';
    p_interval_hours varchar2(60) := '&4';
    begin
    -- validate hours_old parameter
    begin
    v_hours_old := to_number (p_hours_old);
    exception
    when others then
    raise INVALID_AGE_EXCEPTION;
    end;
    -- validate starttime
    begin
    if upper(p_start_time) = 'START' then
    v_starttime := sysdate;
    else
    v_starttime := to_date (p_start_time, p_start_time_fmt);
    end if;
    exception
    when others then
    raise INVALID_DATE_EXCEPTION;
    end;
    -- validate interval_hours parameter
    begin
    v_interval_hours := to_number (p_interval_hours);
    exception
    when others then
    raise INVALID_INTERVAL_EXCEPTION;
    end;
    -- Create a preference store item for the job id that is
    -- created for the submitted job.
    -- This will allow it to be deleted or modified later.
    begin
    WWPRE_API_NAME.CREATE_PATH(v_path);
    commit;
    dbms_output.put_line ('Created path for job id.');
    exception
    when WWPRE_API_NAME.DUPLICATE_PATH_EXCEPTION then
    -- probably this has already been created and a job
    -- is already in place.
    -- retrieve the job id
    null;
    when WWPRE_API_NAME.GENERAL_PREFERENCE_EXCEPTION then
    dbms_output.put_line
    ('ERROR: Exception in preference path creation');
    raise;
    when others then
    dbms_output.put_line('ERROR: creating path - ' &#0124; &#0124; sqlerrm );
    raise;
    end;
    begin
    v_jobid := WWPRE_API_VALUE.GET_VALUE_AS_NUMBER
    p_path => v_path
    ,p_name => v_name
    ,p_level_type => WWPRE_API_VALUE.SYSTEM_LEVEL_TYPE
    dbms_output.put_line ('DBMS_JOB id = ' &#0124; &#0124; v_jobid );
    exception
    when WWPRE_API_NAME.NAME_NOT_FOUND_EXCEPTION then
    -- we'll try to create it below.
    null;
    end;
    if v_jobid is null then
    begin
    WWPRE_API_NAME.CREATE_NAME
    p_path => v_path,
    p_name => v_name,
    p_description => 'The job id of the DBMS_JOB for cleaning up '&#0124; &#0124;
    'the expired session rows.',
    p_type_name => 'NUMBER',
    p_language => WWNLS_API.AMERICAN
    commit;
    exception
    when WWPRE_API_NAME.DUPLICATE_NAME_EXCEPTION then
    null;
    when OTHERS then
    dbms_output.put_line('ERROR: creating name - ' &#0124; &#0124; sqlerrm );
    raise;
    end;
    end if;
    declare
    l_job varchar2(4000);
    begin
    l_job :=
    'begin ' &#0124; &#0124;
    ' execute immediate ' &#0124; &#0124;
    ' ''begin wwctx_patch.cleanup_sessions(' &#0124; &#0124;
    ' p_hours_old => ' &#0124; &#0124; v_hours_old &#0124; &#0124;
    ' ); end;'' ' &#0124; &#0124;
    ' ; ' &#0124; &#0124;
    'exception ' &#0124; &#0124;
    ' when others then ' &#0124; &#0124;
    ' null; ' &#0124; &#0124;
    'end;';
    if v_jobid is null then
    DBMS_JOB.SUBMIT
    job => v_jobid,
    what => l_job,
    next_date => v_starttime,
    interval => 'SYSDATE + ' &#0124; &#0124; v_interval_hours &#0124; &#0124; '/24'
    WWPRE_API_VALUE.SET_VALUE_AS_NUMBER
    p_path => v_path,
    p_name => v_name,
    p_level_type => WWPRE_API_VALUE.SYSTEM_LEVEL_TYPE,
    p_level_name => null,
    p_value => v_jobid
    commit;
    DBMS_OUTPUT.PUT_LINE ('Cleanup job submitted.' &#0124; &#0124;
    ' Job ID = ' &#0124; &#0124; v_jobid);
    else
    -- v_jobid is not null
    -- modify the job
    DBMS_JOB.CHANGE
    job => v_jobid,
    what => l_job,
    next_date => v_starttime,
    interval => 'SYSDATE + ' &#0124; &#0124; v_interval_hours &#0124; &#0124; '/24'
    commit;
    DBMS_OUTPUT.PUT_LINE ('Cleanup job updated.' &#0124; &#0124;
    ' Job ID = ' &#0124; &#0124; v_jobid);
    end if;
    if p_start_time_fmt = 'NOW' then
    DBMS_JOB.RUN
    job => v_jobid
    commit;
    DBMS_OUTPUT.PUT_LINE ('Cleanup job run.');
    end if;
    end;
    exception
    when INVALID_DATE_EXCEPTION then
    rollback;
    DBMS_OUTPUT.PUT_LINE ('ERROR: Start Date Specified is Invalid');
    when INVALID_AGE_EXCEPTION then
    rollback;
    DBMS_OUTPUT.PUT_LINE ('ERROR: Age For Cleanup Specified is Invalid');
    when INVALID_INTERVAL_EXCEPTION then
    rollback;
    DBMS_OUTPUT.PUT_LINE ('ERROR: Job Interval Specified is Invalid');
    when OTHERS then
    rollback;
    DBMS_OUTPUT.PUT_LINE ('ERROR: ' &#0124; &#0124; sqlerrm );
    end;
    set verify on

  • What is diff b/w active and inactive DCs

    hi
    please let me know what is diff between Active and Inactive DC's.
    If possible send some FAQs on JDI
    Thanks
    -mmukesh

    Hi Mukesh,
    When you are developing somthing through JDI (NWDI), you will have inactive dc and active dc.
    If you want to do some changes in code then you can do these changes through inactive dcs. Whatever changes you do in inactive DCs and until you check-in that activity. other developers cannot have those changes.
    but, when you check-in your activity those changes will be visible to other developers who are working on the same DC but this updated code will not be reflected in active DC.
    But when you activate that activity, those changes will be reflected in active dc and this active dc will be deployed on Development server.
    In summary, inactive DCs contain intermidiate code which is not ready to deploy on Development server yet. This updated code is available in Active DC.
    Hope now you are clear with Inactive and Active DCs.
    Regards,
    Bhavik

  • 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

  • Dynamic File Adapter status -  Active or Inactive

    Hi Experts
    Is there any way  to set the Sender/ Receiver File adapter status dynamically to inactive or active.
    Is there any setting exists in the file adapters ? Please provide me possible solutions.
    Thanks
    Faheem

    Hi all,
    Many thnz for the response.
    There is one more way of doing this as well. Just now i found that.
    In the runtime workbench - Communication channel monitoring , Select the automatic control for the comminucation channel to make active or inactive .
    there are options for our comm channel to run specfic date and time.
    Thnz
    Faheem

Maybe you are looking for