Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem in Failover of Physical standby database to primary

454527Sep 16 2005 — edited Sep 25 2005
Hi Friends,

I am not able to perform failover properly. Please give me some pointers, where I am wrong. There was one primary database and one physical standby database in my data guard configuration. I just wanted that after failover, standby should be transitioned to primary. And this new primary would not have any standby database. Following were the names, instance names, location of datafiles and connection details of primary and standby databases before failover.

The primary database name : stdb
Instance name : stdb
location of datafiles : c:\standby
Connect sys/orcl@stdb as sysdba

And the standby database name : orcl
Instance name : orcl
location of datafiles: c:\oracle\product\10.1.0\oradata\orcl
Connect / as sysdba

Firstly, I made sure that there were no gaps in the archived redoes log files on the target standby database by performing following query:

SQL> select thread#, low_sequence#, high_sequence# from v$archive_gap;
no rows selected

then the following steps were carried out on the physical standby:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH
*
ERROR at line 1:
ORA-16043: managed recovery session canceled
ORA-16137: No terminal recovery is required


SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY
*
ERROR at line 1:
ORA-16139: media recovery required


SQL> SHUTDOWN IMMEDIATE;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.

At this point I have taken the backup of the new primary database.

SQL> STARTUP
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file 'C:\ORACLE\PRODUCT\10.1.0\DB_1\DATABASE\INITORCL.ORA'


Up to this point it seems to be fine because it is looking for right initialization file in the right location.

I have changed the INITOrcl.ora accordingly and placed it in c:\ then issued following command:

SQL> STARTUP PFILE= C:\INITORCL.ORA
ORACLE instance started.
Total System Global Area 88080384 bytes
Fixed Size 787588 bytes
Variable Size 82836348 bytes
Database Buffers 4194304 bytes
Redo Buffers 262144 bytes
Database mounted.
ORA-16004: backup database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBF'


(Please let me know what action need to be taken for above errors)

at this point the listener was stopped and restarted. And Connection was made again for orcl database (which is supposed to be new primary)

SQL> CONNECT / AS SYSDBA;
Connected.

In order to verify if standby has been transitioned to primary the following command were issued

SQL> SELECT NAME, DATABASE_ROLE FROM V$DATABASE;
NAME DATABASE_ROLE
--------- ----------------
ORCL PHYSICAL STANDBY

I expected it would show role as primary but it is still standby .

SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
orcl

I tried opening the database but it again gave me the same errors as above

SQL> ALTER DATABASE OPEN;
ALTER DATABASE OPEN
*
ERROR at line 1:
ORA-16004: backup database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBF'

I am performing failover for the first time and now I am completely stucked.

Though I was able to perform the some queries like:

Select * from v$log;
Select * from v$log_history;


(I didnÂ’t actually simulate any crash of a primary database before starting failoverÂ….does it matter?)

Thankx in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2005
Added on Sep 16 2005
8 comments
4,344 views