How to Convert a Physical Standby Database into a Standalone Database

In this tutorial, we will convert a standby database into a standalone database.


Note:

-It is recommended to try out these procedures on a Test System before attempting on the Production System.

-Once you activate a standby database, the database can no longer be used in the existing standby configuration.

-Before you begin, you must first remove the standby database from the Data Guard Configuration. See Removing One Standby Database from a 2-Standby Database Data Guard Configuration.


Attempting to activate the standby database without stopping the managed recovery.


SQL> select database_role from v$database;

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

SQL> alter database activate standby database;
alter database activate standby database
*
ERROR at line 1:
ORA-01154: database busy. Open, close, mount, and dismount not allowed now

We need to stop the managed recovery before activating the standby database.


SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database activate standby database;

Database altered.

Now we bounce the database.


SQL> shutdown immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 1577056080 bytes
Fixed Size                  8898384 bytes
Variable Size            1023410176 bytes
Database Buffers          520093696 bytes
Redo Buffers               24653824 bytes
Database mounted.
Database opened.

The database is now open READ WRITE.


SQL> select database_role, open_mode from v$database;

DATABASE_ROLE             OPEN_MODE
------------------------- --------------------
PRIMARY                   READ WRITE