Home » RDBMS Server » Server Administration » geting the sql for the PID
geting the sql for the PID [message #61120] Tue, 30 March 2004 08:17 Go to next message
saj
Messages: 8
Registered: January 1999
Junior Member
Hi

Using the top command i got the cpu% of a process.

 pID USERNAME THR PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND

 20469 oracle     1  59  -20  322M  298M sleep    0:29 11.90% oracle

How can i get the correspondig procedure from this PID? Is it the process of v$session?

Thanks

 
Re: geting the sql for the PID [message #61121 is a reply to message #61120] Tue, 30 March 2004 10:31 Go to previous messageGo to next message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
No,thats the SPID from v$process. Try this


Select s.sql_text,s.executions,s.buffer_gets,s.cpu_time,s.disk_reads,s.parse_calls,s.rows_processed,s.FIRST_LOAD_TIME 
from v$sql s,v$session vs,v$process p
where p.addr=vs.paddr and p.spid='&pid' and vs.sql_address=s.address and vs.sql_hash_value=s.hash_value;



-Thiru
Re: geting the sql for the PID [message #61123 is a reply to message #61121] Tue, 30 March 2004 10:45 Go to previous messageGo to next message
saj
Messages: 8
Registered: January 1999
Junior Member
Thiru
What is the difference in spid and pid of v$process?
Re: geting the sql for the PID [message #61124 is a reply to message #61123] Tue, 30 March 2004 11:20 Go to previous message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
PID= Oracle Process Id
SPID = Server(ie OS) Process ID.

-Thiru
Previous Topic: ORA-00405: compatibility type "LOB Retention"
Next Topic: How to change password of the users SYSTEM and SYS ?
Goto Forum:
  


Current Time: Fri Sep 20 12:46:46 CDT 2024