正德厚生,臻于至善

rman backup 11g database空库

1.	重启单机DB 
sqlplus '/ as sysdba'
SQL> startup mount;
2.	创建备份脚本
编辑备份脚本dbbkupfull.sh
#!/bin/bash

export ORACLE_HOME=/u01/sit/db/11.2.0
export ORACLE_SID=BZSIT
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
backtime=`date +"%y%m%d%H%M"`

$ORACLE_HOME/bin/rman target / log=dbfullbkup_$backtime.log <<EOF
run{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
allocate channel c5 device type disk;
allocate channel c6 device type disk;
backup as compressed backupset full database format '/u01/dbbkup/b4imp/db_%d_%T_%U';
backup current controlfile format '/u01/dbbkup/b4imp/ctl_%d_%T_%s_%p.bak';
backup spfile format '/u01/dbbkup/b4imp/spfile_%d_%T_%s_%p.bak';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
}
exit;
EOF
3.	运行备份
db1运行备份脚本
mkdir -p /u01/dbbkup/b4imp
nohup /bin/bash ~/dbbkupfull.sh 2>&1 &
监控脚本log以及/u01/dbbkup/b4imp下的备份文件。备份后关闭数据库
SQL> shutdown immediate;
#!/bin/bash

ORACLE_SID=BZCDB
ORACLE_HOME=/bzebs/sit/db/19.0.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
backtime=`date +"%y%m%d%H%M"`

$ORACLE_HOME/bin/rman target / log=dbfullbkup_$backtime.log <<EOF
run{
CONFIGURE DEVICE TYPE DISK PARALLELISM 16 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE CHANNEL DEVICE TYPE disk MAXPIECESIZE 8G;
backup as compressed backupset full database format '/bzsitdata/backup/db_%d_%T_%U';
backup current controlfile format '/bzsitdata/backup/ctl_%d_%T_%s_%p.bak';
backup spfile format '/bzsitdata/backup/spfile_%d_%T_%s_%p.bak';
}
exit;
EOF
赞(0) 打赏
未经允许不得转载:徐万新之路 » rman backup 11g database空库

支持快讯、专题、百度收录推送、人机验证、多级分类筛选器,适用于垂直站点、科技博客、个人站,扁平化设计、简洁白色、超多功能配置、会员中心、直达链接、文章图片弹窗、自动缩略图等...

联系我们

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

登录

找回密码

注册