Ask the Expert

Exporting and compressing file

I am running Oracle 8.1.6. I have an export script on Unix that is writing into a pipe and compressing the file. The export barely gets started and fails with an EXP-00002 error. If I run the export and then compress the file, it runs fine. The file is only about 20M.


    Requires Free Membership to View

To hopefully fix your problem, let's look at what the documentation says about your error.

   my_host% oerr exp 2
   00002, 00000, "error in writing to export file"
   // *Cause:  Export could not write to the export file, probably because 
of a
   //          device error. This message is usually followed by a device 
message
   //          from the operating system.
   // *Action: Take appropriate action to restore the device.

Did you receive an error message from the operating system? If so, take action to fix that OS error message. That is what killed you export. But if not, I'll offer a suggestion.

You didn't say how you were using a pipe, so I thought that I would show you how I use a pipe to compress my export. I use this method only when I know that my export will be greater than the 2 GB file limitation of the export utility. The basic steps are

  1. Create the pipe
  2. Start a compression utility on the pipe (I use gzip)
  3. Feed the export to the pipe

It goes something like this:

    mknod exp.pipe p         (this makes a pipe in the filesystem)
    gzip < exp.pipe > exp.dmp.gz &    (Take the contents of the pipe, and 
run it through gzip. The compressed dump file is output. The '&' runs this 
process in the background).
    exp userid=system/manager file=exp.pipe full=y     (start the export and 
dump it into the pipe).

To import, I use gunzip and do the opposite!

    mknod exp.pipe p
    gunzip < exp.dmp.gz > exp.pipe &
    imp userid=system/manager file=exp.pipe full=y

I hope that solves your problem!

For More Information


This was first published in May 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: