Piping Exports (Unix)

From: Jean Anderson <jean_at_beno.CSS.GOV>
Date: 30 Apr 92 19:41:47 GMT
Message-ID: <50700_at_seismo.CSS.GOV>


Is anybody else piping the output from "exp"?

Our database filled up and we ran out of disk space for exports. I stumbled on the following that seems to work on DEC RISC and SUN 4 database hosts (the version of exp is 6.0.33.2.2 on both systems):

   exp user/account file=stdout | compress > expdat.dmp.Z
                         ^^^^^^

This produces a compressed file called "expdat.dmp.Z" that is 28-30% the size of the uncompressed export file.

I have not made the reverse direction (piping to imp) work reliably. However, if you uncompress expdat.dmp.Z first and then load it with imp, it loads just fine.

Well almost just fine. :-)

On the SUN 4 I get a final message at the end "Import terminated successfully with warnings." No warnings have been output and data appears to have loaded just fine.

DEC RISC loads fine with a final message "Import terminated successfully".

Has anybody else played around with this? I mentioned it to Oracle folks at this week's CODA conference who were surprised, which concerns me. Since we desperately need the ability to compress or redirect exp output to a remote tape device, I would be most distressed if I implemented it everywhere and it mysteriously disappeared in a future release.

A word of caution. If you decide to try this in a shell script, be careful with syntax that outputs exp messages to a log file. The following example is Bourne shell (the parfile has "file=stdout" in it):

    ( exp parfile=my_parfile | compress > exp.dmp.Z ) > export.log 2>&1

    ^                                               ^ ^
Note the parentheses and the important single redirect to "export.log". The first night my new whippy dippy script ran, I gave it a double redirect ">>" to append to a continuous export log. The entire export itself ended up in the log. Oops. :-) Oh well, it was on a development system.

Does anybody know of any reason that exports should *not* be piped like this?

  • jean
+-----------------------------------------------------------------------+

| Jean Anderson, DBA email: jean_at_seismo.css.gov |
| SAIC Open Systems Division, MS A2-F or: jean_at_esosun.css.gov |
| 10210 Campus Point Drive phone: (619)458-2727 |
| San Diego, CA 92121 fax: (619)458-4993 |
+-----------------------------------------------------------------------+
| execute sp_disclaimer _at_opinion="mine" |
+-----------------------------------------------------------------------+
Received on Thu Apr 30 1992 - 21:41:47 CEST

Original text of this message