Operating System - HP-UX
1753427 Members
4831 Online
108793 Solutions
New Discussion юеВ

compressing an export with oracle

 
SOLVED
Go to solution
Brian Gebhard
Occasional Advisor

compressing an export with oracle

The following is my current script:

cat $HOME/admin/P01/exp/exp_daily.dmp | gzip > /u20/test.Z

exp / file=$HOME/admin/P01/exp/exp_daily.dmp owner='owner' buffer=5000000 direct=y
***
Now $HOME/admin/P01/exp/exp_daily.dmp is a pipe created the following way:
mknod exp_daily.dmp p

I exp to the pipe file, then the compress grabs the info in the pipe and sends it to the *.Z file. I import basically the same way. I zcat into a pipe, then import from the pipe into oracle. My problem is I'm trying to use a different compression tool, gzip to be exact. I substitute gzip for compress and change the .Z extension to .gz. It appears to work fine. When I try to import using gunzip it doesn't send the info to the pipe. It creates a new file with the same name as the *.gz file but minus the .gz chars. So basically it just uncompresses the file. The following is the script I run:

impst / buffer=5000000 file=/u20/exp_daily.dmp fromuser='owenr' touser='owner'

gunzip /u20/test.dmp.Z > /u20/exp_daily.dmp
**
I've tried changing > to | with no success. I was on the phone with hp and they didn't have an answer for me either. Is there any other compress tool that works with pipes? I need to compress on the export.
7 REPLIES 7
harry d brown jr
Honored Contributor
Solution

Re: compressing an export with oracle

Brian,

try this:

gunzip /u20/test.dmp.Z -c > /u20/exp_daily.dmp

live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: compressing an export with oracle

Brian,

try this:

gunzip /u20/test.dmp.Z -c > /u20/exp_daily.dmp

live free or die
harry
Live Free or Die
Brian Gebhard
Occasional Advisor

Re: compressing an export with oracle

Sorry my current script is actually

cat $HOME/admin/P01/exp/exp_daily.dmp | compress > /u20/test.Z &

exp / file=$HOME/admin/P01/exp/exp_daily.dmp owner='owner' buffer=5000000 direct=y
harry d brown jr
Honored Contributor

Re: compressing an export with oracle

Brian,

dd if=$HOME/admin/P01/exp/exp_daily.dmp | gzip -c > /u20/test.Z &

live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: compressing an export with oracle

Brian,

Make that:

dd if=$HOME/admin/P01/exp/exp_daily.dmp | gzip -9 -c > /u20/test.gz &

"-9" will compress the crap out of the file - and on ascii files it really squashes it!

live free or die
harry
Live Free or Die
Brian Gebhard
Occasional Advisor

Re: compressing an export with oracle

Yes I do realize -9 compresses it very much but doesn't it also drastically increase the amount of time the export/compression will take? Won't the compression take longer?
harry d brown jr
Honored Contributor

Re: compressing an export with oracle

Brian,

Yes the compression will take longer, and in your case if you are immediately importing the data, then a -9 doesn't make sense, unless you need to keep the export.zipped file small.

live free or die
harry
Live Free or Die