Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Document Display https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-stat...

Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.

12c Dataguard Switchover Best Practices using DGMGRL(Dataguard Broker Command


Prompt) (Doc ID 1582837.1)

In this Document

Goal
Solution
I. Pre-Switchover Checks

Verify Dataguard Broker Configuration

Validate Database

II SWITCHOVER

Disable Apply Delay

Turn on Data Guard tracing on primary and standby

for RAC instance,

Tail Alert Logs and DRC (optional) on all instances

Perform Switchover

III. Post - Switchover Check

Reset Delaymins property

Set Trace to Prior Value

Verify Broker Configuration

APPLIES TO:

Oracle Database Cloud Schema Service - Version N/A and later


Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.
*** Reviewed for Relevance 16-Jul-2015 ***
*** Reviewed for Relevance 27-Oct-2016 ***

GOAL

This Document offers Step by Step method to perform Switchover using Dataguard Broker command prompt DGMGRL.

NOTE: In the images and/or the document content below, the user information and environment data
used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with
an Oracle database product or other training material. Any similarity to actual environments, actual
persons, living or dead, is purely coincidental and not intended in any manner.

For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:

Dg configuration : 12c
Primary db_unique_name : boston
Standby db_unique_name : chicago

1 of 7 11/6/2020, 9:16 AM
Document Display https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-stat...

SOLUTION
SWITCHOVER Considerations:

1. DG Broker will not downgrade the PROTECTION mode during the process of Switchover.

2. Configure suitable REDO transport mode on current standby that becomes Primary after switchover.

3. Configure SRL (Standby Redo Logs) and local archiving destination on current Primary.

Broker switchover command verifies the availability of SRL on current Primary Database and suitable Redo transport method on current Standby.

DB Restart Considerations:

1. If the switchover target is Physical Standby then Broker shutdown the Primary as a process of switchover.

2. If the switchover environment in MAX_PROTECTION mode and primary has only one Standby then broker shuts down both primary and standby as a
process of switchover. If primary has multiple standby then broker shuts down only the new Primary.

I. Pre-Switchover Checks

Verify Dataguard Broker Configuration

Use following command s to verify broker status before switchover.

DGMGRL>show configuration;

DGMGRL>show database <primary>;

DGMGRL>show database <standby>;

DGMGRL>show database verbose <primary>;

DGMGRL>show database verbose <standby>;

DGMGRL> show configuration;

Configuration - 12c

Protection Mode: MaxPerformance

Databases:

boston - Primary database

chicago - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

DGMGRL> show database boston;

Database - boston

Role: PRIMARY

Intended State: TRANSPORT-ON

Instance(s):

boston

Database Status:

SUCCESS

DGMGRL> show database chicago

2 of 7 11/6/2020, 9:16 AM
Document Display https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-stat...

Database - chicago

Role: PHYSICAL STANDBY

Intended State: APPLY-ON

Transport Lag: 0 seconds (computed 1 second ago)

Apply Lag: 0 seconds (computed 1 second ago)

Apply Rate: 0 Byte/s

Real Time Query: ON

Instance(s):

chicago

Database Status:

SUCCESS

NOTE : Further troubleshoot use,

DGMRL>show database ‘<>’ logxptstatus;

DGMGRL>show database ‘<> ‘inconsistentlogxptprops’;

Validate Database

Validate database verify following, no need to explicitly check whether ORLs/SRLS cleared.

Whether there is missing redo data on a standby database


Whether flashback is enabled
The number of temporary tablespace files configured
Whether an online data file move is in progress
Whether online redo logs are cleared for a physical standby database
Whether standby redo logs are cleared for a primary database
The online log file configuration
The standby log file configuration
Apply-related property settings
Transport-related property settings

DGMGRL> validate database boston

Database Role: Primary database

Ready for Switchover: Yes <-----------Ready for Switchover

Flashback Database Status:

boston: Off

DGMGRL> validate database chicago

Database Role: Physical standby database

Primary Database: boston

Ready for Switchover: Yes <--------This confirms Switchover readiness

Ready for Failover: Yes (Primary Running)

Flashback Database Status:

boston: Off

chicago: Off

Future Log File Groups Configuration:

3 of 7 11/6/2020, 9:16 AM
Document Display https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-stat...

Thread # Online Redo Log Groups Standby Redo Log Groups

(chicago) (boston)

1 4 4

NOTE : For further troubleshoot use validate database verbose.

DGMGRL>validate database verbose boston

DGMGRL>validate database verbose chicago

Preset Redo Transport related parameter

Verify below parameters are set based on PROTECTION MODE.

LogXptMode, NetTimeout, StandbyArchiveLocation, AlternateLocation, and RedoRoutes.

II SWITCHOVER

Disable Apply Delay

To increase the speed of switchover disable delaymins property.

DGMGRL>edit database chicago set property delaymins=0;

Turn on Data Guard tracing on primary and standby

DGMGRL> edit configuration set property tracelevel=support;

DGMGRL> edit database boston set property LogArchiveTrace=8191;

DGMGRL> edit database chicago set property LogArchiveTrace=8191;

for RAC instance,

DGMGRL> EDIT INSTANCE * ON DATABASE 'boston' SET PROPERTY LogArchiveTrace=8191;

Tail Alert Logs and DRC (optional) on all instances

Tail alert log and DRC<SID> log which is present in same location of alert log(text) from all the nodes of primary and standby.

tail –f <alert log of primary>

tail –f <alert log of standby>

tail –f <drc<SID> log of primary>

tail –f <drc<SID> log of standby>

Perform Switchover

4 of 7 11/6/2020, 9:16 AM
Document Display https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-stat...

Connect to sysdg

DGMGRL> connect sysdg

Password:

Connected as SYSDG.

DGMGRL> switchover to chicago

Performing switchover NOW, please wait...

Operation requires a connection to instance "chicago" on database "chicago"

Connecting to instance "chicago"...

Connected as SYSDBA.

New primary database "chicago" is opening...

Operation requires startup of instance "boston" on database "boston"

Starting instance "boston"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "chicago"

--------------Primary Alert log- alert_boston.log--------------

ALTER DATABASE SWITCHOVER TO 'chicago'

Starting switchover [Process ID: 10402]

ALTER DATABASE COMMIT TO SWITCHOVER TO PHY SICAL STANDBY [Process Id: 10402] (boston)

Switchover End-Of-Redo Log thread 1 sequence 131 has been fixed

Switchover: Primary highest seen SCN set to 0x0.0x310a3a

ARCH: Noswitch archival of thread 1, sequence 131

ARCH: End-Of-Redo Branch archival of thread 1 sequence 131

ARCH: Evaluating archive log 1 thread 1 sequence 131

Switchover complete. Database shutdown required

Completed: ALTER DATABASE SWITCHOVER TO 'chicago'

--------------Standby Alert log - alert_chicago.log------------

SWITCHOVER: received request 'ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY' from primary database.

ALTER DATABASE SWITCHOVER TO PRIMARY (chicago)

Standby became primary SCN: 3213880 <----------Record this SCN

5 of 7 11/6/2020, 9:16 AM
Document Display https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-stat...

Switchover: Complete - Database mounted as primary

SWITCHOVER: completed request from primary database.

----------------Primary Drc log -"/<path>/diag/rdbms/boston/boston/trace/drcboston.log"-----------

SWITCHOVER TO chicago

Broker Configuration: "12c"

Protection Mode: Maximum Performance

Fast-Start Failover (FSFO): Disabled, flags=0x0, version=0

Primary Database: chicago (0x02010000) <-------Chicago as Primary

---------------Standby DRC log - "/<path>/diag/rdbms/chicago/chicago/trace/drcchicago.log"--------------

Notifying Oracle Clusterware to prepare target standby database for switchover

Notifying DMON of db close

Notifying RSM0 of db close

Deferring associated archivelog destinations of sites permanently disabled due to Switchover

Notifying Oracle Clusterware to buildup primary database after switchover

III. Post - Switchover Check

Reset Delaymins property

Change the delaymins property to prior on new standby after switchover based on business requirement.

DGMGRL> edit database <new standby> set property delaymins=<old MRP delay value>;

Set Trace to Prior Value

DGMGRL> edit configuration reset property tracelevel ;

DGMGRL> edit database boston reset property logarchivetrace;

DGMGRL> edit database chicago reset property logarchivetrace;

Verify Broker Configuration      

DGMGRL> show configuration;

Configuration - 12c

Protection Mode: MaxPerformance

Databases:

chicago - Primary database

boston - Physical standby database <-----Boston is Physical Standby

6 of 7 11/6/2020, 9:16 AM
Document Display https://support.oracle.com/epmos/faces/SearchDocDisplay?_adf.ctrl-stat...

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

Didn't find what you are looking for?

7 of 7 11/6/2020, 9:16 AM

You might also like