Source:-
http://www.idevelopment.info/data/Oracle/DBA_tips/Export_Import/EXP_2.shtml
Example: (Using Compress and Split)
Export
#!/bin/ksh
# +---------------------------------------+
# | Change directory to the EXPORT_DIR. |
# +---------------------------------------+
cd /u03/app/oradata/TESTDB/export
pwd
# +---------------------------------------+
# | Remove previous pipes (if any) |
# +---------------------------------------+
rm -f compress_pipe
rm -f export_pipe
# +---------------------------------------+
# | Make two new pipes (Compress / Split) |
# +---------------------------------------+
mknod compress_pipe p
mknod export_pipe p
chmod 666 export_pipe compress_pipe
# +---------------------------------------+
# | Start both the Split and Compress |
# | backgroud processes. |
# +---------------------------------------+
nohup split -b 1024m < export_pipe &
nohup compress < compress_pipe > export_pipe &
# +---------------------------------------+
# | Finally, start the export to both |
# | pipes. |
# +---------------------------------------+
exp userid=system/manager file=compress_pipe full=yes log=exportTESTDB.log
# +---------------------------------------+
# | Remove the pipes. |
# +---------------------------------------+
rm -f compress_pipe
rm -f export_pipe
Import
#!/bin/ksh
# +---------------------------------------+
# | Change directory to the EXPORT_DIR. |
# +---------------------------------------+
cd /u03/app/oradata/TESTDB/export
pwd
# +---------------------------------------+
# | Remove previous pipe (if any) |
# +---------------------------------------+
rm -f import_pipe
# +---------------------------------------+
# | Make two new pipes (Compress / Split) |
# +---------------------------------------+
mknod import_pipe p
chmod 666 import_pipe
# +---------------------------------------+
# | Start both the Uncompress |
# | backgroud processes. |
# | This example assumes the export script|
# | (above) created three dump files xaa, |
# | xab and xac. |
# +---------------------------------------+
nohup cat xaa xab xac | uncompress - > import_pipe &
imp userid=system/manager file=import_pipe full=yes ignore=yes log=importTESTDB.log
# +---------------------------------------+
# | Remove the pipe. |
# +---------------------------------------+
rm -f import_pipe
Example: (Using only Split)
Export
#!/bin/ksh
# +---------------------------------------+
# | Change directory to the EXPORT_DIR. |
# +---------------------------------------+
cd /u03/app/oradata/TESTDB/export
pwd
# +---------------------------------------+
# | Remove previous pipes (if any) |
# +---------------------------------------+
rm -f export_pipe
# +---------------------------------------+
# | Make new pipe (Split) |
# +---------------------------------------+
mknod export_pipe p
chmod 666 export_pipe
# +---------------------------------------+
# | Start the Split backgroud process. |
# +---------------------------------------+
nohup split -b 1024m < export_pipe &
# +---------------------------------------+
# | Finally, start the export to the pipe.|
# +---------------------------------------+
exp userid=system/manager file=export_pipe full=yes log=exportTESTDB.log
# +---------------------------------------+
# | Remove the pipe. |
# +---------------------------------------+
rm -f export_pipe
Import
#!/bin/ksh
# +---------------------------------------+
# | Change directory to the EXPORT_DIR. |
# +---------------------------------------+
cd /u03/app/oradata/TESTDB/export
pwd
# +---------------------------------------+
# | Remove previous pipe (if any) |
# +---------------------------------------+
rm -f import_pipe
# +---------------------------------------+
# | Make new pipe (Split) |
# +---------------------------------------+
mknod import_pipe p
chmod 666 import_pipe
# +---------------------------------------+
# | Start the Split backgroud processes. |
# | This example assumes the export script|
# | (above) created three dump files xaa, |
# | xab and xac. |
# +---------------------------------------+
nohup cat xaa xab xac > import_pipe &
imp userid=system/manager file=import_pipe full=yes ignore=yes log=importTESTDB.log
# +---------------------------------------+
# | Remove the pipe. |
# +---------------------------------------+
rm -f import_pipe
Example: (Using only Compress)
Export
#!/bin/ksh
# +---------------------------------------+
# | Change directory to the EXPORT_DIR. |
# +---------------------------------------+
cd /u03/app/oradata/TESTDB/export
pwd
# +---------------------------------------+
# | Remove previous pipes (if any) |
# +---------------------------------------+
rm -f export_pipe
# +---------------------------------------+
# | Make new pipe (for gzip) |
# +---------------------------------------+
mknod export_pipe p
chmod 666 export_pipe
# +---------------------------------------+
# | Start the gzip backgroud process. |
# +---------------------------------------+
nohup cat export_pipe | gzip -9 > expdat.dmp.gz &
# +---------------------------------------+
# | Finally, start the export to the pipe.|
# +---------------------------------------+
exp userid=system/manager file=export_pipe full=yes log=exportTESTDB.log
# +---------------------------------------+
# | Remove the pipe. |
# +---------------------------------------+
rm -f export_pipe
Import
#!/bin/ksh
# +---------------------------------------+
# | Change directory to the EXPORT_DIR. |
# +---------------------------------------+
cd /u03/app/oradata/TESTDB/export
pwd
# +---------------------------------------+
# | Remove previous pipe (if any) |
# +---------------------------------------+
rm -f import_pipe
# +---------------------------------------+
# | Make new pipe (for gzip) |
# +---------------------------------------+
mknod import_pipe p
chmod 666 import_pipe
# +---------------------------------------+
# | Start the gzip backgroud processes. |
# | This example assumes the export script|
# | (above) created a dump file named |
# | expdat.dmp.gz. |
# +---------------------------------------+
nohup gunzip -c expdat.dmp.gz > import_pipe &
imp userid=system/manager file=import_pipe full=yes ignore=yes log=importTESTDB.log
# +---------------------------------------+
# | Remove the pipe. |
# +---------------------------------------+
rm -f import_pipe
Saturday, August 29, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment