Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Why use a Unix Pipe to uncompress a file?

Why use a Unix Pipe to uncompress a file?

From: Pat Howe <PHowe_at_verisign.com>
Date: Wed, 14 Aug 2002 16:28:19 -0800
Message-ID: <F001.004B5609.20020814162819@fatcity.com>


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: Pat Howe
  INET: PHowe_at_verisign.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 - 19:28:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US