使用RMAN backup和restore方式部署物理备库

本文档不包含以下内容:
主数据库配置、参数、创建相关目录、监听器配置、tnsnames.ora配置、密码文件配置等,只列出主要步骤

一、主:

创建/u01/oracle_backup目录:
备份参数文件:
SQL> create pfile='/u01/oracle_backup/initlis.ora' from spfile;
备份数据:
rman target /
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
backup as compressed backupset format '/u02/orabackup/level0/ncf_db%U' database plus archivelog;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
备份控制文件:
run{
allocate channel c1 type disk;
backup format '/u02/orabackup/level0/control%U' current controlfile for standby;
release channel c1;
}



二、拷贝备份文件到备库主机,也就是/u01/oracle_backup


三、备:

按需修改目标端参数文件

rman target /
RMAN> startup nomount;
RMAN> restore standby controlfile from '/u01/oracle_backup/control1bqgo42a_1_1';
RMAN> sql 'alter database mount standby database';
restore数据库
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
restore database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}

recover数据库
RMAN> list backup of archivelog all;
找到要恢复到的最大序列号,比如有36的话,那就应该until 37
RMAN> recover database until sequence 37;
RMAN> exit

sqlplus / as sysdba;
SQL> alter database recover managed standby database using current logfile disconnect;
SQL> alter database recover managed standby database cancel;
SQL> alter database open;
SQL> alter database recover managed standby database using current logfile disconnect;


在主库上多切换几次日志,使用以下命令检查备库状态:
select process,status from v$managed_standby;


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26194851/viewspace-2120137/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26194851/viewspace-2120137/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值