Kill Inactive Session
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Kill Inactive Session

  1. #1
    Join Date
    Jan 2003
    Location
    Cašador (SC) - Brazil
    Posts
    56

    Kill Inactive Session

    Hello everybody!!

    How can I kill a session if it is inactive for more than one our, for instance??
    My server needs more memory (Is there one that didn't??) and I have some users that turn on their machines at 8:00 a.m., access our DB, leave it and goes to another location, turn back at 5 p.m. and then, uses our corporative system for a few minutes, then go home!!!

    Can yu help me??

    Really thanks!!
    Adilsom JosÚ Musskopf
    Live like each of your days was the last.

  2. #2
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    create profile and grant profile to users.

    RTFM
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  3. #3
    Join Date
    Jan 2003
    Location
    Cašador (SC) - Brazil
    Posts
    56
    My sincere thanks, adewri!

    Peace to you!!
    Adilsom JosÚ Musskopf
    Live like each of your days was the last.

  4. #4
    Join Date
    Jan 2003
    Location
    Cašador (SC) - Brazil
    Posts
    56
    One more question:

    Can I send to user a message advising him that is going to be disconnected, and the reason why?
    Adilsom JosÚ Musskopf
    Live like each of your days was the last.

  5. #5
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    on sqlplus no...
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  6. #6
    Join Date
    Jan 2001
    Posts
    3,131
    Originally posted by Adilsom Musskop
    One more question:

    Can I send to user a message advising him that is going to be disconnected, and the reason why?
    You said the infamous 4 letter word!!
    I will have mercy on you if you were absent and missed yesterdays lesson regarding the dreaded 4 letter word people.
    http://www.dbasupport.com/forums/sho...threadid=33619

    THEY ARE NOT WORTHY, KILL THEM!!

    With Love, Peace, and general appreciation of mankind.

    MH
    I remember when this place was cool.

  7. #7
    Join Date
    Feb 2003
    Posts
    40
    Hello,

    If you are using UNIX,you can set a cron job to run at every one hour
    to check which are the user sessions that are
    inactive for more than 1 hour and kill those sessions.

    The sql to be executed is given below
    *********************************************
    spool killsess.sql

    select 'alter system kill session '||''''||sid||','||serial#||''''||';' from v$session where username is not null and status='INACTIVE'
    and sysdate-logon_time
    > .041666667 ;

    spool off

    @killsess.sql
    *********************************************

    If you are using UNIX ,You can send mails to the users for
    intimating them before killing it.
    Shell scripts would make it possible.



    Regards
    Chithra
    K.Chithra
    Oracle DBA

  8. #8
    Join Date
    Feb 2003
    Posts
    40
    Hello,
    In my previous reply,I have given the sql .
    That would help to identify the users who are connected to
    database before an hr and at present they are inactive.

    It will not assure if the session were inactive(idle) through out
    for more than an hour.
    K.Chithra
    Oracle DBA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width