DG学习笔记(8)_Switchover and Failover

DG学习笔记(8)_Switchover and Failover

 

目录

1 Switchover

2 物理StandbySwitchover步骤

3 Failover

4 Failover for Physical Standby Database Using SQL

 

1 Switchover

 

角色转换,Primary Database切换成 Standby Database, 将其中一个Standby切换成Primary.(数据不会丢失)

Planned role reversal

Used for OS or Hardware maintenance

用来做操作系统或硬件的日常维护

 

Note: Do not attempt a switchover operation to perform. a rolling upgrade of Oracle software; this is not supported.(什么叫rolling upgrade ? RAC环境下的在线升级 )

Switchover and failover operations are not invoked automatically. You must initiate switchover or failover operations by using a SQL statement or by using the DG Manager or DG broker CLI.

(DGSwitchover, Failover操作不是自动触发的.而必须通过手动的触发.)

 

物理StandbySwitchover要求关闭和重启Primary and Standby. 而逻辑Standby不需要关闭和重启.

 

Switchover are only initiated on the Primary database.They cannot be initiated from the standby database.

tandby. iguration.

role is no longer capable of returning to being a standby database in the original configuration

After Switchover, Sessions for each system would need to reconnect. Data Guard does not automatically switch over sessions from one database to the other.

必须重连应用会话.

 

All but one primary instance and one standby instance in a Real Application Clusters configuration are shut down.

(RAC环境下的Switchover必须关闭其余Instance).

 

 

2 物理StandbySwitchover步骤

 

Original Primary:

1)      Verify the SWITCHOVER_STATUS from v$DATABASE is TO_STANDBY.

 

SELECT SWITCHOVER_STATUS FROM V$DATABASE;

 

2)      ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN WAIT;

 

The WAIT option will not return control to you until the statement completes.

 

3)      Shutdown the instance and restart it without mounting the database.

SQL> SHUTDOWN IMMEDIATE;

SQL> STARTUP NOMOUNT;

SQL> ALTER DATABASE MOUNT STANDBY DATABASE;

 

4) Start the MRP process:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;

 

Original Standby:

 

1)      Verify the SWITCHOVER_STATUS from V$DATABASE is SWITCHOVER_PENDING

 

SQL> Select switchover_status from v$database.

 

2)      Switch the physical standby database role to the primary role.

SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN WAIT;

 

3) Shut down and restart the new primary database.

SQL> SHUTDOWN;

SQL> STARTUP;

 

4) Begin archiving logs to the physical standby database.

SQL> ALTER SYSTEM ARCHIVE LOG START;

SQL> ALTER SYSTEM SWITCH LOGFILE;

 

不能做Switchover的情形:

The following are situations when you will not be able to do a switchover:

Missing archives

Point in time recovery is required.you cannot switchover to some time in the past.

Production database is not open and cannot be opened

 

 

 

3 Failover

 

Primary was removed from the DG Configuration. And one of the Standby switch to Primary.(主库被移除,其中一个备库切成主库,可能会有数据丢失.)

 

Failover操作由Standby发起,主要用于以下情形:

Unplanned role reversal

Use in emergency

计划外或紧急的维护

 

Once you perform. a failover operation, there is no going back. This because the original primary database is incapacitated and the standby database that you fail over to the primary role is no longer capable of returning to being a standby database in the original configuration.

FAILOVER操作是不可逆转的.

 

4 Failover for Physical Standby Database Using SQL

 

Original Standby:

1)  Initiate the failover operation on the standby database.

 

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;

 

2)  Convert the physical standby database to the primary role.

 

SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;

 

3)  Register the missing archived redo logs.

SQL> ALTER DATABASE REGISTER LOGFILE ’/standby/arch_dest/arch_1_101.arc’;

这个注册与Catalog命令的注册有何区别?

 

Primary ?

1) To activate a standby database

SQL> ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE;

 

适合做Failover的情形:

Failures such as the following are good reasons to fail over to the standby database:

Loss of the current online redo log

Loss of system or rollback tablespace

Loss of hardware and the database

Inadvertent database operations that cannot be recovered from quickly, such as dropping a tablespace

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

转载于:http://blog.itpub.net/10248702/viewspace-629926/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值