LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to write expdp output in a text file using a shell script (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-write-expdp-output-in-a-text-file-using-a-shell-script-861153/)

suman_dba 02-07-2011 06:19 AM

how to write expdp output in a text file using a shell script
 
Hi,

Please help me in this shell script....

I want to write expdp output in a text file using a shell script

if i write like below
=============================================================================
expdp user/pwd SCHEMAS=sch DUMPFILE=EXP_DIR:sch%U.dmp PARALLEL=3 FILESIZE=2G LOGFILE=EXPLOG_DIR:sch.log
cat sch.log >> $outputfile
=============================================================================
it will write whatever is there in log file to text file

But, sometimes export fails with out start taking export (without generating log file) because of job already exists error.
such times, we dont know about that error until we check manually...
so i wrote like below
=============================================================================
expdp user/pwd SCHEMAS=sch DUMPFILE=EXP_DIR:sch%U.dmp PARALLEL=3 FILESIZE=2G LOGFILE=EXPLOG_DIR:sch.log >> $outputfile
=============================================================================

but still it is not writing anything in to text file using above stmt...

Can anyone tell me whats wrong in my above stmt?

goodhombre 02-08-2011 02:52 PM

Hi,

Try in this way :
Code:

expdp user/pwd SCHEMAS=sch DUMPFILE=EXP_DIR:sch%U.dmp PARALLEL=3 FILESIZE=2G LOGFILE=EXPLOG_DIR:sch.log 2>&1 >> $outputfile


All times are GMT -5. The time now is 12:14 AM.