![]() |
|
|
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 |
| sqlplus call | JohnZ1385 | UNIX for Dummies Questions & Answers | 1 | 06-05-2008 11:48 AM |
| how can i call sqlplus? | theodore | HP-UX | 13 | 04-25-2008 03:01 PM |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 03:31 PM |
| Shell Script And SQLPLUS | maco_home | UNIX for Dummies Questions & Answers | 6 | 08-25-2007 01:05 PM |
| running shell script from sqlplus | dkr123 | Shell Programming and Scripting | 9 | 07-20-2006 11:52 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Call sqlplus in the shell script
Hi,
I am writing a script to test database connection. If the first try fails, it will wait for 1 minutes and then try again. The script is as following: ........ for i in $ORACLE_SID do $ORACLE_HOME/bin/sqlplus $username/$password@$i <<! >/dev/null select * from tab; exit if [ $? -ne 0 ]; then sleep 60 $ORACLE_HOME/bin/sqlplus $username/$password@$i <<! >/u01/app/oracle/local/check_$i.ora select * from tab; exit fi ! done #******************************** # If not, exist and email #******************************** for i in $ORACLE_SID do if [ -s "/u01/app/oracle/local/check_$i.ora" ]; then check_stat=`cat /u01/app/oracle/local/check_$i.ora|grep -i ERROR\wc -l`; if [ $check_stat -ne 0 ]; echo ATG/DBA $i database is down >> /u01/app/oracle/local/dbdown_err fi fi done When I test it and shut down the database, the output file check_orcl.ora is not generated. Please help and where it is not correct. Thanks |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|