通过exp直接导出的dmp文件,经过gzip压缩后,一般能减少60~80%的磁盘空间
exp和imp不能像mysqldump那样直接使用管道命令"|",所以需要使用管道文件

1.通过 mknod /tmp/pipe p 建立管道文件,不要忘了参数p
2.通过 exp和 gzip导出数据到建立的管道并压缩
   exp test/test file=/tmp/pipe & gzip < /tmp/pipe > exp.dmp.gz
3.导出成功完成之后删除建立的管道
   rm    -rf    /tmp/pipe

下面是个自动导出的脚本

引用
export ORACLE_HOME=/usr/local/opt/oracle/product/9204;
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;
export ORACLE_SID=orcl;
mknod /tmp/pipe p;
exp admin99/admin99passwd owner=admin99 file=/tmp/pipe & gzip < /tmp/pipe > /home/oracle/backup/admin99$(date +%Y%m%d).dmp.gz;
rm -rf /tmp/pipe;
rm -rf /home/oracle/backup/*$(date +%Y%m%d -d '7 days ago')*

可以自动完成备份并删除7天前的备份数据
Tags:
oracle | 评论(0) | 引用(0) | 阅读(152)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 请输入左侧的字母,不区分大小写