How to compress export (exp) dump files using UNIX pipes?

One of the biggest challenges for DBAs is the lack of disk space especially for the backups. Most often DBAs have to move the backup files from one location to other location to get room for new backups. Here we explained about a common solution for taking the export dump with compressed file size. Compression happens parallel with the export.
So we don’t need keep extra space for the uncompressed backup as it happens parallel with export.
Steps to take export with gzip and unix pipe
mknod /tmp/exppipe p
gzip -c </tmp/exppipe > schema.dmp.gz &
exp scott/<scott_passwd> file=/tmp/exppipe full=y compress=n log=schema.log
rm -f /tmp/exppipe
Steps to import dump files with gungzip and unix pipe:
mknod /tmp/imppipe p
gunzip -c schema.dmp.gz >/tmp/imppipe &
imp scott/<scott_passwd> file=/tmp/imppipe full=y ignore=y commit=y \
rm -f /tmp/imppipe

Steps to take export with compress and unix pipe
mknod /tmp/exppipe p
compress </tmp/exppipe > schema.dmp.Z &
exp scott/tiger file=/tmp/exppipe tables=example compress=n log=schema.log
rm -f /tmp/exppipe

mknod /tmp/imppipe p
uncompress  -c schema.dmp.Z >/tmp/imppipe &
imp scott/tiger file=/tmp/imppipe full=y ignore=y commit=y log=imp_schema.log
rm -f /tmp/imppipe
DBA Tips Data Pump Reference


Post a Comment


dba topics. Copyright 2011-16 All Rights Reserved | Site Map | Contact | Disclaimer | Google