Performing Switchover Activity
Convert Primary to Standby
NAME DATABASE_ROLE OPEN_MODE LOG_MODE
----------- ------------------------- -------------------- --------------------
ORADB PRIMARY READ WRITE ARCHIVELOG
SQL> col destination for a70
SQL>select b.destination,a.dest_id,b.ERROR,max(a.FIRST_TIME),max(a.sequence#) from gv$archived_log a, gv$archive_dest_status b where (a.dest_id='1' or a.applied ='YES') and a.dest_id=b.dest_id group by b.destination,a.dest_id,b.ERROR order by a.dest_id;
DESTINATION DEST_ID ERROR MAX(A.FIR MAX(A.SEQUENCE#)
------------------------------------------------- ------------ ------------ --------------- ----------------
/u01/app/oracle/product/12.1.0/db_1/dbs 1 04-AUG-24 68
oradbdr 2 04-AUG-24 68
Database altered.
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Alter LogFile
On New Standby
SQL*Plus: Release 12.1.0.2.0 Production on Sun Aug 4 19:45:37 2024
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> def
DEFINE _DATE = "04-AUG-2024 19:45:40" (CHAR)
>DEFINE _CONNECT_IDENTIFIER = "oradb" (CHAR)
DEFINE _USER = "SYS" (CHAR)
DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1201000200" (CHAR)
DEFINE _EDITOR = "vi" (CHAR)
DEFINE _O_VERSION = "" (CHAR)
DEFINE _O_RELEASE = "" (CHAR)
SQL> startup
ORACLE instance started.
Total System Global Area 1761607680 bytes
Fixed Size 2925360 bytes
Variable Size 587205840 bytes
Database Buffers 1157627904 bytes
Redo Buffers 13848576 bytes
Database mounted.
Database opened.
NAME DATABASE_ROLE OPEN_MODE LOG_MODE
----------- ------------------------------ -------------------- --------------------
ORADB PHYSICAL STANDBY READ ONLY ARCHIVELOG
SQL> alter database recover managed standby database disconnect from session;
Database altered.
NAME DATABASE_ROLE OPEN_MODE LOG_MODE
----------- ------------------------------ ------------------------------------ --------------------
ORADB PHYSICAL STANDBY READ ONLY WITH APPLY ARCHIVELOG
Convert Standby to Primary
NAME DATABASE_ROLE OPEN_MODE LOG_MODE
----------- ------------------------------ ------------------------------------ --------------------
ORADB PHYSICAL STANDBY READ ONLY WITH APPLY ARCHIVELOG
PROCESS CLIENT_PROCESS SEQUENCE# STATUS
-------------- ------------------------- ----------------- ---------------------
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
RFS LGWR 69 IDLE
RFS ARCH 0 IDLE
MRP0 N/A 69 WAIT_FOR_LOG
7 rows selected.
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
Database altered.
NAME DATABASE_ROLE OPEN_MODE LOG_MODE
------------ ------------------------ -------------------- --------------------
ORADB PRIMARY MOUNTED ARCHIVELOG
Database altered.
INST_ID NAME OPEN_MODE DATABASE_ROLE LOG_MODE CONTROL
------------ ----------- -------------------- ------------------------- -------------------- -----------------