Friday, November 11, 2011

ORA-16649: possible failover to another database prevents this database from being opened


DB CONFIGURATION
2 node primary database
2 node standby database

PRIMARY DB WAS RUNNING FINE
We are trying restoring the old backup from the TAPE to the standby database.

Note: we have oracle observer configured for the primary & standby database and it is up and running on it (or) you might not know the status.

We are trying to restore a old backup on the standby database.

STEP#1
I have opened the DB in the NO mount with the same spfile.

STEP#2

Using autobackup controlfile or old backup piece controlfile, I have restored the controlfile.

SQL> alter database mount;

Database altered.

SQL>  select CONTROLFILE_TYPE,OPEN_MODE,DATABASE_ROLE,DATAGUARD_BROKER,FS_FAILOVER_STATUS,FS_FAILOVER_OBSERVER_HOST from v$database;

CONTROL OPEN_MODE            DATABASE_ROLE    DATAGUAR FS_FAILOVER_STATUS
------- -------------------- ---------------- -------- ----------------------
FS_FAILOVER_OBSERVER_HOST
--------------------------------------------------------------------------------
BACKUP  MOUNTED              PRIMARY          DISABLED DISABLED

After restore the controlfile says controlfile status are as PRIMARY DB.

I am checking the FUZZY status of the datafile through v$datafile_header. If you have any rows, then you have to restore the old archive log files.

-- if there is no rows then you can proceed with next step

SQL> select file#,STATUS, FUZZY from v$datafile_header where FUZZY='YES';

no rows selected

To find which archive log needs to be restore or from which SCN we need to restore

SQL> recover database using backup controlfile until cancel;

Note: if you doesn’t have the enough archive log, system will tell you the starting SCN number and archive log from a thread.

Ex:
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 78452381 generated at 10/27/2011 20:30:20 needed for thread 2
ORA-00289: suggestion : +BHU_ARCH
ORA-15173: entry 'ARCHIVELOG' does not exist in directory 'BHU_A'
ORA-00280: change 78452381 for thread 2 is in sequence #3

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SQL>



STEP#3

When I issue the command, I was reported with the below error message

SQL> alter database open resetlogs;
alter database open
*
ERROR at line 1:
ORA-16649: possible failover to another database prevents this database from
being opened



SOLUTION:

I believe this error is caused by the Oracle Observer and broker configuration. So I am stopping the usage of broker configuration file and make the oracle observer unknown

SQL> show parameter dg_broker_start

dg_broker_start                      boolean     TRUE


SQL> alter system set dg_broker_start=FALSE scope=both sid='*';

System altered.


Restart the DB

SQL> startup mount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 1.4431E+10 bytes
Fixed Size                  2240272 bytes
Variable Size            3892314352 bytes
Database Buffers         1.0503E+10 bytes
Redo Buffers               34148352 bytes
Database mounted.
SQL>
SQL>
SQL> alter database open resetlogs;

Database altered.


Hope this solve the issue, please provide valuable feedback. Happy learning!!!!

1 comment:

  1. Thanks...it worked with these commands:
    select CONTROLFILE_TYPE,OPEN_MODE,DATABASE_ROLE,DATAGUARD_BROKER,FS_FAILOVER_STATUS,FS_FAILOVER_OBSERVER_HOST from v$database;

    show parameter dg_broker_start
    alter system set dg_broker_start=FALSE scope=both sid='*';
    shutdown abort;
    startup mount;
    alter database open;

    ReplyDelete