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

Thread: O/S Process

  1. #1
    Join Date
    Jan 2004
    Posts
    30

    O/S Process

    How can I get the SID from an O/S process on UNIX??

    E.g my O/S pid id is 1234, how can I find out the sid???

    Thanks in advance

  2. #2
    Join Date
    Sep 2003
    Location
    over the hill and through the woods
    Posts
    995
    just bring up OEM's dbastudio. problem solved.
    And don't say you don't have OEM if you have the Oracle Product you have OEM go find it
    Oracle it's not just a database it's a lifestyle!
    --------------
    BTW....You need to get a girlfriend who's last name isn't .jpg

  3. #3
    Join Date
    Jan 2004
    Posts
    30
    Thank you for reply. What are the way to find it without OEM??
    No good sometime if too rely on OEM

  4. #4
    Join Date
    Feb 2003
    Location
    London
    Posts
    170
    You will need to connect to a database for that. You can query the v$session table.

  5. #5
    Join Date
    Jan 2004
    Posts
    30
    Thomasp,
    Could u be more specific how i could use the OS process ID to get the oracle session id from v$session???

    thanx

  6. #6
    Join Date
    Oct 2004
    Posts
    8
    If u are in oracle then
    select sid,serial#,osuser,username,status
    from v$session;or goto .profile u can see oracle sid in unix.in unix

    u get your sid by ps -ef |grep login_id , Just check the syntax.

    I hope it will solve your problem.
    Last edited by jaya111; 11-18-2004 at 11:11 PM.

  7. #7
    Join Date
    Jan 2004
    Posts
    30
    If OS user => oracle

    what is the OS "login_id" related on this?? What happen if there is a lot of oracle user connection in the database?? so from the v$session you can see a lot of osuser & we are not able to identified from v$session..

  8. #8
    Join Date
    Apr 2001
    Location
    Bangalore, India
    Posts
    727
    Code:
    $ ps -ef |grep $ORACLE_SID
    dbadmin 1441896 1060872   0 10:19:33      -  0:00 oracledbatest9 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) 
    
    $ sqlplus /
    
    SQL*Plus: Release 9.2.0.4.0 - Production on Fri Nov 19 10:21:31 2004
    
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    
    
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.2.0.4.0 - Production
    
    SQL> set linesize 132
    SQL> select s.username,s.osuser,s.sid,s.serial#, p.spid UNIX_PID
         from v$session s, v$process p
         where p.addr = s.paddr and
         p.spid = &pid ;
    
    Enter value for pid: 1441896
    old   4: p.spid = &pid
    new   4: p.spid = 1441896
    
    USERNAME                       OSUSER                                SID    SERIAL# UNIX_PID
    ------------------------------ ------------------------------ ---------- ---------- ------------
    OPS$DBADMIN                    dbadmin                                10       3106 1441896
    Thomas Saviour(royxavier@yahoo.com)
    Technical Lead (Databases)
    Thomson Reuters (Markets)

    http://ora600tom.wordpress.com/

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