Page 1 of 1

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

Posted: Thu Apr 06, 2006 6:26 am
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.........?

Posted: Thu Apr 06, 2006 6:28 am
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.

Posted: Thu Apr 06, 2006 6:46 am
by chulett
You could also 'Validate only' a similar job from a Sequencer.

Posted: Thu Apr 06, 2006 7:55 am
by kduke
Craig, shame on you. I am going to tell Ray you used sequencer.

Posted: Thu Apr 06, 2006 7:56 am
by chulett
Oh nos, Mr Kim, please don't tell on me! :cry:

Posted: Thu Apr 06, 2006 9:01 am
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.

Posted: Thu Apr 06, 2006 9:12 am
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.