http://dbaoracle.itpub.net/post/901/17276
使用split,compress和pipe可以方便,快速的进行exp imp
script from akstom:
You would export to a device that does not support seeking such as a tape (not
recommended, really slow) or a pipe.
Why not using compression? it'll considerably cut down on the size?
I myself use both compression AND split to make my export be in many managable
sized file (500meg is my chosen size). You could just use split and not
compress if you want.
Basically, you would create a pipe in the OS via:
$ mknod somefilename p
and then export to that pipe. you would set up another process in the
background that 'eats' the contents of this pipe and puts it somewhere. I use
split, you could use 'cat' to just put it into another file (if cat supports
files >2 gig -- thats the problem here, most utilities do not, you need to use a
special file io api to 2 gig file support).
Here is a script you can use as a template. Yes, it uses compression but you
can take that out. Its here to show you one method of doing this.
------------------------------ #!/bin/csh -vx setenv UID / setenv FN exp.`date +%j_%Y`.dmp setenv PIPE /tmp/exp_tmp_ora8i.dmp setenv MAXSIZE 500m setenv EXPORT_WHAT "full=y COMPRESS=n" echo $FN cd /nfs/atc-netapp1/expbkup_ora8i ls -l rm expbkup.log export.test exp.*.dmp* $PIPE mknod $PIPE p date > expbkup.log ( gzip < PIPE split -b MAXSIZE - FN strong> # uncomment this to just SPLIT the file, not compress and split #split -b $MAXSIZE $PIPE $FN. & exp userid=$UID buffer=20000000 file=$PIPE $EXPORT_WHAT >>& expbkup.log date >> expbkup.log date > export.test cat `echo $FN.* | sort` | gunzip > $PIPE & # uncomment this to just SPLIT the file, not compress and split #cat `echo $FN.* | sort` > $PIPE & imp userid=sys/o8isgr8 file=$PIPE show=y full=y >>& export.test date >> export.test tail expbkup.log tail export.test ls -l rm -f $PIPE -------------------------------------------------- --------------------------------------------------
This also always does an 'integrity' check of the export right after it is done
with an import show=y, that shows how to use these split files with import.
How to use split,compress,Pipe is very simple.
Or your exp writes to a PIPE and imp reads directly from the PIPE at the same time
IF exp.exe imp.exr at same computer...
It's quite fast .
本文介绍了一种利用Pipe、Split及Compress工具优化Oracle数据库备份的方法。通过创建操作系统管道并在后台设置读取该管道内容的过程,可以实现数据的高效导出与导入。此外,文章还提供了一个示例脚本,演示如何将大型备份文件分割为多个可管理的小文件,并进行压缩。

被折叠的 条评论
为什么被折叠?



