Expdp error logging:

i am using expdp in korn shell to export tables from oracle. What i dont know is how to capture any errors if my expdp fails.
I am looking for some options like Spool where i can write the error into a file and return the location of that file to my calling script in case of errors. Please help me on this. TIA!

Hi,
You can specify a logfile when calling expdp using the LOGFILE parameter. expdp -help gives you an overview of possible parameters. When I use expdp in some automated process I usually redirect stdout and stderr into a file. This way I also get a logfile if the environment is not set up correctly and expdp is not found.
So the calls could look like this:

# using the logfile parameter
expdp $dbuser/$dbpasswd dumpfile=/path/to/your/dumpfile logfile=/path/to/your/logfile full=y
# capture stdout and stderr
expdp $dbuser/$dbpasswd dumpfile=/path/to/your/dumpfile full=y 1>/path/to/your/logfile 2>&1
1 Like

Cero, Thanks a lot. That helped. i now grep the file to check for errors and take necessary actions from there. Thanks again!