Wednesday, 12 June 2019

Planned failover on 12c

STEP#1  Shutdown Primary Database for planned failover on 12c

STEP#2 On Standby Database



Stop MRP Process -
  •  ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
  • ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
converting standby role to the primary role 


  •  ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
converting standby role to the primary role
  •   ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
   Open database in read/Write mode

  •  ALTER DATABASE OPEN;

                                                             
Now  primary database up make primary database as standby database

  •  Startup mount
  •  ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
  •  SHUTDOWN IMMEDIATE;
  •  STARTUP MOUNT;
  • ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

######################################################################


SQL> @d

NAME      INSTANCE_NAME    DB_UNIQUE_NAME                 OPEN_MODE            DATABASE_ROLE    CURRENT_SCN        FAILOVER_SCN
--------- ---------------- ------------------------------ -------------------- ---------------- ------------------ ----------------------------------------
SMRPRODB  SMRPRODB         SMRPRODB                       READ WRITE           PRIMARY          YES                439121110

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 1.6267E+11 bytes
Fixed Size                  7653480 bytes
Variable Size            2.4696E+10 bytes
Database Buffers         1.3744E+11 bytes
Redo Buffers              529215488 bytes
Database mounted.

SQL> @d

NAME      INSTANCE_NAME    DB_UNIQUE_NAME                 OPEN_MODE            DATABASE_ROLE    CURRENT_SCN        FAILOVER_SCN
--------- ---------------- ------------------------------ -------------------- ---------------- ------------------ ----------------------------------------
xxxPRODB  xxxPRODB         xxxPRODB                       MOUNTED              PRIMARY          YES                439121110

SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

Database altered.

SQL> @d

NAME      INSTANCE_NAME    DB_UNIQUE_NAME                 OPEN_MODE            DATABASE_ROLE    CURRENT_SCN        FAILOVER_SCN
--------- ---------------- ------------------------------ -------------------- ---------------- ------------------ ----------------------------------------
SMRPRODB  SMRPRODB         SMRPRODB                       MOUNTED              PHYSICAL STANDBY YES                0

SQL> SHUTDOWN IMMEDIATE;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT;
ORACLE instance started.

Total System Global Area 1.6267E+11 bytes
Fixed Size                  7653480 bytes
Variable Size            2.4696E+10 bytes
Database Buffers         1.3744E+11 bytes
Redo Buffers              529215488 bytes
Database mounted.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Database altered.

No comments:

Post a Comment