Re: How to pipe output from export into gzip?

From: Chris Kirke <cakirke_at_metroux.metrobbs.com>
Date: 1996/01/08
Message-ID: <4cptle$7h0_at_metroux.metrobbs.com>#1/1


In article <1996Jan6.050335.29358_at_rosevax.rosemount.com>, markro2_at_frmail.rosemount.com says...
>
>Try a named pipe (man mknod), invoke compress with stdin redirected to
 the named
>
>pipe, invoke exp using the pipe name as the name of your export file.
>
>Unless your machine is a multiprocessor, you may not gain much by doing
 this bec
>ause
>cpu contention could occur.
>
>You should also be careful about the export buffer size. Check man for
 the min/m
>ax
>size of fifos (maybe man 2 read/write) - in the text book definition, a
 fifo use
>s
>only the direct blocks of an inode, which means that for a machine with
 10 direc
>t
>blocks per inode and a 1K block size, the maximum size is 10K which is
 then the
>optimum export buffer.
>
>To import, do it in reverse - use zcat to uncompress/cat the file to the
 pipe an
>d
>run import with the pipe as the import file.
>
>mr
>
ie.

/etc/mknod /tmp/exp_pipe p	# create named pipe
cat /tmp/exp_pipe | compress > expdat.dmp &	# redirection
exp user/pass file=/tmp/exp_pipe ...	# do the export

background cat/compress finishes on eof (when exp finishes) this works well in practice on SCO 3.2.4.2 with Oracle V6/V7 using -H switch on compress nets 60-70% compression depending on data types etc. export runs somewhat slower due to being restrained by the compress but the savings in disk space is worth it.

to import from the compressed file directly ...

zcat expdat.dmp > /tmp/exp_pipe		# redirection
imp user/pass file=/tmp/exp_pipe	# do the import
 
-- 

>-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->
| | | Chris Kirke - cakirke_at_metroux.metrobbs.com | | | | the opinions expressed here ..... whatever | | | <--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<
Received on Mon Jan 08 1996 - 00:00:00 CET

Original text of this message