processes running
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > processes running




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    processes running  
Demetris


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-22-04 12:49 PM

Hello there!

I have the following command

ps -fu oracle | grep -v grep | grep ora_pmon_RCAT

which gives me the following result:

oracle  78608      1   0 15:22:04      -  0:00 ora_pmon_RCATPROD
oracle  93424      1   0 10:09:22      -  0:00 ora_pmon_RCAT

I want a command to give only the last process i.e
oracle  93424      1   0 10:09:22      -  0:00 ora_pmon_RCAT

I am trying to see if an Oracle database is running and I have two
databases with the name RCAT and RCATPROD.

If i give that ps command based on the ORACLE SID i get both processes
but i want only for example the RCAT process to
be displayed.

Any help will be appreciated.

Thanks





[ Post a follow-up to this message ]



    Re: processes running  
Stephane CHAZELAS


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-22-04 12:49 PM

2004-10-22, 05:29(-07), Demetris:
[...]
> ps -fu oracle | grep -v grep | grep ora_pmon_RCAT
>
> which gives me the following result:
>
>  oracle  78608      1   0 15:22:04      -  0:00 ora_pmon_RCATPROD
>  oracle  93424      1   0 10:09:22      -  0:00 ora_pmon_RCAT
>
> I want a command to give only the last process i.e
>  oracle  93424      1   0 10:09:22      -  0:00 ora_pmon_RCAT
[...]

if ps -u oracle -o comm= | grep -qx ora_pmon_RCAT; then
echo "There's a least 1 ora_pmon_RCAT"
else
echo "no ora_pmon_RCAT seems to be running"
fi

Depending on your system, you may also use pgrep, killall -s, ps
-C or pidof...

(if your grep doesn't have the -x or -q option, then change it
to grep -l '^ora_pmon_RCAT$' > /dev/null)

(if your ps doesn't have -o, then change it to:
ps -fu oracle | awk '$NF == "ora_pmon_RCAT" {n=1; exit}
END{exit(1-n)}'

(none tested).

--
Stephane





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:45 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register