Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Why use a Unix Pipe to uncompress a file?
I know why i did it in the past, 32 bit os, 2G limitation of single file.
i could run an export, compress on the fly and have a uncompressed file that is > 2G.
hence you need to work it backwards, since if its > 2G, the uncompress will choke(or truncate).
amazingly, that is NOT a stupid idea.
joe
Pat Howe wrote:
>I am trying to work thru the one of the scripts that I inherited and I was
>wondering if someone could shed some light on why the author used a UNIX
>PIPE to uncompress a file.
>
>Code :
>mknod /tmp/testdb_data_01.dbf_pipe p
>
>uncompress < /tmp/testdb_data_01.dbf_pipe >
>/u06/oracle/oradata/testdb/tbs/data_01.dbf &
>sleep 1
>
>cp data_01.dbf.Z /tmp/testdb_data_01.dbf_pipe &
>
>Background :
>File 'data_01.dbf.Z' exists in compress format.
>We are currently in the directory where this file resides.
>
>My Confused Analysis :
>line 1 : creates a pipe file called 'testdb_data_01.dbf_pipe' in the '/tmp'
>directory
>line 2 : In the background we start to uncompress from the 'PIPE file'
>(FIFO) into my destination directory
>'/u06/oracle/oradata/testdb/tbs/data_01.dbf'
>line 3 : Puts the script to sleep for 1 second (no idea why)
>line 4 : In the background it copies the compressed file (data_01.dbf.Z) to
>the PIPE
>
>Therefore as the copy occurs (line4) - the PIPE (using a First-In-First-Out)
>starts to uncompress my file (line2).
>
>Question :
>What does this gain me ? Ie ; Why would the author do this ?
>Seems to me to be alot of additional IO copying the file to '/tmp'.
>Why not just uncompress the file directly to its destination directory
>(/u06/oracle/oradata/testdb/tbs/) ?
>
>Thanks in advance
>
>_________________________
> Patrick J. Howe
> Oracle DBA
> VeriSign, Inc.
> 4501 Intelco Loop SE
> Olympia, WA 98507
> Phone : 360.493.6284
> Email : phowe_at_verisign.com
>
>
>
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Joe Testa INET: jtesta_at_dmc-it.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Aug 14 2002 - 20:28:33 CDT
![]() |
![]() |