Tuesday 10 October 2017

Converting the Physical Standby Database to a Snapshot Standby and back

Converting the Physical Standby Database to a Snapshot Standby Database


1. Makesure standby database is in sync with primary
SELECT THREAD#, MAX(SEQUENCE#) AS "LAST_APPLIED_LOG"  FROM V$LOG_HISTORY  GROUP BY THREAD#;
2.Cancel Media Recovery
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
3. shutdown database
srvctl stop database -d indigo
4.Startup mount. On an Oracle Real Applications Cluster (RAC) database, Startup ONLY ONE NODE
srvctl start instance -d truckpro -i indigo1 -o mount
5. alter database convert to snapshot standby;
6.Stop and start the database
srvctl stop database -d indigo
  srvctl start database -d indigo
select status,instance_name,database_role,open_mode from v$database,v$Instance;
The database will now be in readwrite mode on which we can do the transactions.


Converting the Snapshot Standby Database  to a Physical Standby Database
------------------------------------------------------------------------
1. Shutdown the database.
srvctl stop database -d indigo
2. Startup one instance in mount stage
srvctl start instance -d indigo -i indigo1 -o mount
3. alter database convert to physical standby;
4. shutdown immediate;
5. srvctl start database -d indigo -o mount
6. alter database recover managed standby database disconnect from session;
select status,instance_name,database_role,open_mode from v$database,v$Instance;

The database will now be in Physical standby mode and the log apply will start.

No comments:

Post a Comment