Monday, March 10, 2014

How to set up an alias that quickly shows you the running instances on a Solaris server

Thanks to Mats Strömberg who showed me this little trick on how to use the -o option with ps, to look directly at the command column of the output from ps.

oracle@testserv1:/home/oracle $ alias ri='ps -ef -o comm|grep -v grep|grep ora_[p]mon|sed '"'"'s/ora_pmon_//'"'"'|sort -n'
oracle@testserv1:/home/oracle $ ri
APITDB01
TESTDB01
TESTDB02
TESTDB03

No comments:

Post a Comment