文档解释
ORA-16438: Switchover to primary cannot be executed at this time
Cause: ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY could not be executed because an incompatible operation such as RMAN restore or flashback was in progress. See the database alert log for details.
Action: Wait for the incompatible operation to complete. The files that have been flashed back or restored need recovery before you can reissue ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY statement. Start redo apply and verify that the SWITCHOVER_STATUS column of the V$DATABASE view reports TO_PRIMARY or SESSIONS_ACTIVE before retrying ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY.
ORA-16438 是一个数据库异常,表示现在没法执行切换到主信息的操作。
官方解释
ORA-16438是一个SCN 时间戳mismatch 的异常,指示Oracle Data Guard缺少事件去让主库和备库把SCN(系统更改号)保持一致, 所以没法切换到主库。这个错误一般是出现在当时式在做switchover操作,从而使得主备库无法一致,从而影响故障转移。
常见案例
ORA-16438 通常是通过Data Guard来切换备库时出现的。执行switchover认为应该显示ORA-16688 来做一个报警,这个报警表示这是一个warning,而不是真的错误。然而,有时候,这个warning被认为是错误级别的消息,这时候我们便得到了ORA-16438 的信息。
一般处理方法及步骤
1. TURN ARCHIVELOG MODE OFF:关闭Archivelog模式
2. ALTER DATABASE CLEAR LOGFILE:清除当前日志文件
3. ALTER SYSTEM ARCHIVE LOG CURRENT:激活当前日志文件
4. TURN ARCHIVELOG MODE ON:重新开启Archivelog模式
5. TURN FORCE LOGGING ON:打开force logging (用在11.2 之前的版本)
6. ALTER DATABASE OPEN:重新打开数据库
7. ALTER DATABASE FORCE LOGGING:强制写入日志(用在11.2之后的版本)
8.Execute switchover操作:执行切换操作