PIPE Export / Import

Ask Tom pipe

 

EXPORT AND IMPORT USING UNIX PIPES.

Sometimes, the space on disk may not be enough to hold a full export dump if uncompressed.

EXAMPLE – export schema MCULP from PROD database and import into DEV database.

To avoid space running out, unix pipes and compression can be used.
EXPORT IN PROD DATABASE

cd /u02/oradata/export

CREATE UNIX PIPE IN THIS AREA – WHERE THE EXPORT DUMP WILL BE WRITTEN TO.

mknod pipe p

CREATE PAR FILE –

parfile is mculp.par

vi mculp.par

buffer=2097152
recordlength=65535
consistent=y
owner=mculp
log=/u02/oradata/export/mculp.log
file=/u02/oradata/export/pipe

Now export schema MCULP.

1. nohup gzip -c </u02/oradata/export/pipe > /u02/oradata/export/mculp.dmp.gz &

Immediately enter next command –

2. nohup exp \’/ as sysdba\’ parfile=/u02/oradata/export/mculp.par &

Export of MCULP schema completes – compressed dump mculp.dmp.gz created.

ftp or copy the dump file mculp.dmp.gz to the DEV database box.

IMPORT IN DEV DATABASE – – Presume same directory structure exists on DEV box.

Create UNIX PIPE in area where dump is copied to in DEV box.

cd /u02/oradata/export

mknod import_pipe p

Create import parfile – called imp.par

vi imp.par

fromuser=mculp
touser=mculp
commit=y
buffer=2097152
ignore=y
file=/u02/oradata/export/import_pipe
log=/u02/oradata/export//imp_mculp.log

Enter commands –

1. nohup gzip -dc </u02/oradata/export/mculp.dmp.gz > import_pipe &

Immediately enter next command –

2. nohup imp \’/ as sysdba\’ parfile=/u02/oradata/export/imp.par

Check the logs for output of import.

Leave a Reply

Your email address will not be published. Required fields are marked *