DG主备库转换时出现ORA-16416: 的错误
SQL> select name,database_role,open_mode,switchover_status from v$database;
NAME DATABASE_ROLE OPEN_MODE SWITCHOVER_STATUS
--------- ---------------- ---------- --------------------
ORCL PRIMARY READ WRITE SESSIONS ACTIVE
SQL> alter database commit to switchover to physical standby with session shutdown;
alter database commit to switchover to physical standby with session shutdown
*
ERROR at line 1:
ORA-16416: Switchover target is not synchronized with the primary
SQL> !oerr ora 16416
16416, 00000, "Switchover target is not synchronized with the primary"
// *Cause: The switchover target incurred an error or has a gap at the time
// the switchover operation was attempted.
// *Action: Allow the switchover target to become synchronized and then
// re-attempt the switchover.
解决办法:
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
Database mounted.
重现创建备库的控制文件,并将备份的控制文件替换掉
SQL>alter database create standby controlfile as '/data/rman_backup/sdtby_control01.ctl';
SQL> alter database open;
将新的控制文件图换到备库后在备库上执行一次REDO应用
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> alter database recover managed standby database cancel;
Database altered.
主库上再次执行切换即可
SQL> alter database commit to switchover to physical standby with session shutdown;
Database altered.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29320885/viewspace-1097960/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29320885/viewspace-1097960/