{"id":5764,"date":"2026-07-16T04:02:07","date_gmt":"2026-07-15T22:32:07","guid":{"rendered":"https:\/\/w3buddy.com\/?p=5764"},"modified":"2026-07-19T22:14:40","modified_gmt":"2026-07-19T16:44:40","slug":"oracle-data-guard-19c-configuration","status":"publish","type":"post","link":"https:\/\/w3buddy.com\/blog\/oracle-data-guard-19c-configuration\/","title":{"rendered":"Oracle Data Guard 19c Configuration"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A complete production-ready SOP for configuring Oracle Data Guard 19c from scratch. Covers primary database preparation, standby database creation using RMAN active duplicate, Data Guard Broker configuration, switchover, failover, reinstate, and full validation \u2014 with real commands, expected outputs, and consultant-level notes for both standard OFA and enterprise custom path conventions.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">1. Document Info<\/h3>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table><thead><tr><th>Item<\/th><th>Detail<\/th><\/tr><\/thead><tbody><tr><td>Oracle Version<\/td><td>19c (19.3+)<\/td><\/tr><tr><td>OS<\/td><td>Oracle Linux 7.x \/ RHEL 7.x or 8.x<\/td><\/tr><tr><td>DG Type<\/td><td>Physical Standby (most common in production)<\/td><\/tr><tr><td>Primary DB<\/td><td>ORCL (racnode1 or dbserver01)<\/td><\/tr><tr><td>Standby DB<\/td><td>ORCL_STBY (dbserver02)<\/td><\/tr><tr><td>Protection Mode<\/td><td>Maximum Performance (default \u2014 can change after setup)<\/td><\/tr><tr><td>MOS Reference<\/td><td>Doc ID 1349977.1 (Data Guard Setup Best Practices)<\/td><\/tr><tr><td>MOS Reference<\/td><td>Doc ID 2285557.1 (19c Data Guard Known Issues)<\/td><\/tr><tr><td>MOS Reference<\/td><td>Doc ID 1569287.1 (DG Broker Configuration)<\/td><\/tr><tr><td>Prepared By<\/td><td>Oracle DBA \/ Consultant<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">2. Data Guard \u2014 Concepts You Must Know First<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>What is Oracle Data Guard?<\/strong> Data Guard maintains a synchronized copy (standby database) of your primary database on a separate server. Every change made to the primary is automatically shipped to and applied on the standby. If the primary fails, the standby can take over as the new primary \u2014 providing disaster recovery and high availability.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Key Data Guard Terms<\/h4>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table><thead><tr><th>Term<\/th><th>What It Means<\/th><\/tr><\/thead><tbody><tr><td>Primary Database<\/td><td>The main production database that applications connect to and write data to<\/td><\/tr><tr><td>Physical Standby<\/td><td>An exact block-for-block copy of the primary. Redo logs are applied directly. Can be opened read-only (Active Data Guard). Most common type.<\/td><\/tr><tr><td>Logical Standby<\/td><td>SQL-applied standby. Can have different structure. Less common.<\/td><\/tr><tr><td>Redo Transport<\/td><td>The mechanism that ships redo log data from primary to standby<\/td><\/tr><tr><td>Log Apply<\/td><td>The process on the standby that applies the received redo to keep it synchronized<\/td><\/tr><tr><td>Switchover<\/td><td>Planned role reversal \u2014 primary becomes standby, standby becomes primary. No data loss. Both sides cooperative.<\/td><\/tr><tr><td>Failover<\/td><td>Unplanned role change \u2014 primary has failed. Standby takes over. May have data loss depending on protection mode.<\/td><\/tr><tr><td>Reinstate<\/td><td>After a failover, converting the old failed primary into a standby of the new primary<\/td><\/tr><tr><td>Active Data Guard<\/td><td>Licensed feature \u2014 opens the standby read-only for reporting while redo is still being applied<\/td><\/tr><tr><td>Snapshot Standby<\/td><td>Temporarily converts standby to a writable database for testing. Redo accumulates and is applied when converted back.<\/td><\/tr><tr><td>Data Guard Broker<\/td><td>Oracle&#8217;s management framework for Data Guard. Simplifies switchover\/failover to single commands. Highly recommended.<\/td><\/tr><tr><td>DGMGRL<\/td><td>Data Guard Manager command line \u2014 the interface to Broker<\/td><\/tr><tr><td>Protection Mode<\/td><td>How much data loss is acceptable. Maximum Performance (default), Maximum Availability, Maximum Protection.<\/td><\/tr><tr><td>Standby Redo Logs<\/td><td>Special redo logs on standby used during real-time apply. Required for Maximum Availability and Maximum Protection modes.<\/td><\/tr><tr><td>FAL Server\/Client<\/td><td>Fetch Archive Log \u2014 mechanism to request missing archivelogs from primary<\/td><\/tr><tr><td>DB_UNIQUE_NAME<\/td><td>Unique identifier for each database in a DG configuration. Primary and standby must have different DB_UNIQUE_NAME even if DB_NAME is same.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Data Guard Protection Modes<\/h4>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table><thead><tr><th>Mode<\/th><th>Data Loss Risk<\/th><th>Impact on Primary<\/th><th>When to Use<\/th><\/tr><\/thead><tbody><tr><td>Maximum Performance<\/td><td>Possible (seconds to minutes)<\/td><td>None \u2014 async redo ship<\/td><td>Default. Good balance for most production systems.<\/td><\/tr><tr><td>Maximum Availability<\/td><td>Zero (with sync standby)<\/td><td>Minimal \u2014 waits briefly if standby unavailable<\/td><td>When zero data loss is required but availability matters<\/td><\/tr><tr><td>Maximum Protection<\/td><td>Zero<\/td><td>Primary shuts down if standby unavailable<\/td><td>Rarely used \u2014 extreme data protection requirement<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Start with Maximum Performance<\/strong> during initial setup. Change to Maximum Availability after everything is stable and you have confirmed the network between primary and standby is reliable.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">3. Environment Details and Path Conventions<\/h3>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table><thead><tr><th>Item<\/th><th>Primary Server<\/th><th>Standby Server<\/th><\/tr><\/thead><tbody><tr><td>Hostname<\/td><td>dbserver01<\/td><td>dbserver02<\/td><\/tr><tr><td>DB_NAME<\/td><td>ORCL<\/td><td>ORCL<\/td><\/tr><tr><td>DB_UNIQUE_NAME<\/td><td>ORCL<\/td><td>ORCL_STBY<\/td><\/tr><tr><td>ORACLE_SID<\/td><td>ORCL<\/td><td>ORCL_STBY<\/td><\/tr><tr><td>Convention A Oracle Home<\/td><td>\/u01\/app\/oracle\/product\/19.3.0\/dbhome_1<\/td><td>\/u01\/app\/oracle\/product\/19.3.0\/dbhome_1<\/td><\/tr><tr><td>Convention B Oracle Home<\/td><td>\/oracle\/RDBMS\/19.31<\/td><td>\/oracle\/RDBMS\/19.31Standby<\/td><\/tr><tr><td>Convention A Oracle Base<\/td><td>\/u01\/app\/oracle<\/td><td>\/u01\/app\/oracle<\/td><\/tr><tr><td>Convention B Oracle Base<\/td><td>\/oracle<\/td><td>\/oracle<\/td><\/tr><tr><td>Listener Port<\/td><td>1521<\/td><td>1521<\/td><\/tr><tr><td>Data files location<\/td><td>+DATA or \/u01\/app\/oracle\/oradata<\/td><td>+DATA or \/u01\/app\/oracle\/oradata<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> <code>DB_NAME<\/code> is the same on primary and standby (<code>ORCL<\/code>). <code>DB_UNIQUE_NAME<\/code> MUST be different (<code>ORCL<\/code> on primary, <code>ORCL_STBY<\/code> on standby). This distinction is critical \u2014 Data Guard uses <code>DB_UNIQUE_NAME<\/code> to identify each member of the configuration.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Convention B note:<\/strong> In enterprise environments with Convention B paths, the standby ORACLE_HOME (<code>\/oracle\/RDBMS\/19.31Standby<\/code>) is a separate directory from the primary ORACLE_HOME (<code>\/oracle\/RDBMS\/19.31<\/code>). This allows independent patching. Oracle software must be installed in both homes before Data Guard configuration.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">4. Pre-Configuration Checks<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> Run all pre-checks before making any changes. Data Guard configuration is much easier to get right the first time than to fix a broken configuration.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">4.1 \u2014 Verify Primary Database Is in ARCHIVELOG Mode<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> Data Guard works by shipping archived redo logs from primary to standby. If the primary is in NOARCHIVELOG mode, there are no archived logs to ship and Data Guard cannot function.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Connect to primary\nsqlplus \/ as sysdba\n\nset linesize 150\nset pagesize 50\ncol name      for a12\ncol log_mode  for a15\ncol open_mode for a15\n\nSELECT name, log_mode, open_mode\nFROM   v$database;\n\n-- Also confirm archiving is working\nARCHIVE LOG LIST;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What to look for:<\/strong> <code>log_mode<\/code> must show <code>ARCHIVELOG<\/code>. If it shows <code>NOARCHIVELOG<\/code> switch it now:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SHUTDOWN IMMEDIATE;\nSTARTUP MOUNT;\nALTER DATABASE ARCHIVELOG;\nALTER DATABASE OPEN;\nARCHIVE LOG LIST;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">4.2 \u2014 Verify FORCE LOGGING Is Enabled on Primary<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> Some operations like direct path inserts can bypass redo logging (NOLOGGING). With FORCE LOGGING enabled, Oracle logs ALL changes regardless of NOLOGGING hints. This ensures the standby receives every change and stays fully synchronized. Without this, the standby can have corrupted blocks.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>set linesize 150\nset pagesize 50\ncol name          for a12\ncol force_logging for a5\n\nSELECT name, force_logging\nFROM   v$database;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What to look for:<\/strong> <code>force_logging<\/code> must show <code>YES<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Enable if not already set\nALTER DATABASE FORCE LOGGING;\n\n-- Verify\nSELECT name, force_logging FROM v$database;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">4.3 \u2014 Verify Primary Has Sufficient Redo Log Size<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> Redo logs that are too small cause frequent log switches. During a log switch, the primary must wait until the current redo is shipped to the standby before it can reuse the log. Small redo logs cause performance bottlenecks in Data Guard. Minimum recommended size is 200MB for most workloads.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>set linesize 150\nset pagesize 50\ncol l#      for 999\ncol status  for a12\ncol members for 999\n\nSELECT group#  l#,\n       members,\n       bytes\/1024\/1024  size_mb,\n       status,\n       archived\nFROM   v$log\nORDER BY group#;<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> If redo log size is less than 200MB, resize them before configuring Data Guard. Small redo logs are one of the most common causes of DG performance issues.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">4.4 \u2014 Check Primary DB_UNIQUE_NAME and DB_NAME<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>set linesize 150\nset pagesize 50\ncol name           for a12\ncol db_unique_name for a20\ncol platform_name  for a30\n\nSELECT name, db_unique_name, platform_name\nFROM   v$database;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">4.5 \u2014 Verify Oracle Software Is Installed on Standby Server<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> The standby server must have Oracle software (ORACLE_HOME) installed before you can create the standby database. Only software \u2014 no database created yet on standby. The database itself will be created by RMAN duplicate.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># On standby server (dbserver02) \u2014 as oracle user\nls -lh $ORACLE_HOME\/bin\/oracle\nls -lh $ORACLE_HOME\/bin\/sqlplus\n$ORACLE_HOME\/OPatch\/opatch lsinventory | grep \"Oracle Database\"<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> Oracle software version on standby must be IDENTICAL to primary. Same base version and same patch level. If versions differ, Data Guard will refuse to apply redo.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">4.6 \u2014 Verify Network Connectivity Between Primary and Standby<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> Data Guard ships redo logs over the network. Both servers must be able to reach each other by hostname and the TNS port must be open. A network firewall blocking port 1521 between primary and standby is a very common issue.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># From primary server \u2014 ping standby\nping -c 5 dbserver02\nping -c 5 dbserver02.company.com\n\n# Test port 1521 is reachable from primary to standby\ntelnet dbserver02 1521\n# OR\nnc -zv dbserver02 1521\n\n# From standby server \u2014 ping primary\nping -c 5 dbserver01\nnc -zv dbserver01 1521<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">4.7 \u2014 Check \/etc\/hosts on Both Servers<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># Both servers must resolve each other by hostname\n# Check on PRIMARY\ngrep -E \"dbserver01|dbserver02\" \/etc\/hosts\n\n# Check on STANDBY\ngrep -E \"dbserver01|dbserver02\" \/etc\/hosts<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Both <code>\/etc\/hosts<\/code> files must contain:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>192.168.1.10   dbserver01.company.com   dbserver01\n192.168.1.11   dbserver02.company.com   dbserver02<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5. Primary Database Preparation<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> All steps in this section are performed on the PRIMARY server unless stated otherwise. The primary database stays open and running throughout \u2014 no downtime needed for preparation.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">5.1 \u2014 Enable Supplemental Logging (Recommended)<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> Supplemental logging adds extra information to redo records that makes log mining and logical standby more reliable. Recommended for all Data Guard configurations.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">sql<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Connect to primary\nsqlplus \/ as sysdba\n\n-- Enable minimal supplemental logging\nALTER DATABASE ADD SUPPLEMENTAL LOG DATA;\n\n-- Verify\nSELECT supplemental_log_data_min FROM v$database;\n-- Should show YES<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">5.2 \u2014 Configure Standby Redo Logs on Primary<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> Standby Redo Logs (SRLs) are a special set of redo logs used by the standby database during real-time apply (where redo is applied as it arrives, not after archiving). SRLs must also be configured on the PRIMARY because during a switchover the primary becomes the standby and will need SRLs.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>How many SRLs?<\/strong> Rule: Number of SRLs = (Number of redo log groups + 1) per thread. For a single-instance database with 3 redo log groups, create 4 SRLs. Size must equal or exceed the size of your online redo logs.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- First check current redo log groups and size\nSELECT group#, members, bytes\/1024\/1024 size_mb\nFROM   v$log\nORDER BY group#;\n\n-- Create Standby Redo Logs on PRIMARY\n-- Assuming 3 redo groups at 200MB each \u2014 create 4 SRLs at 200MB\n-- Convention A (filesystem):\nALTER DATABASE ADD STANDBY LOGFILE GROUP 4\n    '\/u01\/app\/oracle\/oradata\/ORCL\/srl_redo04.log' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 5\n    '\/u01\/app\/oracle\/oradata\/ORCL\/srl_redo05.log' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 6\n    '\/u01\/app\/oracle\/oradata\/ORCL\/srl_redo06.log' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 7\n    '\/u01\/app\/oracle\/oradata\/ORCL\/srl_redo07.log' SIZE 200M;\n\n-- Convention B (ASM):\nALTER DATABASE ADD STANDBY LOGFILE GROUP 4\n    '+DATA' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 5\n    '+DATA' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 6\n    '+DATA' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 7\n    '+DATA' SIZE 200M;\n\n-- Verify SRLs were created\nset linesize 180\nset pagesize 50\ncol group#  for 999\ncol status  for a12\ncol member  for a65\n\nSELECT group#, sequence#, bytes\/1024\/1024 size_mb, used, status\nFROM   v$standby_log\nORDER BY group#;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">5.3 \u2014 Set Required Primary Database Parameters<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> These parameters enable and configure redo transport, archiving behavior, and Data Guard communication between primary and standby. Each parameter is explained inline.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>sqlplus \/ as sysdba\n\n-- DB_UNIQUE_NAME \u2014 unique name for this database in DG config\n-- Already set during DB creation but confirm and document it\nSHOW PARAMETER db_unique_name;\n\n-- LOG_ARCHIVE_CONFIG \u2014 lists all DB_UNIQUE_NAMEs in the DG configuration\n-- This allows the primary to accept redo from the standby after a switchover\nALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(ORCL,ORCL_STBY)'\n    SCOPE=BOTH;\n\n-- LOG_ARCHIVE_DEST_1 \u2014 local archiving destination on primary\n-- VALID_FOR specifies when this dest is used: (ONLINE_LOGFILE,ALL_ROLES)\n-- means archive online redo logs regardless of whether DB is primary or standby\nALTER SYSTEM SET LOG_ARCHIVE_DEST_1=\n    'LOCATION=USE_DB_RECOVERY_FILE_DEST\n     VALID_FOR=(ALL_LOGFILES,ALL_ROLES)\n     DB_UNIQUE_NAME=ORCL'\n    SCOPE=BOTH;\n\n-- LOG_ARCHIVE_DEST_2 \u2014 remote archiving to standby\n-- SERVICE=ORCL_STBY matches the tnsnames entry for standby\n-- ASYNC = asynchronous redo transport (Maximum Performance mode)\n-- VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) = only ship when this DB is primary\n-- COMPRESSION=ENABLE = compress redo before sending (saves bandwidth)\nALTER SYSTEM SET LOG_ARCHIVE_DEST_2=\n    'SERVICE=ORCL_STBY\n     ASYNC\n     VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)\n     DB_UNIQUE_NAME=ORCL_STBY\n     COMPRESSION=ENABLE'\n    SCOPE=BOTH;\n\n-- LOG_ARCHIVE_DEST_STATE_1 and _2 \u2014 enable both destinations\nALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1=ENABLE SCOPE=BOTH;\nALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE SCOPE=BOTH;\n\n-- LOG_ARCHIVE_FORMAT \u2014 format for archived log filenames\nALTER SYSTEM SET LOG_ARCHIVE_FORMAT='%t_%s_%r.dbf' SCOPE=SPFILE;\n\n-- LOG_ARCHIVE_MAX_PROCESSES \u2014 number of archiver processes\n-- More processes = faster archiving under heavy load\nALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=4 SCOPE=BOTH;\n\n-- REMOTE_LOGIN_PASSWORDFILE \u2014 must be EXCLUSIVE for Data Guard\n-- Allows the standby to authenticate with the primary using password file\nALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE;\n\n-- FAL_SERVER \u2014 Fetch Archive Log server\n-- When standby detects a gap in archive logs, it asks FAL_SERVER to resend them\n-- FAL_SERVER on primary points to itself (primary is FAL server for standby)\nALTER SYSTEM SET FAL_SERVER=ORCL SCOPE=BOTH;\n\n-- STANDBY_FILE_MANAGEMENT \u2014 how standby handles new datafiles added to primary\n-- AUTO = standby automatically creates datafiles when primary adds them\nALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO SCOPE=BOTH;\n\n-- DB_FILE_NAME_CONVERT \u2014 maps primary file paths to standby file paths\n-- Only needed if standby uses different directory structure than primary\n-- Convention A (same paths on both servers \u2014 not needed)\n-- Convention B (different ORACLE_HOME \u2014 datafile paths may differ):\n-- ALTER SYSTEM SET DB_FILE_NAME_CONVERT=\n--     '\/oracle\/oradata\/ORCL','\/oracle\/oradata\/ORCL_STBY'\n--     SCOPE=SPFILE;\n\n-- LOG_FILE_NAME_CONVERT \u2014 maps primary redo log paths to standby paths\n-- Same as above \u2014 only if paths differ between primary and standby\n-- ALTER SYSTEM SET LOG_FILE_NAME_CONVERT=\n--     '\/oracle\/oradata\/ORCL','\/oracle\/oradata\/ORCL_STBY'\n--     SCOPE=SPFILE;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Verify all parameters were set correctly\nset linesize 200\nset pagesize 100\ncol name  for a35\ncol value for a80\n\nSELECT name, value\nFROM   v$parameter\nWHERE  name IN (\n    'db_unique_name',\n    'log_archive_config',\n    'log_archive_dest_1',\n    'log_archive_dest_2',\n    'log_archive_dest_state_1',\n    'log_archive_dest_state_2',\n    'log_archive_format',\n    'log_archive_max_processes',\n    'remote_login_passwordfile',\n    'fal_server',\n    'standby_file_management'\n)\nORDER BY name;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">5.4 \u2014 Create Password File on Primary (If Not Exists)<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> Data Guard uses the password file for authentication between primary and standby during redo transport. The password file on standby must be a copy of the primary&#8217;s password file. Without this, the standby cannot receive redo from the primary.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># Check if password file exists\nls -lh $ORACLE_HOME\/dbs\/orapwORCL\n# Convention B: ls -lh $ORACLE_HOME\/dbs\/orapwORCL\n\n# If it does not exist \u2014 create it\norapwd file=$ORACLE_HOME\/dbs\/orapwORCL \\\n      password=Oracle_123 \\\n      entries=10 \\\n      format=12<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">5.5 \u2014 Configure tnsnames.ora on Primary Server<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> The primary needs a TNS entry for the standby database so that <code>LOG_ARCHIVE_DEST_2<\/code> (which uses <code>SERVICE=ORCL_STBY<\/code>) knows how to connect to the standby. The standby needs an entry for the primary for log gap resolution and switchover\/failover.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># Edit tnsnames.ora on PRIMARY server\nvi $ORACLE_HOME\/network\/admin\/tnsnames.ora<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add both entries \u2014 primary and standby \u2014 to the file:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># -------------------------------------------------------\n# TNS Entries for Data Guard Configuration\n# Add these on PRIMARY server\n# -------------------------------------------------------\n\n# Primary database TNS entry\n# Used by standby to connect back to primary (for FAL, switchover)\nORCL =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver01.company.com)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = ORCL)\n      (UR = A)\n    )\n  )\n\n# Standby database TNS entry\n# Used by primary LOG_ARCHIVE_DEST_2 to ship redo to standby\nORCL_STBY =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver02.company.com)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = ORCL_STBY)\n      (UR = A)\n    )\n  )<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>What is <code>UR = A<\/code>?<\/strong> <code>UR = A<\/code> (Unrestricted = A) allows connections even when the database is in restricted mode or mounted state. This is required because during standby creation the standby database is in NOMOUNT state \u2014 without <code>UR=A<\/code> the RMAN connection would be refused.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># Test TNS resolution works from primary\ntnsping ORCL\ntnsping ORCL_STBY    # Will fail until standby listener is up \u2014 that is OK for now<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">5.6 \u2014 Configure listener.ora on Primary<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> The listener on the primary needs a static entry for the primary database. Normally databases register dynamically with the listener. But during some Data Guard operations (especially when the database is in MOUNT state during recovery), dynamic registration is not available. A static entry ensures the listener always accepts connections regardless of database state.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># Edit listener.ora on PRIMARY server\nvi $ORACLE_HOME\/network\/admin\/listener.ora<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add static registration entry:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># -------------------------------------------------------\n# Listener configuration with static DB registration\n# PRIMARY SERVER \u2014 dbserver01\n# -------------------------------------------------------\n\nLISTENER =\n  (DESCRIPTION_LIST =\n    (DESCRIPTION =\n      (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver01.company.com)(PORT = 1521))\n      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))\n    )\n  )\n\n# Static database registration \u2014 required for Data Guard\n# Allows listener to accept connections even when DB is in MOUNT state\nSID_LIST_LISTENER =\n  (SID_LIST =\n    (SID_DESC =\n      (GLOBAL_DBNAME = ORCL)\n      (ORACLE_HOME   = \/u01\/app\/oracle\/product\/19.3.0\/dbhome_1)\n      (SID_NAME      = ORCL)\n    )\n    (SID_DESC =\n      (GLOBAL_DBNAME = ORCL_DGMGRL)\n      (ORACLE_HOME   = \/u01\/app\/oracle\/product\/19.3.0\/dbhome_1)\n      (SID_NAME      = ORCL)\n    )\n  )<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>What is <code>ORCL_DGMGRL<\/code>?<\/strong> Data Guard Broker uses a separate service name (<code>&lt;db_unique_name&gt;_DGMGRL<\/code>) to communicate. Adding this static entry ensures Broker can connect even when the database is in MOUNT state.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># Reload listener to pick up changes\nlsnrctl reload\nlsnrctl status<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">6. Standby Server Preparation<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> All steps in this section are performed on the STANDBY server unless stated otherwise.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">6.1 \u2014 Create Directory Structure on Standby<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> The standby database will be created by RMAN. RMAN needs these directories to already exist on the standby server. If they are missing, RMAN will fail during standby creation.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># As oracle user on STANDBY server\nsu - oracle\n\n# Create required directories\n# Convention A\nmkdir -p \/u01\/app\/oracle\/oradata\/ORCL_STBY\nmkdir -p \/u01\/app\/oracle\/fast_recovery_area\/ORCL_STBY\nmkdir -p \/u01\/app\/oracle\/admin\/ORCL_STBY\/adump\nmkdir -p \/u01\/app\/oracle\/admin\/ORCL_STBY\/bdump\nmkdir -p \/u01\/app\/oracle\/admin\/ORCL_STBY\/cdump\n\n# Convention B\nmkdir -p \/oracle\/oradata\/ORCL_STBY\nmkdir -p \/oracle\/fast_recovery_area\/ORCL_STBY\nmkdir -p \/oracle\/admin\/ORCL_STBY\/adump\n\n# Verify\nls -ld \/u01\/app\/oracle\/oradata\/ORCL_STBY\nls -ld \/u01\/app\/oracle\/fast_recovery_area\/ORCL_STBY\nls -ld \/u01\/app\/oracle\/admin\/ORCL_STBY\/adump<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">6.2 \u2014 Copy Password File from Primary to Standby<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> The SYS password must be identical on primary and standby for redo transport authentication. The easiest way to ensure this is to copy the primary&#8217;s password file directly to the standby. Never create a new password file on the standby \u2014 always copy from primary.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># From PRIMARY server \u2014 copy password file to standby\n# Convention A\nscp $ORACLE_HOME\/dbs\/orapwORCL \\\n    oracle@dbserver02:$ORACLE_HOME\/dbs\/orapwORCL_STBY\n\n# Convention B\nscp $ORACLE_HOME\/dbs\/orapwORCL \\\n    oracle@dbserver02:\/oracle\/RDBMS\/19.31Standby\/dbs\/orapwORCL_STBY\n\n# Verify on STANDBY\nls -lh $ORACLE_HOME\/dbs\/orapwORCL_STBY<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">6.3 \u2014 Create Standby init.ora Parameter File<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> The standby database needs a minimal init.ora to start in NOMOUNT state so RMAN can connect to it and create the standby database. This is a temporary minimal file \u2014 the full spfile will be created by RMAN during standby creation.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># On STANDBY server as oracle user\nvi $ORACLE_HOME\/dbs\/initORCL_STBY.ora<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add the following minimal parameters:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># -------------------------------------------------------\n# Minimal init.ora for standby \u2014 used only during RMAN duplicate\n# This file is temporary \u2014 RMAN will create the real spfile\n# -------------------------------------------------------\n\n# DB_NAME must match primary DB_NAME exactly\nDB_NAME=ORCL\n\n# DB_UNIQUE_NAME must be different from primary\nDB_UNIQUE_NAME=ORCL_STBY\n\n# SGA size \u2014 set to a reasonable value for your server memory\nSGA_TARGET=1G\nPGA_AGGREGATE_TARGET=512M\n\n# Control file location \u2014 will be created by RMAN\nDB_FILE_NAME_CONVERT='\/u01\/app\/oracle\/oradata\/ORCL','\/u01\/app\/oracle\/oradata\/ORCL_STBY'\nLOG_FILE_NAME_CONVERT='\/u01\/app\/oracle\/oradata\/ORCL','\/u01\/app\/oracle\/oradata\/ORCL_STBY'\n\n# Diagnostic and audit directories\nDIAGNOSTIC_DEST=\/u01\/app\/oracle\nAUDIT_FILE_DEST=\/u01\/app\/oracle\/admin\/ORCL_STBY\/adump\n\n# Standby role parameters\nSTANDBY_FILE_MANAGEMENT=AUTO\nFAL_SERVER=ORCL\nFAL_CLIENT=ORCL_STBY\nLOG_ARCHIVE_CONFIG='DG_CONFIG=(ORCL,ORCL_STBY)'\nLOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ORCL_STBY'\nLOG_ARCHIVE_DEST_2='SERVICE=ORCL ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ORCL'\nLOG_ARCHIVE_DEST_STATE_1=ENABLE\nLOG_ARCHIVE_DEST_STATE_2=ENABLE\nREMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE\nDB_RECOVERY_FILE_DEST=\/u01\/app\/oracle\/fast_recovery_area\nDB_RECOVERY_FILE_DEST_SIZE=50G<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Convention B \u2014 adjust paths:<\/strong><\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>DB_FILE_NAME_CONVERT='\/oracle\/oradata\/ORCL','\/oracle\/oradata\/ORCL_STBY'\nLOG_FILE_NAME_CONVERT='\/oracle\/oradata\/ORCL','\/oracle\/oradata\/ORCL_STBY'\nDIAGNOSTIC_DEST=\/oracle\nAUDIT_FILE_DEST=\/oracle\/admin\/ORCL_STBY\/adump\nDB_RECOVERY_FILE_DEST=\/oracle\/fast_recovery_area<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">6.4 \u2014 Configure tnsnames.ora on Standby Server<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> The standby needs TNS entries for both itself and the primary so it can resolve service names during log shipping, FAL requests, and Data Guard Broker operations.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># Edit tnsnames.ora on STANDBY server\nvi $ORACLE_HOME\/network\/admin\/tnsnames.ora<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add the same entries as on primary:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># -------------------------------------------------------\n# TNS Entries for Data Guard Configuration\n# Add these on STANDBY server\n# -------------------------------------------------------\n\n# Primary database TNS entry\nORCL =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver01.company.com)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = ORCL)\n      (UR = A)\n    )\n  )\n\n# Standby database TNS entry\nORCL_STBY =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver02.company.com)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = ORCL_STBY)\n      (UR = A)\n    )\n  )<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">6.5 \u2014 Configure listener.ora on Standby Server<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> Same reason as primary \u2014 static listener entry ensures RMAN can connect to the standby during creation when the database is in NOMOUNT state. Without static entry the RMAN duplicate will fail because the listener cannot route connections to a NOMOUNT database.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># Edit listener.ora on STANDBY server\nvi $ORACLE_HOME\/network\/admin\/listener.ora<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># -------------------------------------------------------\n# Listener configuration \u2014 STANDBY SERVER \u2014 dbserver02\n# -------------------------------------------------------\n\nLISTENER =\n  (DESCRIPTION_LIST =\n    (DESCRIPTION =\n      (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver02.company.com)(PORT = 1521))\n      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))\n    )\n  )\n\n# Static entry \u2014 allows RMAN and DG Broker to connect in NOMOUNT\/MOUNT state\nSID_LIST_LISTENER =\n  (SID_LIST =\n    (SID_DESC =\n      (GLOBAL_DBNAME = ORCL_STBY)\n      (ORACLE_HOME   = \/u01\/app\/oracle\/product\/19.3.0\/dbhome_1)\n      (SID_NAME      = ORCL_STBY)\n    )\n    (SID_DESC =\n      (GLOBAL_DBNAME = ORCL_STBY_DGMGRL)\n      (ORACLE_HOME   = \/u01\/app\/oracle\/product\/19.3.0\/dbhome_1)\n      (SID_NAME      = ORCL_STBY)\n    )\n  )<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># Start listener on standby\nlsnrctl start\nlsnrctl status<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">6.6 \u2014 Start Standby Instance in NOMOUNT<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why NOMOUNT?<\/strong> RMAN active duplicate will connect to the standby instance and create the control file and all database files from scratch. For this the standby instance must be running in NOMOUNT state \u2014 it has started using the minimal init.ora we created but no database files exist yet.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># On STANDBY server as oracle user\nexport ORACLE_SID=ORCL_STBY\nsqlplus \/ as sysdba<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Start in NOMOUNT using the minimal init.ora\nSTARTUP NOMOUNT PFILE='$ORACLE_HOME\/dbs\/initORCL_STBY.ora';\n\n-- Verify instance is in NOMOUNT state\nSELECT status FROM v$instance;\n-- Must show: STARTED\nEXIT;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">6.7 \u2014 Test RMAN Connection from Primary to Standby (Connectivity Test)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># From PRIMARY server \u2014 test RMAN can reach standby\nrman target sys\/Oracle_123@ORCL auxiliary sys\/Oracle_123@ORCL_STBY\n\nRMAN&gt; EXIT;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What to look for:<\/strong> Both connections must succeed. If either fails, fix the connectivity before proceeding with RMAN duplicate.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">7. Create Physical Standby Using RMAN Active Duplicate<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>What is RMAN active duplicate?<\/strong> RMAN active duplicate creates the standby database by copying the primary database directly over the network \u2014 no backup needed. RMAN connects to the running primary, reads the datafiles, and streams them directly to the standby server. This is the fastest and most common method in production.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>How long does it take?<\/strong> Depends on database size and network speed. A 500GB database over a 1Gbps link takes approximately 1-2 hours. Plan your maintenance window accordingly.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> The primary database stays OPEN and fully operational during RMAN active duplicate. No downtime on primary.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">7.1 \u2014 Run RMAN Active Duplicate from Primary<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># On PRIMARY server as oracle user\n# Run the RMAN duplicate command\nrman target sys\/Oracle_123@ORCL auxiliary sys\/Oracle_123@ORCL_STBY<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">rman<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Full RMAN active duplicate command for physical standby\nDUPLICATE TARGET DATABASE\n    FOR STANDBY\n    FROM ACTIVE DATABASE\n    DORECOVER\n    SPFILE\n        PARAMETER_VALUE_CONVERT\n            '\/u01\/app\/oracle\/oradata\/ORCL',\n            '\/u01\/app\/oracle\/oradata\/ORCL_STBY'\n        SET DB_UNIQUE_NAME='ORCL_STBY'\n        SET DB_FILE_NAME_CONVERT=\n            '\/u01\/app\/oracle\/oradata\/ORCL',\n            '\/u01\/app\/oracle\/oradata\/ORCL_STBY'\n        SET LOG_FILE_NAME_CONVERT=\n            '\/u01\/app\/oracle\/oradata\/ORCL',\n            '\/u01\/app\/oracle\/oradata\/ORCL_STBY'\n        SET STANDBY_FILE_MANAGEMENT='AUTO'\n        SET FAL_SERVER='ORCL'\n        SET FAL_CLIENT='ORCL_STBY'\n        SET LOG_ARCHIVE_DEST_1=\n            'LOCATION=USE_DB_RECOVERY_FILE_DEST\n             VALID_FOR=(ALL_LOGFILES,ALL_ROLES)\n             DB_UNIQUE_NAME=ORCL_STBY'\n        SET LOG_ARCHIVE_DEST_2=\n            'SERVICE=ORCL ASYNC\n             VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)\n             DB_UNIQUE_NAME=ORCL'\n        SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(ORCL,ORCL_STBY)'\n        SET DIAGNOSTIC_DEST='\/u01\/app\/oracle'\n        SET DB_RECOVERY_FILE_DEST='\/u01\/app\/oracle\/fast_recovery_area'\n        SET DB_RECOVERY_FILE_DEST_SIZE='50G'\n        SET AUDIT_FILE_DEST='\/u01\/app\/oracle\/admin\/ORCL_STBY\/adump'\n    NOFILENAMECHECK;<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Key parameters explained:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>FOR STANDBY<\/code> \u2192 creates a physical standby (not a clone)<\/li>\n\n\n\n<li><code>FROM ACTIVE DATABASE<\/code> \u2192 copies directly from running primary (no backup needed)<\/li>\n\n\n\n<li><code>DORECOVER<\/code> \u2192 applies any redo that arrived during duplication to bring standby current<\/li>\n\n\n\n<li><code>SPFILE<\/code> with <code>SET<\/code> clauses \u2192 creates standby spfile with correct parameters<\/li>\n\n\n\n<li><code>NOFILENAMECHECK<\/code> \u2192 do not check if source and target file paths are different (needed when primary and standby use same paths)<\/li>\n\n\n\n<li><code>PARAMETER_VALUE_CONVERT<\/code> \u2192 converts primary file paths to standby paths in the spfile<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Monitor duplication progress<\/strong> in a separate terminal on primary:<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># Watch RMAN channel activity\ntail -100f \/u01\/app\/oracle\/diag\/rdbms\/orcl\/ORCL\/trace\/alert_ORCL.log \\\n     | grep -E \"rman|RMAN|copy|duplicate\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Expected completion message:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Finished Duplicate Db at DD-MON-YYYY HH24:MI:SS<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">7.2 \u2014 Add Standby Redo Logs on Standby<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> The RMAN duplicate creates the standby without Standby Redo Logs. We must add them manually. SRLs are required for real-time apply \u2014 where redo is applied to the standby as it arrives rather than after archiving.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Connect to STANDBY instance\nsqlplus \/ as sysdba\n\n-- Check current log status\nSELECT group#, sequence#, bytes\/1024\/1024 size_mb, status\nFROM   v$log\nORDER BY group#;\n\n-- Add Standby Redo Logs on STANDBY\n-- Convention A (filesystem) \u2014 match size to primary online redo logs\nALTER DATABASE ADD STANDBY LOGFILE GROUP 4\n    '\/u01\/app\/oracle\/oradata\/ORCL_STBY\/srl_redo04.log' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 5\n    '\/u01\/app\/oracle\/oradata\/ORCL_STBY\/srl_redo05.log' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 6\n    '\/u01\/app\/oracle\/oradata\/ORCL_STBY\/srl_redo06.log' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 7\n    '\/u01\/app\/oracle\/oradata\/ORCL_STBY\/srl_redo07.log' SIZE 200M;\n\n-- Convention B (ASM)\nALTER DATABASE ADD STANDBY LOGFILE GROUP 4 '+DATA' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 5 '+DATA' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 6 '+DATA' SIZE 200M;\nALTER DATABASE ADD STANDBY LOGFILE GROUP 7 '+DATA' SIZE 200M;\n\n-- Verify SRLs were added\nSELECT group#, sequence#, bytes\/1024\/1024 size_mb, used, status\nFROM   v$standby_log\nORDER BY group#;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">7.3 \u2014 Start Redo Apply on Standby<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> After RMAN creates the standby, redo apply is not automatically started. We must explicitly start it. Real-time apply (<code>USING CURRENT LOGFILE<\/code>) applies redo as it arrives in the Standby Redo Logs without waiting for archiving \u2014 this gives the lowest possible lag.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Connect to STANDBY\nsqlplus \/ as sysdba\n\n-- Start real-time apply\nALTER DATABASE RECOVER MANAGED STANDBY DATABASE\n    USING CURRENT LOGFILE\n    DISCONNECT FROM SESSION;\n\n-- Verify apply is running\nset linesize 200\nset pagesize 50\ncol process  for a12\ncol status   for a15\ncol sequence for 999999\ncol delay_mins for 999\n\nSELECT process, status, sequence#, delay_mins\nFROM   v$managed_standby\nORDER BY process;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What to look for:<\/strong> You should see <code>MRP0<\/code> process with status <code>APPLYING_LOG<\/code> or <code>WAIT_FOR_LOG<\/code>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">8. Verify Data Guard is Working<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> Never configure Data Guard Broker or hand over the environment without first verifying that redo is actually being shipped and applied. These checks confirm end-to-end Data Guard is working.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">8.1 \u2014 Check Redo Transport on Primary<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Connect to PRIMARY\nsqlplus \/ as sysdba\n\nset linesize 200\nset pagesize 100\ncol dest_id      for 999\ncol dest_name    for a20\ncol status       for a12\ncol target       for a12\ncol archiver     for a12\ncol schedule     for a10\ncol destination  for a40\ncol error        for a40\n\n-- Check archive destination status\nSELECT dest_id, dest_name, status, target,\n       archiver, schedule, destination, error\nFROM   v$archive_dest\nWHERE  dest_id IN (1,2)\nORDER BY dest_id;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What to look for:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>DEST_ID=1<\/code> (local) \u2192 status <code>VALID<\/code><\/li>\n\n\n\n<li><code>DEST_ID=2<\/code> (standby) \u2192 status <code>VALID<\/code><\/li>\n\n\n\n<li>Error column must be blank for DEST_ID=2<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">8.2 \u2014 Check Log Shipping is Working<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On PRIMARY \u2014 force a log switch and confirm it ships\nALTER SYSTEM SWITCH LOGFILE;\nALTER SYSTEM ARCHIVE LOG CURRENT;\n\n-- Check last archived sequence on primary\nSELECT thread#, max(sequence#) last_archived\nFROM   v$archived_log\nWHERE  dest_id = 1\nGROUP BY thread#;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY \u2014 check last received and applied sequence\nset linesize 200\nset pagesize 50\ncol name        for a15\ncol value       for a25\ncol time_computed for a30\n\n-- Check last applied sequence on standby\nSELECT thread#,\n       max(sequence#) last_received\nFROM   v$archived_log\nWHERE  standby_dest = 'YES'\nGROUP BY thread#;\n\n-- Check apply lag\nSELECT name, value, time_computed\nFROM   v$dataguard_stats\nWHERE  name IN ('transport lag','apply lag','apply finish time')\nORDER BY name;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What to look for:<\/strong> <code>apply lag<\/code> should be <code>+00 00:00:00<\/code> or very small (seconds). A large apply lag means redo is not being applied fast enough.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">8.3 \u2014 Check MRP Process on Standby<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY\nset linesize 200\nset pagesize 50\ncol process  for a12\ncol status   for a20\ncol client_process for a15\ncol sequence# for 999999\n\nSELECT process, status, client_process,\n       thread#, sequence#, block#\nFROM   v$managed_standby\nORDER BY process;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What to look for:<\/strong> <code>MRP0<\/code> must be present and status must be <code>APPLYING_LOG<\/code> or <code>WAIT_FOR_LOG<\/code>. If MRP0 is absent, apply has stopped.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">8.4 \u2014 Full Data Guard Status Check<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY \u2014 comprehensive DG status\nset linesize 200\nset pagesize 100\ncol name        for a30\ncol value       for a40\ncol unit        for a20\ncol time_computed for a30\n\nSELECT name, value, unit, time_computed\nFROM   v$dataguard_stats\nORDER BY name;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">9. Configure Data Guard Broker<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>What is Data Guard Broker?<\/strong> Broker is Oracle&#8217;s automated management framework for Data Guard. It monitors the configuration, automates failover (with Observer), and reduces complex switchover\/failover procedures to single commands. Using Broker is strongly recommended in production environments.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>What does Broker add?<\/strong> Without Broker, a switchover requires multiple manual SQL commands on both primary and standby in a specific sequence. With Broker, it is one command: <code>SWITCHOVER TO ORCL_STBY<\/code>. Broker also enables Fast-Start Failover (FSFO) where the standby automatically fails over without any DBA intervention.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">9.1 \u2014 Enable Data Guard Broker on Both Servers<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why enable on both?<\/strong> Broker runs a DMON (Data Guard Monitor) background process on each database. Both primary and standby must have the DG_BROKER_START parameter set to TRUE before Broker can manage them.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On PRIMARY\nsqlplus \/ as sysdba\nALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;\nSHOW PARAMETER dg_broker_start;\n\n-- On STANDBY\nsqlplus \/ as sysdba\nALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;\nSHOW PARAMETER dg_broker_start;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">9.2 \u2014 Set Broker Configuration File Location (Optional but Recommended)<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> Broker stores its configuration in two files (for redundancy). By default they go into the DB_RECOVERY_FILE_DEST. If you want them in a specific location, set this parameter.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On PRIMARY and STANDBY\nALTER SYSTEM SET DG_BROKER_CONFIG_FILE1=\n    '\/u01\/app\/oracle\/oradata\/ORCL\/dr1ORCL.dat'\n    SCOPE=BOTH;\nALTER SYSTEM SET DG_BROKER_CONFIG_FILE2=\n    '\/u01\/app\/oracle\/fast_recovery_area\/ORCL\/dr2ORCL.dat'\n    SCOPE=BOTH;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">9.3 \u2014 Create Broker Configuration Using DGMGRL<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why DGMGRL?<\/strong> DGMGRL (Data Guard Manager command line) is the interface to the Broker. All Broker operations are performed through DGMGRL. Connect to it from the primary server.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code># On PRIMARY server as oracle user\ndgmgrl sys\/Oracle_123@ORCL<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Create the Broker configuration\n-- This creates a new DG configuration and adds both databases to it\nDGMGRL&gt; CREATE CONFIGURATION 'ORCL_DG_CONFIG'\n            AS PRIMARY DATABASE IS 'ORCL'\n            CONNECT IDENTIFIER IS ORCL;\n\n-- Add the standby database to the configuration\nDGMGRL&gt; ADD DATABASE 'ORCL_STBY'\n            AS CONNECT IDENTIFIER IS ORCL_STBY\n            MAINTAINED AS PHYSICAL;\n\n-- Enable the entire configuration\n-- This starts Broker management on both primary and standby\nDGMGRL&gt; ENABLE CONFIGURATION;\n\n-- Verify configuration status\nDGMGRL&gt; SHOW CONFIGURATION;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Expected output from <code>SHOW CONFIGURATION<\/code>:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Configuration - ORCL_DG_CONFIG\n\n  Protection Mode: MaxPerformance\n  Members:\n  ORCL      - Primary database\n  ORCL_STBY - Physical standby database\n\nFast-Start Failover:  Disabled\n\nConfiguration Status:\nSUCCESS   (status updated X seconds ago)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Show detailed status of each database\nDGMGRL&gt; SHOW DATABASE VERBOSE 'ORCL';\nDGMGRL&gt; SHOW DATABASE VERBOSE 'ORCL_STBY';<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> If configuration status shows <code>WARNING<\/code> or <code>ERROR<\/code>, check the specific error with <code>SHOW DATABASE VERBOSE<\/code>. Common issues at this stage are TNS connectivity problems or password file mismatch.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">9.4 \u2014 Verify Broker Configuration is Healthy<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>DGMGRL&gt; SHOW CONFIGURATION;\nDGMGRL&gt; SHOW DATABASE 'ORCL';\nDGMGRL&gt; SHOW DATABASE 'ORCL_STBY';\n\n-- Check redo transport status\nDGMGRL&gt; SHOW DATABASE 'ORCL' 'LogXptStatus';\n\n-- Check apply status on standby\nDGMGRL&gt; SHOW DATABASE 'ORCL_STBY' 'RecvQEntries';\nDGMGRL&gt; SHOW DATABASE 'ORCL_STBY' 'ApplyLagSecs';\n\n-- Exit Broker\nDGMGRL&gt; EXIT;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">10. Switchover (Planned Role Reversal)<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>What is switchover?<\/strong> Switchover is a planned, graceful role reversal. The primary becomes the standby and the standby becomes the new primary. No data loss. Both databases are cooperative. Used for planned maintenance (patching primary, hardware upgrades).<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>With Broker (recommended):<\/strong> One command. Broker handles the entire sequence automatically.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Without Broker (manual):<\/strong> Multiple SQL commands in a specific sequence on both servers.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">10.1 \u2014 Pre-Switchover Checks<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Connect to Broker on PRIMARY\ndgmgrl sys\/Oracle_123@ORCL\n\n-- Verify configuration is healthy before switchover\nDGMGRL&gt; SHOW CONFIGURATION;\n-- Must show SUCCESS\n\n-- Verify standby is ready for switchover\nDGMGRL&gt; VALIDATE DATABASE 'ORCL_STBY';\n-- Look for: Ready for Switchover: Yes<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Also verify on STANDBY directly\nsqlplus \/ as sysdba\n\n-- Check apply lag \u2014 should be 0 or very small before switchover\nSELECT name, value\nFROM   v$dataguard_stats\nWHERE  name IN ('transport lag','apply lag');\n\n-- MRP must be running\nSELECT process, status, sequence#\nFROM   v$managed_standby\nWHERE  process = 'MRP0';<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">10.2 \u2014 Perform Switchover Using Broker (Recommended)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Connect to Broker from PRIMARY\ndgmgrl sys\/Oracle_123@ORCL\n\n-- Switchover to standby\n-- Broker automatically:\n-- 1. Flushes all remaining redo from primary to standby\n-- 2. Shuts down primary as primary, converts it to standby\n-- 3. Activates standby as new primary\n-- 4. Starts apply on old primary (now standby)\nDGMGRL&gt; SWITCHOVER TO 'ORCL_STBY';\n\n-- This takes 1-5 minutes \u2014 monitor progress\n-- After completion verify new configuration\nDGMGRL&gt; SHOW CONFIGURATION;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Expected output after successful switchover:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Configuration - ORCL_DG_CONFIG\n\n  Protection Mode: MaxPerformance\n  Members:\n  ORCL_STBY - Primary database\n  ORCL      - Physical standby database\n\nConfiguration Status:\nSUCCESS<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">10.3 \u2014 Perform Switchover Manually (Without Broker)<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Use this only if Broker is not configured.<\/strong><\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- STEP 1: On PRIMARY \u2014 initiate switchover\nsqlplus \/ as sysdba\n\n-- Verify switchover is possible\nSELECT switchover_status FROM v$database;\n-- Must show: TO STANDBY or SESSIONS ACTIVE\n\n-- If SESSIONS ACTIVE \u2014 disconnect active sessions first\nALTER SYSTEM SWITCH LOGFILE;\n\n-- Initiate switchover on primary\nALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;\n\n-- Primary is now in standby role \u2014 start it as standby\nSHUTDOWN IMMEDIATE;\nSTARTUP MOUNT;\nALTER DATABASE RECOVER MANAGED STANDBY DATABASE\n    USING CURRENT LOGFILE DISCONNECT FROM SESSION;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-- STEP 2: On STANDBY \u2014 activate as new primary\nsqlplus \/ as sysdba\n\n-- Verify standby is ready\nSELECT switchover_status FROM v$database;\n-- Must show: TO PRIMARY or SESSIONS ACTIVE\n\n-- Switch standby to primary role\nALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;\n\n-- Open as new primary\nALTER DATABASE OPEN;\n\n-- Verify new primary is open\nSELECT name, db_unique_name, open_mode FROM v$database;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">10.4 \u2014 Post-Switchover Verification<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On NEW PRIMARY (was standby) \u2014 dbserver02\nsqlplus \/ as sysdba\n\nset linesize 150\nset pagesize 50\ncol name           for a12\ncol db_unique_name for a15\ncol open_mode      for a15\ncol database_role  for a20\n\nSELECT name, db_unique_name, open_mode, database_role\nFROM   v$database;\n-- Must show: database_role = PRIMARY, open_mode = READ WRITE<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On NEW STANDBY (was primary) \u2014 dbserver01\nsqlplus \/ as sysdba\n\nSELECT name, db_unique_name, open_mode, database_role\nFROM   v$database;\n-- Must show: database_role = PHYSICAL STANDBY\n\n-- Verify MRP is running on new standby\nSELECT process, status, sequence#\nFROM   v$managed_standby\nWHERE  process = 'MRP0';<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">11. Failover (Unplanned \u2014 Primary Has Failed)<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>When to use?<\/strong> Only when the primary database has failed and cannot be recovered quickly. Failover is irreversible without reinstating the old primary. It results in the standby becoming the new permanent primary.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> Always attempt to connect to the primary and recover it BEFORE initiating a failover. Failover should be a last resort \u2014 not the first response to a primary outage.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">11.1 \u2014 Verify Primary is Truly Unavailable<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># Try to connect to primary\nping dbserver01\nsqlplus sys\/Oracle_123@ORCL as sysdba\n\n# If connection fails \u2014 confirm primary is truly down before failover\n# Contact server\/infrastructure team to confirm<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">11.2 \u2014 Check Standby Apply Status Before Failover<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY\nsqlplus \/ as sysdba\n\n-- Check how much redo has been applied\nSELECT thread#, max(sequence#) last_applied\nFROM   v$log_history\nGROUP BY thread#;\n\n-- Check if any redo is still in transit\nSELECT process, status, sequence#\nFROM   v$managed_standby\nORDER BY process;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">11.3 \u2014 Perform Failover Using Broker (Recommended)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Connect to Broker on STANDBY (primary is down)\ndgmgrl sys\/Oracle_123@ORCL_STBY\n\n-- Complete failover \u2014 applies all available redo then activates\n-- This is the safest failover option \u2014 minimizes data loss\nDGMGRL&gt; FAILOVER TO 'ORCL_STBY' IMMEDIATE;\n\n-- Verify new configuration\nDGMGRL&gt; SHOW CONFIGURATION;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">11.4 \u2014 Perform Failover Manually (Without Broker)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY as sysdba\nsqlplus \/ as sysdba\n\n-- Stop MRP before failover\nALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;\n\n-- Apply any remaining redo logs available on standby\nRECOVER STANDBY DATABASE;\n\n-- Activate standby as primary\nALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE;\n\n-- Open the new primary\nALTER DATABASE OPEN;\n\n-- Verify\nSELECT name, db_unique_name, open_mode, database_role\nFROM   v$database;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">11.5 \u2014 Reinstate Old Primary as New Standby<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why reinstate?<\/strong> After a failover, you have a new primary (was standby) but no standby. The old primary server needs to be converted into a standby of the new primary. This is called reinstating.<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Prerequisite:<\/strong> The old primary server must be reachable. If the hardware is completely dead, you must build a new standby from scratch using RMAN.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Connect to Broker on NEW PRIMARY (was standby)\ndgmgrl sys\/Oracle_123@ORCL_STBY\n\n-- Reinstate old primary as new standby\n-- Broker automatically flashes back old primary and converts it to standby\nDGMGRL&gt; REINSTATE DATABASE 'ORCL';\n\n-- Verify configuration shows both databases\nDGMGRL&gt; SHOW CONFIGURATION;<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>If FLASHBACK DATABASE was enabled on old primary<\/strong>, Broker uses it to rewind the old primary to a point before the failover and convert it to a standby. If flashback was not enabled, the old primary must be rebuilt using RMAN duplicate.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">12. Post-Configuration Checks<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>IMPORTANT:<\/strong> Run all post-configuration checks after initial setup, after switchover, and after failover to confirm Data Guard is fully healthy.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">12.1 \u2014 Check Primary Database Status<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On PRIMARY\nsqlplus \/ as sysdba\n\nset linesize 200\nset pagesize 50\ncol name           for a12\ncol db_unique_name for a15\ncol open_mode      for a15\ncol database_role  for a20\ncol protection_mode for a22\ncol force_logging  for a5\n\nSELECT name, db_unique_name, open_mode,\n       database_role, protection_mode, force_logging\nFROM   v$database;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">12.2 \u2014 Check Standby Database Status<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY\nsqlplus \/ as sysdba\n\nset linesize 200\nset pagesize 50\ncol name           for a12\ncol db_unique_name for a15\ncol open_mode      for a15\ncol database_role  for a20\n\nSELECT name, db_unique_name, open_mode, database_role\nFROM   v$database;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">12.3 \u2014 Check Redo Apply Status and Lag<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY\nset linesize 200\nset pagesize 100\ncol name          for a30\ncol value         for a40\ncol unit          for a20\ncol time_computed for a30\n\nSELECT name, value, unit, time_computed\nFROM   v$dataguard_stats\nORDER BY name;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Key metrics to check:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table><thead><tr><th>Metric<\/th><th>Acceptable Value<\/th><th>Action if Not<\/th><\/tr><\/thead><tbody><tr><td>apply lag<\/td><td>0 or seconds<\/td><td>Check MRP, check network, check archivelog gaps<\/td><\/tr><tr><td>transport lag<\/td><td>0 or seconds<\/td><td>Check LOG_ARCHIVE_DEST_2, check network<\/td><\/tr><tr><td>apply finish time<\/td><td>Near zero<\/td><td>Apply backlog \u2014 may need to tune apply<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">12.4 \u2014 Check MRP Process on Standby<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY\nset linesize 180\nset pagesize 50\ncol process        for a12\ncol status         for a20\ncol client_process for a15\ncol sequence#      for 999999\ncol block#         for 999999\n\nSELECT process, status, client_process,\n       thread#, sequence#, block#, delay_mins\nFROM   v$managed_standby\nORDER BY process;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">12.5 \u2014 Check Archive Log Gap<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> An archive log gap means the standby is missing some archivelogs from the primary. This causes the standby to be behind and potentially unable to apply future redo. Gaps must be resolved immediately.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY \u2014 check for gaps\nset linesize 150\nset pagesize 50\ncol low_sequence# for 999999\ncol high_sequence# for 999999\n\nSELECT thread#, low_sequence#, high_sequence#\nFROM   v$archive_gap;\n\n-- No rows = no gaps (good)\n-- If rows exist = gap detected \u2014 standby will automatically request FAL to fill gap<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">12.6 \u2014 Verify Broker Configuration Status<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>-- From PRIMARY or STANDBY\ndgmgrl sys\/Oracle_123@ORCL\n\nDGMGRL&gt; SHOW CONFIGURATION;\nDGMGRL&gt; SHOW DATABASE VERBOSE 'ORCL';\nDGMGRL&gt; SHOW DATABASE VERBOSE 'ORCL_STBY';\nDGMGRL&gt; SHOW DATABASE 'ORCL_STBY' 'ApplyLagSecs';\nDGMGRL&gt; SHOW DATABASE 'ORCL_STBY' 'TransportLagSecs';\nDGMGRL&gt; EXIT;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">12.7 \u2014 Check Alert Logs on Both Servers<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># PRIMARY alert log\ntail -200 \/u01\/app\/oracle\/diag\/rdbms\/orcl\/ORCL\/trace\/alert_ORCL.log \\\n     | grep -E \"ORA-|Error|WARNING|Gap|ARC|MRP\"\n\n# STANDBY alert log\ntail -200 \/u01\/app\/oracle\/diag\/rdbms\/orcl_stby\/ORCL_STBY\/trace\/alert_ORCL_STBY.log \\\n     | grep -E \"ORA-|Error|WARNING|Gap|MRP|apply\"<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">12.8 \u2014 End-to-End Test \u2014 Create Object on Primary, Verify on Standby<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udcdd <strong>Why?<\/strong> This is the ultimate proof that Data Guard is working \u2014 create a test object on the primary and confirm it appears on the standby within seconds.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On PRIMARY \u2014 create a test table\nsqlplus system\/Oracle_123@ORCL\n\nCREATE TABLE dg_test_table (\n    test_id   NUMBER,\n    test_name VARCHAR2(50),\n    created   DATE DEFAULT SYSDATE\n);\n\nINSERT INTO dg_test_table VALUES (1, 'DG_TEST_RECORD', SYSDATE);\nCOMMIT;\n\n-- Force archivelog to ship immediately\nALTER SYSTEM SWITCH LOGFILE;\nALTER SYSTEM ARCHIVE LOG CURRENT;\n\nSELECT * FROM dg_test_table;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>-- On STANDBY \u2014 wait 30 seconds then check\n-- Open standby read-only temporarily (Active Data Guard license required)\n-- OR check via v$dataguard_stats that sequence has been applied\n\n-- Without Active DG license \u2014 check via sequence numbers\n-- On PRIMARY:\nSELECT thread#, max(sequence#) FROM v$archived_log\nWHERE  dest_id = 1 GROUP BY thread#;\n\n-- On STANDBY \u2014 same sequence should be applied\nSELECT thread#, max(sequence#) FROM v$archived_log\nWHERE  standby_dest = 'YES' GROUP BY thread#;\n\n-- Numbers must match \u2014 confirming standby received and applied the archivelog\n-- containing our test table creation<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">13. Quick Reference Card<\/h3>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table><thead><tr><th>Task<\/th><th>Command<\/th><\/tr><\/thead><tbody><tr><td>Check archive mode<\/td><td><code>SELECT log_mode FROM v$database;<\/code><\/td><\/tr><tr><td>Enable archivelog<\/td><td><code>STARTUP MOUNT; ALTER DATABASE ARCHIVELOG; ALTER DATABASE OPEN;<\/code><\/td><\/tr><tr><td>Enable force logging<\/td><td><code>ALTER DATABASE FORCE LOGGING;<\/code><\/td><\/tr><tr><td>Add SRL on primary<\/td><td><code>ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 '\/path\/srl04.log' SIZE 200M;<\/code><\/td><\/tr><tr><td>Check SRLs<\/td><td><code>SELECT group#,sequence#,bytes\/1024\/1024,status FROM v$standby_log;<\/code><\/td><\/tr><tr><td>Check DG parameters<\/td><td><code>SELECT name,value FROM v$parameter WHERE name LIKE '%archive%';<\/code><\/td><\/tr><tr><td>Copy password file<\/td><td><code>scp $OH\/dbs\/orapwORCL oracle@standby:$OH\/dbs\/orapwORCL_STBY<\/code><\/td><\/tr><tr><td>Start standby NOMOUNT<\/td><td><code>STARTUP NOMOUNT PFILE='$OH\/dbs\/initORCL_STBY.ora';<\/code><\/td><\/tr><tr><td>Test TNS connectivity<\/td><td><code>tnsping ORCL_STBY<\/code><\/td><\/tr><tr><td>RMAN duplicate<\/td><td><code>DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE DORECOVER...<\/code><\/td><\/tr><tr><td>Start MRP<\/td><td><code>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;<\/code><\/td><\/tr><tr><td>Stop MRP<\/td><td><code>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;<\/code><\/td><\/tr><tr><td>Check MRP status<\/td><td><code>SELECT process,status,sequence# FROM v$managed_standby;<\/code><\/td><\/tr><tr><td>Check apply lag<\/td><td><code>SELECT name,value FROM v$dataguard_stats WHERE name='apply lag';<\/code><\/td><\/tr><tr><td>Check archive gap<\/td><td><code>SELECT thread#,low_sequence#,high_sequence# FROM v$archive_gap;<\/code><\/td><\/tr><tr><td>Check dest status<\/td><td><code>SELECT dest_id,status,error FROM v$archive_dest WHERE dest_id&lt;=2;<\/code><\/td><\/tr><tr><td>Check DG stats<\/td><td><code>SELECT name,value,unit FROM v$dataguard_stats;<\/code><\/td><\/tr><tr><td>Enable Broker<\/td><td><code>ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;<\/code><\/td><\/tr><tr><td>Connect Broker<\/td><td><code>dgmgrl sys\/password@ORCL<\/code><\/td><\/tr><tr><td>Show DG config<\/td><td><code>DGMGRL&gt; SHOW CONFIGURATION;<\/code><\/td><\/tr><tr><td>Show DB details<\/td><td><code>DGMGRL&gt; SHOW DATABASE VERBOSE 'ORCL_STBY';<\/code><\/td><\/tr><tr><td>Validate standby<\/td><td><code>DGMGRL&gt; VALIDATE DATABASE 'ORCL_STBY';<\/code><\/td><\/tr><tr><td>Switchover (Broker)<\/td><td><code>DGMGRL&gt; SWITCHOVER TO 'ORCL_STBY';<\/code><\/td><\/tr><tr><td>Failover (Broker)<\/td><td><code>DGMGRL&gt; FAILOVER TO 'ORCL_STBY' IMMEDIATE;<\/code><\/td><\/tr><tr><td>Reinstate old primary<\/td><td><code>DGMGRL&gt; REINSTATE DATABASE 'ORCL';<\/code><\/td><\/tr><tr><td>Check primary role<\/td><td><code>SELECT db_unique_name,database_role,open_mode FROM v$database;<\/code><\/td><\/tr><tr><td>Check standby role<\/td><td><code>SELECT db_unique_name,database_role,open_mode FROM v$database;<\/code><\/td><\/tr><tr><td>Primary alert log<\/td><td><code>tail -200 $DIAG\/rdbms\/orcl\/ORCL\/trace\/alert_ORCL.log | grep ORA-<\/code><\/td><\/tr><tr><td>Standby alert log<\/td><td><code>tail -200 $DIAG\/rdbms\/orcl_stby\/ORCL_STBY\/trace\/alert_ORCL_STBY.log | grep ORA-<\/code><\/td><\/tr><tr><td>MOS DG Best Practices<\/td><td>Doc ID 1349977.1<\/td><\/tr><tr><td>MOS DG Known Issues<\/td><td>Doc ID 2285557.1<\/td><\/tr><tr><td>MOS Broker Config<\/td><td>Doc ID 1569287.1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">This SOP covers everything you need to configure Oracle Data Guard 19c from scratch without referring to any other source. Always verify FORCE LOGGING and ARCHIVELOG mode on primary before starting, always copy the password file from primary to standby, run the end-to-end test after configuration to confirm redo is flowing, and always use Data Guard Broker in production for reliable switchover and failover operations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A complete production-ready SOP for configuring Oracle Data Guard 19c from scratch. Covers primary database preparation, standby database creation using RMAN active duplicate, Data Guard Broker configuration, switchover, failover, reinstate, and full validation \u2014 with real commands, expected outputs, and consultant-level notes for both standard OFA and enterprise custom path conventions. 1. Document Info Item [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5784,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowu461DA:productID":"","footnotes":""},"categories":[1534],"tags":[],"class_list":["post-5764","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oracle-sop"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/5764","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/comments?post=5764"}],"version-history":[{"count":2,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/5764\/revisions"}],"predecessor-version":[{"id":5815,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/5764\/revisions\/5815"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media\/5784"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=5764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=5764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/tags?post=5764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}