checking db links before loading

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

checking db links before loading

Post 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
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: checking db links before loading

Post 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.
gateleys
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply