script to check DB status
Platform: Oracle 9.R2 on Solaris 8
I need to write a (Perl) script to check whether a DB on a different Solaris server on the same LAN is down. My question is what condition do I specify to check the DB? For example, if the DB is down like it was shutdown or hang for whatever reason, what criteria to check when this happens? If it hangs, when I make a connection, it won't return. Do I have to spawn a seperate process in the script which attempts to make a connection to the DB while the other process checks whether the spawned process returns? This sounds an overkill to me. There gotta be an easy way.
How do people usually do this?
Well there are several things you can do.
You can grep the pmon process to check back ground processes are running. Also you can go into sqlplus and check the status in v$instance;
Oracle Certified Professional 8i, 9i.
"The degree of normality in a database is inversely proportional to that of its DBA"
If I can connect, the database is up. Simply connect to the database using DBI/DBD. If connected, sleep for 300 seconds. If not connected, send email/page and sleep for 300 seconds.
Click Here to Expand Forum to Full Width