Re: Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit Status?

  • From: "Michael McMullen" <ganstadba@xxxxxxxxxxx>
  • To: <cmarquez@xxxxxxxxxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 19 Aug 2005 09:05:42 -0400

Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit Status?You
used this one yet for exp?

grep "without warnings" ${LOG_FILE} > /dev/null 2>&1
   if [ $? != 0 ]
   then
      mailx -s "Failure in ${LOG_FILE}" ${MAILLIST} < ${LOG_FILE}
   fi

need to have statistics=none in your parameter file or you'll get an error.
i don't know if error checking on imp is required. there are so many errors
that could arise that reviewing the logfile might be the only check. but
that doesn't mean you couldn't check for file existence etc.


Mike
----- Original Message ----- 
From: Marquez, Chris
To: oracle-l@xxxxxxxxxxxxx
Sent: Thursday, August 18, 2005 4:14 PM
Subject: Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit
Status?


All,

 - My skill level:
I have written my share of shell scripts...mostly basic.
A few "loops" and "if" statements here and there.
90% of my shell scripts have been to do things with Oracle; EXP/IMP,
SQLPLUS, RMAN, etc.
Mostly starting programs and handling external files.
I have never written a case statement, nor used error handling (other than
standard out).

 - My task:
I have been given the task/challenge to convert or add to existing EXP/IMP
scripts error handling and return codes.
I found some tutorials on the web and began playing with "trap" and "Exit
status" in some basic shell scripts.
I fear my biggest problem is that beyond "how to" I don't know what is
possible (with shell scripts & Oracle).

OK, OK, OK...my task (specifically).
1.) I need to know (or test) if my script completes successfully and assign
a value.

2.) I need to know if/where my script dies/aborts/terminates in the middle
and assigning a value....rolling variable?
     "if step A complete then v_stats=...if step B complete then
v_stats=..."

3.) I need to get a positive or negative return code from Oracle EXP/IMP
utility and pass it to shell script (#2 above).

 - Regarding Oracle EXP/IMP;
Not sure what I am asking here...what are the possibilities if any for
Oracle EXP/IMP utility return codes?
And is a return code completely worthless anyway?
Would I really need/parse/get the result "Export completed without warnings"
to *know* the Oracle EXP/IMP returned successfully?

I'm all ears...and ready for code samples-scripts, docs, links and
references.

Thanks,

Chris Marquez
Oracle DBA
--
//www.freelists.org/webpage/oracle-l

Other related posts: