Operating System - HP-UX
1827445 Members
6286 Online
109965 Solutions
New Discussion

Re: how to count processes ?

 
SOLVED
Go to solution
Randy Hagedorn
Regular Advisor

how to count processes ?

Hi,

I would like to be able to count the number of oracle processes that are running on our HP-UX system at any given time.

Does anyone have any ideas how to do this?

Thanks,
Randy
6 REPLIES 6
Geoff Wild
Honored Contributor
Solution

Re: how to count processes ?

ps -ef |grep oracle |wc

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Pete Randall
Outstanding Contributor

Re: how to count processes ?

I'd use "wc -l" rather than wc.


Pete

Pete
Raj D.
Honored Contributor

Re: how to count processes ?

Hi Randy ,

You can try with this , to count the oracle processes,

# ps -ef | grep ora | sed -n '$='


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
DCE
Honored Contributor

Re: how to count processes ?

Hello Randy,,

Use ps -ef, and grep for the string you want to count., and pipe the result into wc -l

The most generic for oracle being
ps -ef | grep ora | wc -l

if you want to count specific database processess, substitute the name you are looking for in place of "ora"

Dave
Bill Hassell
Honored Contributor

Re: how to count processes ?

You can eliminate the grep by letting ps find your processes:

ps - -u oracle

This will report all processes that are being run by the user oracle.


Bill Hassell, sysadmin
Randy Hagedorn
Regular Advisor

Re: how to count processes ?

I tried each suggestion and they all worked well.

Thanks again.

Randy