![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| connect sqlplus from unix | nehak | UNIX for Dummies Questions & Answers | 1 | 05-27-2008 09:12 AM |
| Shell Script And SQLPLUS | maco_home | UNIX for Dummies Questions & Answers | 6 | 08-25-2007 01:05 PM |
| connect to sqlplus in a script | big123456 | Shell Programming and Scripting | 1 | 09-18-2006 07:56 AM |
| calling sqlplus from shell | suds19 | Shell Programming and Scripting | 2 | 10-24-2002 05:01 PM |
| sqlplus and shell scripting | inquirer | UNIX for Dummies Questions & Answers | 10 | 08-16-2001 01:46 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
connect to sqlplus from shell
I'm writting a shell script and at the begining I login to sqlplus by
sqlplus -l user_name/password@instance what I would like is to check if the database is down or not , and if the database has started moved to the next step else sleep for a certain time and then check again . I know how to do the sleep part, but I don't know how to check if the database is not down. can some one help me please. Thanks, |
|
|||||
|
Quote:
For quick and "dirty" check you can use something like this: Code:
oracheck ()
{
printf "whenever sqlerror exit failure\nselect null from dual;\n" |
sqlplus -sl user/pass 2>&- 1>&- || return 1
}
Usage:
until oracheck; do sleep n; done
go_to_the_next_step
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|