备库alter open报错ORA-10458
问题描述
ORA-10458: standby database requires recovery
SQL> select OPen_mode from v$database;
OPEN_MODE
----------------------------------------
MOUNTED
SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-10458: standby database requires recovery
ORA-01196: 文件 1 由于介质恢复会话失败而不一致
ORA-01110: 数据文件 1: 'D:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF'
解决方法
SQL>SHUTDOWN IMMEDIATE
SQL>STARTUP MOUNT;
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USEING CURRENT LOGFILE DISCONNECT FROM SESSION;
到主库上操作:
SQL>ALTER SYSTEM SWITCH LOGFILE;
多操作几次,操作之后,稍等一段时间,时间视网速而定,过一段时间后,在主库上查询一下规定情况:
SQL> SELECT NAME,SEQUENCE#,ARCHIVED,APPLIED FROMV$ARCHIVED_LOG ORDER BY SEQUENCE#;
如果返回结果"APPLIED"都是“YES”或者只有最后一个是“NO”的话,说明全部归档日志全部已经归档完了,此时到备库上上操作:
备库操作:
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCLE;
SQL>ALTER DATABASE OPEN;
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;