darrengan has asked for the wisdom of the Perl Monks concerning the following question:
i am running a perl script which query from a Oracle db. In event the db is down or password expired, my script will hang. To prevent this, i would like to have a checking on the db connection before my other scripts execute.
i have tried the following but it will hang:
$CHECK_DB = system ("sqlplus -s username/password\@dbname >> /dev/null + 2>&1"); if ( $CHECK_DB eq 0 ) { print LOG "Msg: DB link up\n"; } else { print LOG "Msg: DB link down!\n"; }
It doesnt seems to be working. Is there any other method?
Cheers Mate...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test Oracle connection
by holli (Abbot) on Apr 25, 2006 at 07:29 UTC | |
|
Re: Test Oracle connection
by jcc (Sexton) on Apr 25, 2006 at 13:16 UTC | |
by Anonymous Monk on Apr 25, 2006 at 20:01 UTC | |
|
Re: Test Oracle connection
by cdarke (Prior) on Apr 25, 2006 at 11:42 UTC | |
by jcc (Sexton) on Apr 25, 2006 at 17:23 UTC | |
|
Re: Test Oracle connection
by darrengan (Sexton) on Apr 26, 2006 at 01:52 UTC |