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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.