Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix Scripting for an Oracle Database

Status
Not open for further replies.

waterpologuy

Technical User
Jun 19, 2006
1
US

Is there any specific UNIX Scripting I can Use to Determine if an Oracle Database is running?

If so, What is it?
 
Have you searched the FAQ area ?
faq822-2218

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
echo "‘ps -ef | grep smon|grep -v grep|awk '{print $8}'| awk -F \"_\" '{print$3}'‘"

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
nope, we ain't here - we IDGAF to that particular one.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Well you overdid it a bit - 2 greps and 2awks...

echo $(ps -ef|awk '{if ($NF ~ /^ora_smon_...$/) print substr($NF,10,3)}')

But your pipeline shows step by step what you're doing I suppose.


HTH,

p5wizard
 
Another variation, this is a script I call SIDswhich I use to query which DBs are running on the system:

Code:
ps -ef | sed -n '/_[p]mon_/{s/.*_[p]mon_//;p;}'

Annihilannic.
 
Ok Ok, I'll try harder to suppress my greppy awkness next time.

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top