Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    61

    Unanswered: kill section from sql plus

    Hi all,

    I have a problem that my application connect to Oracle server through ODBC.
    When my application is ended but there is still a session in Oracle.
    the issue come up when multiple user use application to connect to Oracle server. Many sessions still retain in Oracle.

    What is problem? What should I do?
    How do I kill sessions from sqlplus?

    Thanks in advanced,
    Thi Nguyen

  2. #2
    Join Date
    Oct 2004
    Posts
    145
    I can not help you with the what is causing this.

    to check the connection
    select username, sid, serial#, status from v$session;
    To kill
    alter system kill session 'sid, serial#';

    However if kill may not clean up the process spawned on OS level. In unix, you may need to find the process and kill the process spawned via sqlnet.

  3. #3
    Join Date
    Jul 2004
    Posts
    102
    Quote Originally Posted by JimYoo
    However if kill may not clean up the process spawned on OS level. In unix, you may need to find the process and kill the process spawned via sqlnet.
    How i do that ?
    Working Together...

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    query to map the user session to the process id in Unix:
    PHP Code:
    col module format a25
    col osuser format a20
    col session_info format a12
    col username format a15
    col terminal format a18
    set lines 300

    select 
    '('||a.sid||','||a.serial#||')' session_info, 
       
    spid unix_process
       
    a.username
       
    a.module
       
    a.osuser
       
    a.terminal
    from v$session a 
    v$process b
    where a
    .paddr b.addr
    and a.username is not null
    run as-is or just add the appropriate USERNAME to the script.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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