Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to check dbexport for errors

Status
Not open for further replies.

kazzie

MIS
Apr 19, 2002
2
NL
Hi,

I would like to know if it is possible to check if dbexport ran without problems, what does an error look like and how can I simulate one? I want to make sure that the export files are OK, so I would like to do some error checking.

Karen.
 
Karen:

I've used two methods:

1) search for the string "export complete" in the last 5 lines of the dbexport file:
dbexport testdb -c -ss -t /dev/tape -b 32 -s 2000000

cnt=`tail -5 ./dbexport.out|grep -i "dbexport completed"|wc -l`
if [ $cnt = 1 ];then
echo "\n Successfully ended database export @ `date`...\n"|tee -a $log
else
echo "\ndbexport failed! Check dbexport.out file for error message @ `date`.
fi

2) dbexport like most all unix commands sets the exit code, $?, to zero if it completes properly or non-zero if it doesn't:

dbexport testdb ....
if [ "$?" -eq 0 ]
then echo "dbexport worked"
else echo "dbexport failed"
fi

The easiest way of simulating an error is interrupting the dbexport process and answering "Y"es to the abort question. Also, a dbexport fails if a user or other process is using the database you're trying to export.

Regards,

Ed
Schaefer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top