DataBase check

Greeting All,
So down and dirty I need a way to verify me Oracle database is up via a called script prior to other scripts starting the webMethods components. I have some access to the HP UNIX server that wM is hosted on. Using wM ver 7.1.2. Input or insight is appreciated. Thanks.

Use SQL*Plus command-line to do a simple select from dual.

But I question the value of this. What will you do in this case:

  • Script to confirm the DB is up runs. Success.
  • Script to start wM components runs.
  • DB fails before wM script is complete or before wM components are fully spun up.

Won’t the recovery for that be the same as if you didn’t try to confirm the DB being up first? How often does it happen that the DB isn’t up before wM is started? Seems odd to need to check that.

No the UNIX server wM is hosted on does not require the same Oracle instance wM is using to come up before it does. It does not happen often, but I’ve been tasked to perform a verification that it is prior to bringing up any wM components. I was going to place a script in /var to somehow verify the specific instance wM needs. A ping just says “Hi” but not that warm fuzzy that’s needed.

You should be able to use a script that calls SQL*Plus (you’ll need an Oracle client install on the Unix server hosting wM components) to select sysdate from dual; This may be sufficient. Or do a select from a “real” table if you want to confirm something else is available.

I’m doing something like this:

cat results.out | grep -v ‘DATABASE AVAILABLE, CONTINUE START’ | wc

do

sqlplus {USER_ID}/{USER_PW}@wmedi <<EOF

set feedback off;

set heading off;

set pagesize 0;

spool /tmp/results.out

select ‘DATABASE AVAILABLE, CONTINUE START’ from dual;

spool off;

EOF

If (cat results.out | grep -v ‘DATABASE AVAILABLE, CONTINUE START’ | wc) <>1

do

Now I just have to find a way to encrypt the password in this file so it’s not in plain text.

Thanks for the suggestions.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.