LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2011, 07:19 AM   #1
suman_dba
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
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?
 
Old 02-08-2011, 03:52 PM   #2
goodhombre
Member
 
Registered: Mar 2010
Location: Ungheni, Rep. Moldova
Distribution: Ubuntu
Posts: 82

Rep: Reputation: 20
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot read text from text file and store it in a variable using shell script anurupr Linux - Newbie 2 03-03-2010 02:38 PM
need to write a shell script for appending text into each line of a file nandakv4 Programming 9 08-15-2009 04:32 AM
remote secure shell script text output aral Programming 6 09-02-2006 11:01 PM
How to find and change a specific text in a text file by using shell script Bassam Programming 1 07-18-2005 08:15 PM
Linux shell command for makefile.in to create a text file and write to it alix123 Programming 8 01-07-2005 09:18 AM


All times are GMT -5. The time now is 06:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration