11g DG 重建

检查日志的同步状态和应用日志序列号

 

关库、删除备库文件、启动到nomount

shutdown immediate

sqlplus / as sysdba

startup nomount

拷贝口令文件,并设置密码

orapwd file=?/dbs/orapwtestdb password=oracle entries=10 force=y ignorecase=Y

同步文件,时间有点久

rman target sys/oracle@db1 auxiliary sys/oracle@db2

duplicate target database for standby from active database nofilenamecheck;

(相同路径目录使用 nofilenamecheck )

启动同步

shutdown immediate;

startup nomount;

alter database mount standby database;

alter database open read only;

alter database recover managed standby database using current logfile disconnect from session;

 

检查同步状态

select open_mode,protection_mode,database_role,switchover_status from v$database;

select max(sequence#) from v$log;--检查两边的序列好,是否一致

主库切换日志,查看备库应用状态 

select thread#,sequence#,standby_dest,archived,applied,status from v$archived_log;

 

DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-3/24'; ---删除归档

 

附:using current logfile 实时应用日志

SQL> set line 180 pagesize 1000
 
SQL> select process,status,GROUP#,thread#,sequence# from v$managed_standby;

MRP两次状态的差异,当未使用“using current logfile”时,MRP0的STATUS状态是【WAIT_FOR_LOG】;
当使用“using current logfile”,MRP0的STATUS状态是【APPLYING_LOG】


注意:使用 using current logfile
在maxmize pretection,maxmize availability中必须
要有standby logfile,为了避免数据的损失最少,maxmize performance 也最好创建standby logfile,考虑角色切换
primary库也要创建standby logfile,
standby logfile创建的要求, 与primary的redo logfile的大小相同,个数要至少多一个

select member from v$logfile;

alter database recover managed standby database cancel;

alter database add standby logfile group 6 '/oradata/lngrid/stdredo01.log' size 500m;
alter database add standby logfile group 7 '/oradata/lngrid/stdredo02.log' size 500m;

alter database recover managed standby database using current logfile disconnect from session;


Oracle 11g 使用duplicate from active database 创建物理ADG

https://blog.csdn.net/fffygapl/article/details/8603115


 

发布了9 篇原创文章 · 获赞 2 · 访问量 1万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览