Mir Sayeed Hassan – Oracle Blog

Oracle DBA – Tips & Techniques | Learn with real-time examples

  • Translate

  • It’s Me






  • My Certificates

  • Links

    My Acclaim Certification : Credly Profile
    My Oracle ACE Pro Profile

  • Achievements

    Awarded Top 100 Oracle Blogs from Worldwide - #RANK 39
  • VISITORS COUNT

  • Verified International Academic Qualification from World Education Service (WES)

    Verified International Academic Qualification from World Education Service (WES)

  • Jobs

ORA-01665: control file is not a standby control file

Posted by Mir Sayeed Hassan on December 13th, 2021

ORA-01665: control file is not a standby control file

Receive the below error after the configuration of standby database manually & started the recovery process on standby database.

SQL> alter database recover managed standby database using current logfile disconnect from session;
alter database recover managed standby database using current logfile disconnect from session
*
ERROR at line 1:
ORA-01665: control file is not a standby control file

Check the status of database_role on current standby database

SQL> SELECT database_role FROM v$database;

DATABASE_ROLE
----------------
PRIMARY

Convert this into standby database

SQL> Alter database convert to physical standby;
Database altered.

Shudown database

SQL> shu immediate
ORA-01507: database not mounted
ORACLE instance shut down.

Startup database in mount state

SQL> startup mount
ORACLE instance started.

Total System Global Area 1.1758E+10 bytes
Fixed Size 2239056 bytes
Variable Size 6308234672 bytes
Database Buffers 5435817984 bytes
Redo Buffers 12128256 bytes
Database mounted.

Check the status of database_role on standby database

SQL> SELECT database_role FROM v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY

Start the recovery process on standby database

SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.

Therefore started apply the logs as shown below:

SQL> select process, status, thread#, sequence#, block#, blocks from v$managed_standby ;

PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS
--------- ------------ ---------- ---------- ---------- ----------
ARCH CLOSING 1 201654 266240 302
ARCH CONNECTED 0 0 0 0
ARCH CLOSING 1 201653 231424 1006
ARCH CLOSING 1 201652 239616 917
MRP0 APPLYING_LOG 1 201655 37128 409600
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0

PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS
--------- ------------ ---------- ---------- ---------- ----------
RFS IDLE 0 0 0 0
RFS IDLE 1 201655 37128 1

13 rows selected.

Note: Make sure you are doing this operation on standby database., don’t do it on primary database… be careful & verify

=====Hence tested & verified in our test env=====