Re: Bad export utility...bad,bad!

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sat, 21 Jul 2001 21:54:48 GMT
Message-ID: <9gngku010ur_at_drn.newsguy.com>


[Quoted] In article <9qsX6.16094$aV1.1670578_at_newsread1.prod.itd.earthlink.net>, "Dan says...
>
>Hi all,
>
>I have this weirdness that is happing when I try to use the Export utility
>in a shell script. I have Oracle installed on an AIX (v4.3) RS/6000 box and
>I'm putting together a disaster recovery plan for the Oracle install. The
>backup software that I'm using allows a script to be run before the backup
>and after. The script is terribly simple in that I run the Export utility to
>export a portion of the database. The export works well. That's not the
>problem.
>
>The issue is that the backup software will run the script, but only if the
>script does not allow any text to be written to stdout. I know, I know-
>why?!? I dunno - the only thing the backup software wants to know is the
>exit value of the script. Anyway, I try redirecting the Export's output and
>funny enough, I can't do it.
>
>I have the script encased in an output block:
>
> OUTF = file.out
> {
> } >> $OUTF
>
>and Export will still write to my terminal.
>
>I try redirecting the output in the command itself:
>
> Exp .. > export.out
>
>And Export still writes to the terminal.
>
>Ok, I thought, let's get physical with this thing. I redirect stderr to
>stdout and turn off stdout:
>
> 2>&1 >&-
>
>Nope, that doesn't work either.
>
>Finally, I try /dev/null
>
> 1>/dev/null
>
>Still no luck. Export will write to the terminal no matter what.
>
>Any ideas on how to get around this persistent, unwanted behavior.
>
>Thanks a million!
>
>-Dan
>
>
>

[Quoted] this works for me (using sh)

[Quoted] $ exp userid=scott/tiger tables=emp > ./exp.log 2>&1

$ cat ./exp.log

[Quoted] Export: Release 8.1.6.2.0 - Production on Tue Jun 19 08:29:29 2001

[Quoted] (c) Copyright 1999 Oracle Corporation. All rights reserved.

[Quoted] Connected to: Oracle8i Enterprise Edition Release 8.1.6.2.0 - Production With the Partitioning option
JServer Release 8.1.6.2.0 - Production
Export done in WE8ISO8859P1 character set and US7ASCII NCHAR character set

[Quoted] About to export specified tables via Conventional Path ...

. . exporting table                            EMP         14 rows exported
[Quoted] Export terminated successfully without warnings. $
--
Thomas Kyte (tkyte_at_us.oracle.com)             http://asktom.oracle.com/ 
[Quoted] Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Sat Jul 21 2001 - 23:54:48 CEST

Original text of this message