Thursday, April 14, 2016

ORA-10458: standby database requires recovery

For some reason when I was trying to start me DR instance I was getting the error that need recovery for the database. Something like this:

oracle@testdb01 (db1tesd) bin]$ srvctl start database -d db1tesd
PRCR-1079 : Failed to start resource ora.db1tesd.db
CRS-5017: The resource action "ora.db1tesd.db start" encountered the following error:
ORA-10458: standby database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: '+DATA/db1tesd/datafile/system.284.881230789'
. For details refer to "(:CLSN00107:)" in "/u01/app/11.2.0/grid/log/testdb01/agent/ohasd/oraagent_grid//oraagent_grid.log".
CRS-2674: Start of 'ora.db1tesd.db' on 'testdb01' failed
[oracle@testdb01 (db1tesd) bin]$ 

In order to fix the issue what I did was started standby in nomount

  • mount as standby
  • open database in read only
  • recovery managed standby database using current logfile 


Actual steps:
SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 5344731136 bytes
Fixed Size                  2262656 bytes
Variable Size            4412410240 bytes
Database Buffers          922746880 bytes
Redo Buffers                7311360 bytes
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT
*
ERROR at line 1:
ORA-01507: database not mounted

SQL> alter database mount standby database;
Database altered.
SQL> alter database open read only;
Database altered.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
Database altered.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
[oracle@testdb01 (db1tesd) bin]$
[oracle@testdb01 (db1tesd) bin]$
[oracle@testdb01 (db1tesd) bin]$ srvctl start database -d db1tesd
[oracle@testdb01 (db1tesd) bin]$ 

Or make sure that log shipping process is enabled on primary in DGMGRL by issuing below on primary


alter system set log_archive_dest_state_2=enable scope=both sid='*';

below on DR:


ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

No comments: