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  : [EMAIL PROTECTED]  


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Pat Howe
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to