OS process id, v$session and v$process
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: OS process id, v$session and v$process

Hybrid View

  1. #1
    Join Date
    Apr 2001
    Posts
    257

    OS process id, v$session and v$process

    Hi,

    Pardon me if it's a simple question:

    Environment: Oracle 8i on solaris 8

    I notice a process is taking alot of CPU resources. By doing the "prstat" command at OS level, I've got its process id but would like to find out who it belongs to, from which it connects from and what action is it doing. I looked up v$process and found the process_id in "spid" column but v$process does not provide enough info. When I looked up v$session, I don't see which column is linked to v$process's column so I can join them together to find out more info.

    How do people usually find the information with only OS process id is known?

    Thanks,
    Last edited by a128; 11-12-2002 at 09:49 PM.

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,095
    Code:
    SELECT s.username, s.terminal, s.program
    FROM v$session s, v$process p
    WHERE s.paddr = p.addr
    AND s.process = your_unix_process_id
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Apr 2002
    Posts
    291
    Even this may help too,

    SELECT a.sid , a.username, s.sql_text
    FROM v$session a , v$sqltext s
    WHERE a.sql_address = s.address
    AND a.sql_hash_value = s.hash_value
    AND sid= (SPID at OS level)
    ORDER BY a.username, a.sid, s.piece

    Thanks
    PNRDBA

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by pnrdba
    ...
    AND sid= (SPID at OS level)
    ...
    This certainly is not the correct joining condition..... SPID at OS level (the id of the process) is not the same thing as SID in V$SESSION (the id of the session).
    Last edited by jmodic; 11-13-2002 at 02:36 PM.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

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