Page 1 of 1

checking db links before loading

Posted: Fri Jan 25, 2008 12:40 pm
by jreddy
Hello friends,
Kindly help me figure out how to implement this requirement the best way.

We have source data coming from multiple db's and the first step we do is to stage them locally. And sometimes one of the sources would be unavailable at the time of load and when that happens we still would want to stage the data from other sources, but use the prior load's data in case of the db that is unavailable. But to determine and implement this, we first have to do an environment check

Here's one solution i am considering

- Write a unix script with simple sqls like a select count(1) from one of the tables from that source and if i end up with any ORA error messages then to exit with a different status code and in my job i can check this status code to determine if i need to start the staging area load jobs for that source.

Is there a better way to get that done in DS jobs?
Any suggestions are appreciated

Re: checking db links before loading

Posted: Fri Jan 25, 2008 1:36 pm
by gateleys
The best way to go about is to do a simple select against a small table, may be dual. For Oracle, you may try the tnsping, however, it checks if the listener is okay...does not necessarily mean your database is up.

Posted: Fri Jan 25, 2008 1:52 pm
by chulett
Another approach would be use a Sequence to Validate some form of job that connects to the database in question. It won't process any records, but will let you know if the source is available. Or not.