Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Please Help to solve this problem
Hi,
I have a typical scenario, please provide suggestion to get rid off this.
I have a shell script which is schedule in cron. The shell script connects to a oracle database residing in another unix server and executes a sql file.
The sql file contains a select statement, its output is spooled to a text file.
Finally this text file is ftp ed to another server.
The problem here is when sql is running, suddenly the unix server goes down due to maintenance or for some other reason.
At this point of time what are the possible error messages the text file will contain at the last and how to handle it.. Please help asap.
#!/bin/ksh
echo Setup Oracle Environment
ORACLE_CONNECT=""
ORAENV_ASK=NO
export ORACLE_BASE=
export ORACLE_HOME=
export TNS_ADMIN=
export LD_LIBRARY_PATH=
export PATH=
SQLPLUS=${ORACLE_HOME}/bin/sqlplus
$SQLPLUS -S $ORACLE_CONNECT @${DATA_FILE}.sql
echo Verifying the file status of ${DATA_FILE}.new.....
s_flag=`tail ${DATA_FILE}.new|grep 'ERROR at line'|wc -l`
if [ $s_flag -eq 0 ]
then
echo Put the files in Prod SDW ftp directory..... else
#calling a shell script for sending mails. fi
Thanks,
Senthil
Received on Mon Feb 20 2006 - 08:44:52 CST