Oracle rac+dg的switchover和failover步骤

环境:

         主库为双节点RAC,备库为单节点+ASM 数据库版本为11.2.0.4

switchover:

    1.rac2节点 
            shutdown immediate;
    2.rac1节点
            alter database commit to switchover to physical standby with session shutdown;
            startup;
    3.standby节点
            alter database commit to switchover to primary with session shutdown;
            select database_role,open_mode from v$database;
            alter database open;
            alter system switch logfile;
    4.rac1 节点
            alter database recover managed standby database using current logfile disconnect from session;
    5.standby节点(现在为主节点)状态检查
            select process,client_process,status,sequence# from gv$managerd_standby;------process为LNS的status为writting
            select dest_name,status,recovery_mode from v$archive_dest_status;------LOG_ARCGIVE_DEST_2的recovery_Mode为MANAGED REAL TIME APPLY
    6.rac1节点(现在备节点)状态检查
            select * from (select sequence#,completion_time,applied from v$archive_log order by 2 desc) where rownum<10;----sequence#最大的applied列为in-memory 其余前几个为YES
            select * from v$archive_gap;-------查询为空
            select process,client_process,status,sequence# from gv$managerd_standby;------process为MRP的status为applying_log
            select dest_name,status,recovery_mode from gv$archive_dest_status;------LOG_ARCGIVE_DEST_1的recovery_Mode为MANAGED REAL TIME APPLY


failover(rac双节点异常关机):

1.standby节点
            alter database recover managed standby database finish force;
            alter database commit to switchover to primary with session shutdown;
            select database_role,open_mode from v$database;
            alter database open;
            alter system switch logfile;

failover后利用flashback database重建主备关系:

该方法的前提条件是之前的rac在failover之前开启了flashback database
    1.rac2节点 
            shutdown immediate;
    2.rac1节点
            shutdown immediate;
            startup mount;
    3.standby节点
            select standby_became_primary_scn from v$database;----查询出备库做failover时的scn
    4.rac1节点
            flashback database to scn xxx;
            alter database convert to physical standby;
            shutdown immediate;
            startup;
            alter database recover managed standby database using current logfile disconnect from session;
    5.standby节点(现在为主节点)状态检查
            select process,client_process,status,sequence# from gv$managerd_standby;------process为LNS的status为writting
            select dest_name,status,recovery_mode from v$archive_dest_status;------LOG_ARCGIVE_DEST_2的recovery_Mode为MANAGED REAL TIME APPLY
    6.rac1节点(现在备节点)状态检查
            select * from (select sequence#,completion_time,applied from v$archive_log order by 2 desc) where rownum<10;----sequence#最大的applied列为in-memory 其余前几个为YES
            select * from v$archive_gap;-------查询为空
            select process,client_process,status,sequence# from gv$managerd_standby;------process为MRP的status为applying_log
            select dest_name,status,recovery_mode from gv$archive_dest_status;------LOG_ARCGIVE_DEST_1的recovery_Mode为MANAGED REAL TIME APPLY
    7.rac2节点(关于rac2节点的这个停启操作没什么科学依据。。只是我单纯的认为单节点对单节点的话可能会避免一些问题。。等稳定了再把这个节点起来也不迟嘛!)
            startup;

failover后利用rman重建主备关系:

        回来再补充,?

你可能感兴趣的:(Oracle)