datbase connection status..........

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ketanshah123
Participant
Posts: 88
Joined: Wed Apr 05, 2006 1:04 am

datbase connection status..........

Post by ketanshah123 »

hi
how to create a job just to check whether the connection with datbase is established or failed.........?
is there any routine or macro available if yes hoew to use it.........?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

How about a simple job to read one record from a table (you could do something like a select from dual in Oracle) and writing that to /dev/null. If the job fails then you don't have a database connection.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You could also 'Validate only' a similar job from a Sequencer.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Craig, shame on you. I am going to tell Ray you used sequencer.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Oh nos, Mr Kim, please don't tell on me! :cry:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can even select 1 from dual, and if you get a value 1, then your connection is present. The job will fail if there is not output from the select.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

ODBC or OCI? If the command line for the database is available, consider a system command call to run a silly SQL statement and just check if it works. SELECT SYSDATE FROM DUAL is sufficient for Oracle using sqlplus. ISQL/OSQL are options for SQL-Server and SYBASE, dbaccess for Informix, and the DB2/UDB command line name escapes me right now.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply