Saturday, 28 October 2017

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

ORA-01665: control file is not a standby control file
It means that I have restored not standby control file
To cope with this situation I have to CREATE STANDBY CONTROL FILE on primary, copy it to standby, then restore it, depending on disk configuration rename data, log-files…, but… I’m quite lazy… and prefer quick solutions if they are present.
So, the quick solution for ORA-01665 will be:
SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Lets see the small example:
SQL> STARTUP MOUNT
ORACLE instance started.

Database mounted.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;
ERROR at line 1:
ORA-01665: control file is not a standby control file
SQL> SELECT database_role FROM v$database;
DATABASE_ROLE
—————-
PRIMARY
SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Database altered.
SQL> STARTUP MOUNT
ORACLE instance started.

Database mounted.
SQL> SELECT database_role FROM v$database;
DATABASE_ROLE
—————-
PHYSICAL STANDBY
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;
Database altered.
So, now I have control file for Physical Standby database and I’m able to start Managed Recovery and I think that it is much easier/quicker than using the standard procedure or making new standby control file on primary, copying it to standby host, restoring, etc.

No comments:

Post a Comment

relink a single executable (binary file) using ADADMIN utility

In this post, I would like to write something useful for patching and fine-tuning. When times, we have to relink a particular binary file ...