Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

****************I am authoring a Book on Oracle Database Cloud Services.......More details to follow.***************

Title : Oracle Database Cloud Revealed
Publisher : Apress
Release Date : Jan-2019

**********************************************************************************


Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]


My Cloud Certifications:

AWS Certified Solutions Architect Associate

Oracle Cloud Infrastructure 2018 Certified Architect Associate.

Oracle Cloud Infrastructure Classic 2018 Certified Architect Associate.

Oracle Database Cloud Administrator Certified Professional.

Oracle Database Cloud Service Operations Certified Associate.

Search This Blog

Saturday, August 22, 2015

Oracle Performing manual switchover to standby database.


Performing graceful switchover to standby database.


Current status:

Primary:
SQL>  select db_unique_name,open_mode,database_role,switchover_status from v$database;

DB_UNIQUE_NAME              OPEN_MODE        DATABASE_ROLE    SWITCHOVER_STATUS
------------------------------ -------------------- ---------------- --------------------
orcl                  READ WRITE        PRIMARY         TO STANDBY


Standby:
SQL>  select db_unique_name,open_mode,database_role,switchover_status from v$database;

DB_UNIQUE_NAME              OPEN_MODE        DATABASE_ROLE    SWITCHOVER_STATUS
------------------------------ -------------------- ---------------- --------------------
msft                  MOUNTED           PHYSICAL STANDBY NOT ALLOWED

Now switchover the primary to standby:

SQL> alter database commit to switchover to standby with session shutdown;

Database altered.

SQL> shutdown immediate;
ORA-01507: database not mounted


ORACLE instance shut down.


SQL> startup mount;
ORACLE instance started.

Total System Global Area  430075904 bytes
Fixed Size           2214056 bytes
Variable Size         343934808 bytes
Database Buffers       79691776 bytes
Redo Buffers           4235264 bytes
Database mounted.
SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

DB_UNIQUE_NAME              OPEN_MODE        DATABASE_ROLE    SWITCHOVER_STATUS
------------------------------ -------------------- ---------------- --------------------
orcl                  MOUNTED           PHYSICAL STANDBY TO PRIMARY

SQL> recover managed standby database disconnect;
Media recovery complete.

Now switchover the standby to PRIMARY:

During the primary switchover(orcl) standby (msft) switchover_status automatically changed from “NOT ALLOWED” to “TO PRIMARY”

SQL>  select db_unique_name,open_mode,database_role,switchover_status from v$database;

DB_UNIQUE_NAME              OPEN_MODE        DATABASE_ROLE    SWITCHOVER_STATUS
------------------------------ -------------------- ---------------- --------------------
msft                  MOUNTED           PHYSICAL STANDBY TO PRIMARY

SQL> alter database commit to switchover to primary with session shutdown;

Database altered.

SQL> alter database open;

Database altered.

SQL> select db_unique_name,open_mode,database_role,switchover_status from v$database;

DB_UNIQUE_NAME              OPEN_MODE        DATABASE_ROLE    SWITCHOVER_STATUS
------------------------------ -------------------- ---------------- --------------------
msft                  READ WRITE        PRIMARY         TO STANDBY

No comments: