0

When i issue a "ps -ef|grep pmon", I get the below output.


oracle   230330      1  0 Jan08 ?        00:01:14 asm_pmon_+ASM1      
oracle   244018      1  0 Jan08 ?        00:00:59 ora_pmon_vbsenopd     
oracle   244020      1  0 Jan08 ?        00:01:01 ora_pmon_vbdrazpd      
oracle   244021      1  0 Jan08 ?        00:01:00 ora_pmon_vbrmant      
oracle   244042      1  0 Jan08 ?        00:01:25 ora_pmon_dx07123      
oracle   244080      1  0 Jan08 ?        00:01:28 ora_pmon_rpasnap1      


Now, Is there anyway that i can get only the active database names (for eg. rpasnap1 instead of ora_pmon_rpasnap1) using "ps-ef|grep pmon" or any other method?


Your help is my salvation.


1 Answer 1

3
$ ps -ef | grep pmon | grep -v grep
oracle   23955     1  0 Jan16 ?        00:00:33 asm_pmon_+ASM
oracle   27366     1  0 Jan16 ?        00:00:31 ora_pmon_S112

$ ps -ef | grep pmon | grep -v grep | awk '{ print $8 }' | cut -d '_' -f3
+ASM
S112

$ ps -e -o command | grep pmon | grep -v grep | cut -d '_' -f3
+ASM
S112
1
  • :-) Now thats whats the doctor ordered. Thank you. Commented Jan 19, 2018 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.