Re: Dumping contents of a view to CSV file
From: Rumpi Gravenstein <rgravens_at_gmail.com>
Date: Wed, 26 Oct 2011 18:09:39 -0400
Message-ID: <CAEpg1wBBVegYg9mHy+2+BqJ=OoeOLy1hWma1Ev4r3zw0kKmk8w_at_mail.gmail.com>
One option is to do this with a "compression pipe". The basic idea is to create a pipe that feeds into a compression utility like gzip. Write to this pipe from Oracle using utl_file. When done remove the pipe. Here's a snippet that does this for an export
#
# Make the pipe
#
mknod /tmp/exp_pipe p
#
# Start the compress in the background with compression set at very fast
# reading from the pipe and writing to the compressed file instance.dmp.gz
# If you were using the compress utility the command would look like
#
# compress < /tmp/exp/pipe > /backup/instance.dmp.gz &
#
gzip -1 < /tmp/exp_pipe > /backup/instance.dmp.gz &
#
# Start the export using an export parameter file. Database login and all
# options have been specified in this parameter file. For more
# information on export parameter files see the Oracle documentation.
#
exp parfile=export.par
#
# Cleanup removing the pipe
#
rm /tmp/exp_pipe
Date: Wed, 26 Oct 2011 18:09:39 -0400
Message-ID: <CAEpg1wBBVegYg9mHy+2+BqJ=OoeOLy1hWma1Ev4r3zw0kKmk8w_at_mail.gmail.com>
One option is to do this with a "compression pipe". The basic idea is to create a pipe that feeds into a compression utility like gzip. Write to this pipe from Oracle using utl_file. When done remove the pipe. Here's a snippet that does this for an export
#
# Make the pipe
#
mknod /tmp/exp_pipe p
#
# Start the compress in the background with compression set at very fast
# reading from the pipe and writing to the compressed file instance.dmp.gz
# If you were using the compress utility the command would look like
#
# compress < /tmp/exp/pipe > /backup/instance.dmp.gz &
#
gzip -1 < /tmp/exp_pipe > /backup/instance.dmp.gz &
#
# Start the export using an export parameter file. Database login and all
# options have been specified in this parameter file. For more
# information on export parameter files see the Oracle documentation.
#
exp parfile=export.par
#
# Cleanup removing the pipe
#
rm /tmp/exp_pipe
-- Rumpi Gravenstein -- http://www.freelists.org/webpage/oracle-lReceived on Wed Oct 26 2011 - 17:09:39 CDT