Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit Status?

RE: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit Status?

From: Marquez, Chris <cmarquez_at_collegeboard.org>
Date: Wed, 31 Aug 2005 11:40:48 -0400
Message-ID: <B30C2483766F9342B6AEF108833CC84E05BD5F62@ecogenemld50.Org.Collegeboard.local>


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_at_digistar.com [mailto:oracle_at_digistar.com] Sent: Wed 8/31/2005 11:37 AM
To: Marquez, Chris
Cc: oracle-l_at_freelists.org
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_at_host.com
  exit 1
 fi
echo "`/bin/date +%H:%M:%S` Export D_S tables complete"

hope this helps

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Aug 31 2005 - 10:46:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US