   |  | | PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit | PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit 2005-08-31 - By Marquez, Chris
I think I get it. The idea is to put conditional logic around the calling of (my) imp_script.sh? I think that is what Ron is suggesting too?
Chris Marquez Oracle DBA
-- --Original Message-- -- From: oracle@(protected) [mailto:oracle@(protected)] Sent: Wed 8/31/2005 11:37 AM To: Marquez, Chris Cc: oracle-l@(protected) Subject: Re: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit Status?
There's a million ways to do what you're wanting to do. Here's some cutesy things I do within bash scripts.... $? is your friend.
BCVStatus=0 /opt/emc/WideSky/V5.3.0/bin/symmir -g DBNAME verify DB1-DBNAME BCV ld BCV-DBNAME -synched > /dev/null 2>&1 BCVStatus=$? until [ "$BCVStatus" = 0 ] do sleep 5; /opt/emc/WideSky/V5.3.0/bin/symmir -g DBNAME verify DB1-DBNAME BCV ld BCV-DBNAME -synched > /dev/null 2>&1 BCVStatus=$?; done
Copious output for reading cron output after getting to the office...
echo "`/bin/date +%H:%M:%S` Export D_S tables" $ORACLE_HOME/bin/exp / file=/e07/oracle/export/exp_das_$TSTAMP.dmp TABLES=BLAH1,BLAH2 LOG=/d02/app/oracle/admin/DBNAME/adhoc/logs/exp_das_$TSTAMP.log STATUS=$? if [ $STATUS -gt 0 ]; then echo "*** Export encountered errors - errorlevel $STATUS" echo "*** Export encountered errors - errorlevel $STATUS" | /usr/ucb/mail -s "DBNAME refresh failed: Export D_S encountered errors" dba@(protected) exit 1 fi echo "`/bin/date +%H:%M:%S` Export D_S tables complete"
hope this helps
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7232.39"> <TITLE>RE: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit Status?</TITLE> </HEAD> <BODY> <!-- Converted from text/plain format -->
<P><FONT SIZE=2>I think I get it.<BR> The idea is to put conditional logic around the calling of (my) imp_script.sh? <BR> I think that is what Ron is suggesting too?<BR> <BR> Chris Marquez<BR> Oracle DBA<BR> <BR> <BR> -- --Original Message-- --<BR> From: oracle@(protected) [<A HREF="mailto:oracle@(protected)">mailto:oracle @(protected)</A>]<BR> Sent: Wed 8/31/2005 11:37 AM<BR> To: Marquez, Chris<BR> Cc: oracle-l@(protected)<BR> Subject: Re: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit Status?<BR> <BR> <BR> <BR> There's a million ways to do what you're wanting to do. Here's some<BR> cutesy things I do within bash scripts.... $? is your friend.<BR> <BR> BCVStatus=0<BR> /opt/emc/WideSky/V5.3.0/bin/symmir -g DBNAME verify DB1-DBNAME BCV ld<BR> BCV-DBNAME -synched > /dev/null 2>&1<BR> BCVStatus=$?<BR> until [ "$BCVStatus" = 0 ]<BR> do<BR> sleep 5;<BR> /opt/emc/WideSky/V5.3.0/bin/symmir -g DBNAME verify DB1-DBNAME<BR> BCV ld BCV-DBNAME -synched > /dev/null 2>&1<BR> BCVStatus=$?;<BR> done<BR> <BR> <BR> <BR> <BR> <BR> Copious output for reading cron output after getting to the office...<BR> <BR> echo "`/bin/date +%H:%M:%S` Export D_S tables"<BR> $ORACLE_HOME/bin/exp / file=/e07/oracle/export/exp_das_$TSTAMP.dmp<BR> TABLES=BLAH1,BLAH2<BR> LOG=/d02/app/oracle/admin/DBNAME/adhoc/logs/exp_das_$TSTAMP.log<BR> STATUS=$?<BR> if [ $STATUS -gt 0 ]; then<BR> echo "*** Export encountered errors - errorlevel $STATUS"<BR> echo "*** Export encountered errors - errorlevel $STATUS" |<BR> /usr/ucb/mail -s "DBNAME refresh failed: Export D_S encountered errors"<BR> dba@(protected)<BR> exit 1<BR> fi<BR> echo "`/bin/date +%H:%M:%S` Export D_S tables complete"<BR> <BR> <BR> <BR> <BR> hope this helps<BR> <BR> <BR> <BR> <BR> </FONT> </P>
</BODY> </HTML>
|
|
 |