Home » SQL & PL/SQL » SQL & PL/SQL » How to get all the running process in oracle
How to get all the running process in oracle [message #437431] Mon, 04 January 2010 07:01 Go to next message
rumarani
Messages: 13
Registered: September 2009
Location: Bangalore
Junior Member
Hi,

I have formulated this query which is used to display all the running process as below.

SELECT s.SID, s.STATUS, s.process, s.osuser, a.sql_text, p.program
FROM v$session s, v$sqlarea a, v$process p WHERE s.PREV_HASH_VALUE = a.hash_value
AND s.PREV_SQL_ADDR = a.address AND s.paddr = p.addr AND s.STATUS = 'ACTIVE'

Please let me know if this is correct.
Re: How to get all the running process in oracle [message #437436 is a reply to message #437431] Mon, 04 January 2010 07:16 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
I generally use Tom Kyte's show_sql script found here.
Re: How to get all the running process in oracle [message #437442 is a reply to message #437431] Mon, 04 January 2010 07:30 Go to previous messageGo to next message
rumarani
Messages: 13
Registered: September 2009
Location: Bangalore
Junior Member
Hi Rainy,

Thanks for your quick reply.But what i need is an sql to get
all the running process,Because i need to pass the same sql in
a perl file and can't write the procs inside a perl file.
If you can help me in getting the sql or can i use the same sql.

Thanks,
Re: How to get all the running process in oracle [message #437449 is a reply to message #437431] Mon, 04 January 2010 08:08 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Please let me know if this is correct.

No as it is not formatted.
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.

If you want "to display all the running process" as you said then just query v$process.

Now you have to explicitly define what is a "running" process for you and what information you want then we can say if your query returns what you want.

Regards
Michel
Re: How to get all the running process in oracle [message #437458 is a reply to message #437442] Mon, 04 January 2010 09:03 Go to previous message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Quote:

and can't write the procs inside a perl file.


Yes you can.

Previous Topic: cursor
Next Topic: I have a packaged procedure
Goto Forum:
  


Current Time: Fri Feb 07 19:09:03 CST 2025