感谢支持
我们一直在努力

RedHat 常用备份脚脚本示例

RedHat 常用备份脚脚本示例


———-全备————-
#!/bin/bash
#edit by hsxiao 2010-03-30


date
echo ‘begin backup database…….’
echo ‘***********************************************’
export Oracle_BASE=/opt/ora10g
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=HSXIAO
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH
rman target / <<EOF
backup database plus archivelog delete all input;
#backup tablespace crawler;
EOF
date
echo ‘***********************************************’
echo ‘end! backup database successfull!’


————-单备表空间—————————-
#!/bin/bash
#edit by hsxiao 2010-03-30


date
echo ‘begin backup database…….’
echo ‘***********************************************’
export ORACLE_BASE=/opt/ora10g
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=HSXIAO
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH
rman target / <<EOF
#backup database plus archivelog;
backup tablespace crawler format ‘/usr/datafile/backup/crawler_%U.dbf’;
EOF
date
echo ‘***********************************************’
echo ‘end! backup database successfull!’


————清除失效备份——————–


#!/bin/bash
#edit by hsxiao 2010-03-30


date
echo ‘begin backup database…….’
echo ‘***********************************************’
export ORACLE_BASE=/opt/ora10g
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=HSXIAO
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH
rman target / <<EOF
# crosscheck and delete expired or obsolete backup;


crosscheck backup;
delete noprompt obsolete;
EOF
date
echo ‘***********************************************’
echo ‘clear backup for  database successfull!’

赞(0) 打赏
转载请注明出处:服务器评测 » RedHat 常用备份脚脚本示例
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏