RAC备份集恢复到单实例文件系统上

背景:生产环境是RAC (11.2.0.1) ,要搭建一个单实例的测试环境

实现方法:对生产环境做一个rman备份,然后在测试环境进行不完整恢复

一、rman 备份,备份脚本如下:

[oracle@easrac01 ~]$ more  /home/oracle/scripts/zszjk_full.sh
#!/bin/sh
source /home/oracle/.bash_profilezjk
CUSER=`id |cut -d"(" -f2 | cut -d ")" -f1`
DT=`date +"%Y%m%d_%H%M%S"`
RMAN_LOG_FILE=/home/oracle/bak_dir/zszjk_full.out
echo >> $RMAN_LOG_FILE
chmod 666 $RMAN_LOG_FILE
echo Script $0 >> $RMAN_LOG_FILE
echo ==== started on `date` ==== >> $RMAN_LOG_FILE
echo >> $RMAN_LOG_FILE
rman target / nocatalog msglog $RMAN_LOG_FILE append << EOF
RUN {
#sql 'alter system archive log current';
allocate channel ch00 TYPE disk;
allocate channel ch01 TYPE disk;
allocate channel ch02 TYPE disk;
allocate channel ch03 TYPE disk;
allocate channel ch04 TYPE disk;
allocate channel ch05 TYPE disk;
#send 'NB_ORA_POLICY=Ora_DB_ecdb02_Full';
backup INCREMENTAL LEVEL 0  filesperset = 5 as compressed backupset database format '/home/oracle/bak_dir/full_
%d_%T_%U.rman';
#sql 'alter system archive log current';
backup  filesperset = 15 as compressed backupset archivelog all format '/home/oracle/bak_dir/arch_%d_%T_%U.rman
' delete input force;
DELETE noprompt OBSOLETE;
crosscheck backup;
delete noprompt expired backup;
release channel ch00;
release channel ch01;
release channel ch02;
release channel ch03;
release channel ch04;
release channel ch05;
#sql 'alter system archive log current';
ALLOCATE CHANNEL ch00 TYPE disk;
copy current controlfile to '/home/oracle/bak_dir/control.full_%d_%T.rman';
backup spfile format '/home/oracle/bak_dir/spfile_%d_%T';
release channel ch00;
}
EOF

二、在备库进行恢复

1、恢复参数文件、控制文件(使用备份的控制文件进行恢复)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

huangliang0703

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值