Manual Performing a Switchover to a Physical Standby Database

os: centos 7.6
db: oracle 19.3

primary DB_UNIQUE_NAME: BOSTON
standby DB_UNIQUE_NAME: CHICAGO

如果使用了 dgmgrl 配置的,就使用 dgmgrl 执行 switchover 操作
如果使用了 sqlplus 配置的,就执行如下命令.12c 比之前的命令有所简化.

1. Verify that the target standby database is ready for switchover.

On the primary database BOSTON, issue the following SQL statement to verify that theswitchover target, CHICAGO, is ready for switchover:

SQL> ALTER DATABASE SWITCHOVER TO CHICAGO VERIFY;
ERROR at line 1:
ORA-16470: Redo Apply is not running on switchover target

This error means that the switchover target CHICAGO is not ready for switchover.

After Redo Apply is started, issue the following statement again:

SQL> ALTER DATABASE SWITCHOVER TO CHICAGO VERIFY;
ERROR at line 1:
ORA-16475: succeeded with warnings, check alert log for more details

You can fix the problems or if switchover performance is not important, those
warnings can be ignored. After making any fixes you determine are necessary,
issue the following SQL statement again:

SQL> ALTER DATABASE SWITCHOVER TO CHICAGO VERIFY;
Database altered.

The switchover target, CHICAGO, is now ready for switchover.

2. Initiate the switchover on the primary database, BOSTON, by issuing the following

on the primary database, BOSTON SQL statement:

SQL> ALTER DATABASE SWITCHOVER TO CHICAGO;
Database altered

在这里插入图片描述
在这里插入图片描述
If this statement completes without any errors, proceed to Step 3.

3. Issue the following SQL statement on the new primary database, CHICAGO, to open it.

on the new primary database

SQL> ALTER DATABASE OPEN;

4. Issue the following SQL statement to mount the new physical standby database,BOSTON:

on the new physical standby database

SQL> STARTUP MOUNT;

Or, if BOSTON is an Oracle Active Data Guard physical standby database, then
issue the following SQL statement to open it read only:

SQL> STARTUP;

5. Start Redo Apply on the new physical standby database. For example:

on the new physical standby database

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

参考:
https://docs.oracle.com/en/database/oracle/oracle-database/19/spmss/switchover-to-a-physical-db.html#GUID-AAD70601-D248-4309-B8DD-F461EE31A5FF
https://docs.oracle.com/en/database/oracle/oracle-database/19/sbydb/managing-oracle-data-guard-role-transitions.html#GUID-AAD70601-D248-4309-B8DD-F461EE31A5FF

猜你喜欢

转载自blog.csdn.net/ctypyb2002/article/details/92766930