{"id":2276,"date":"2025-01-19T08:11:42","date_gmt":"2025-01-19T08:11:42","guid":{"rendered":"https:\/\/w3buddy.com\/?p=2276"},"modified":"2026-01-15T13:19:11","modified_gmt":"2026-01-15T07:49:11","slug":"oracle-data-guard-features-configuration-best-practices","status":"publish","type":"post","link":"https:\/\/w3buddy.com\/blog\/oracle-data-guard-features-configuration-best-practices\/","title":{"rendered":"Oracle Data Guard: Features, Configuration &amp; Best Practices"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Oracle Data Guard is a powerful feature for database high availability, disaster recovery, and data protection. This guide provides a detailed walkthrough of its features, types of standby databases, processes involved, configuration steps, and key commands. By the end of this post, you&#8217;ll have a deep understanding of Oracle Data Guard and how to manage it efficiently.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Main Uses of Standby Databases<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Use Case<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>High Availability<\/strong><\/td><td>Ensures continuous availability of the database.<\/td><\/tr><tr><td><strong>Data Protection<\/strong><\/td><td>Safeguards data through redundancy.<\/td><\/tr><tr><td><strong>Disaster Recovery<\/strong><\/td><td>Provides recovery options during catastrophic events.<\/td><\/tr><tr><td><strong>Backup Management<\/strong><\/td><td>Facilitates backups from standby databases.<\/td><\/tr><tr><td><strong>Reporting<\/strong><\/td><td>Offloads reporting tasks to standby databases.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Types of Standby Databases<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Type<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Physical Standby<\/strong><\/td><td>&#8211; Exact block-for-block copy of the primary database.<br>&#8211; Maintained using <strong>REDO-APPLY<\/strong>.<\/td><\/tr><tr><td><strong>Logical Standby<\/strong><\/td><td>&#8211; Converts data from the primary into SQL statements.<br>&#8211; Maintained using <strong>SQL-APPLY<\/strong> (LSP process applies redo).<\/td><\/tr><tr><td><strong>Snapshot Standby<\/strong><\/td><td>&#8211; A fully updatable standby database converted from a physical standby.<\/td><\/tr><tr><td><strong>Cascaded Standby<\/strong><\/td><td>&#8211; Receives redo logs from another standby to reduce primary system load.<\/td><\/tr><tr><td><strong>Active Data Guard<\/strong><\/td><td>&#8211; Physical standby in read-only mode while applying redo.<br>&#8211; Enables reporting and RMAN backups on standby, offloading production load.<\/td><\/tr><tr><td><strong>Transient Logical Standby<\/strong><\/td><td>&#8211; Supports rolling database upgrades by temporarily converting a physical standby to a logical standby.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Redo Transport Services<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Type<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Synchronous<\/strong><\/td><td>&#8211; Guarantees <strong>Zero Data Loss<\/strong>.<br>&#8211; Primary commits changes only after <strong>LNS<\/strong> confirms redo write on standby.<\/td><\/tr><tr><td><strong>Asynchronous<\/strong><\/td><td>&#8211; Does not guarantee <strong>Zero Data Loss<\/strong>.<br>&#8211; <strong>LGWR<\/strong> does not wait for <strong>LNS<\/strong> confirmation.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Apply Services<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Type<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Real-time Apply<\/strong><\/td><td>&#8211; Used in physical standby databases.<br>&#8211; Applies changes as they are received without waiting for archiving.<\/td><\/tr><tr><td><strong>SQL Apply<\/strong><\/td><td>&#8211; Converts redo data into SQL statements and applies them on a logical standby database.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Role Transitions<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Type<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Switchover<\/strong><\/td><td>&#8211; Switches roles between primary and standby.<br>&#8211; No data loss occurs.<\/td><\/tr><tr><td><strong>Failover<\/strong><\/td><td>&#8211; Promotes standby to primary in case of primary failure.<br>&#8211; Risk of data loss if in MAXIMUM performance mode.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Affirm and Noaffirm<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Type<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Affirm<\/strong><\/td><td>&#8211; Ensures redo is written to the standby\u2019s disks.<\/td><\/tr><tr><td><strong>Noaffirm<\/strong><\/td><td>&#8211; Ensures redo is received by one of the standby databases.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Protection Modes<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Mode<\/strong><\/th><th><strong>Transport Method<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Maximum Protection<\/strong><\/td><td>SYNC \/ LGWR<\/td><td>&#8211; Guarantees <strong>Zero Data Loss<\/strong>.<br>&#8211; Shuts down primary if redo cannot be written to standby.<\/td><\/tr><tr><td><strong>Maximum Availability<\/strong><\/td><td>SYNC \/ LGWR<\/td><td>&#8211; Operates like MAXIMUM PROTECTION but allows primary to continue if standby synchronization fails temporarily.<\/td><\/tr><tr><td><strong>Maximum Performance<\/strong><\/td><td>ASYNC \/ LGWR \/ ARCH<\/td><td>&#8211; Focuses on performance, with minimal data loss in normal operation.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Physical Standby Database Related Processes<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Database<\/strong><\/th><th><strong>Process<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Primary Database<\/strong><\/td><td><strong>LGWR<\/strong><\/td><td>Log Writer flushes log buffers from the SGA to Online Redo Log files.<\/td><\/tr><tr><td><\/td><td><strong>LNS<\/strong><\/td><td>LogWriter Network Service reads redo flushed by LGWR and sends it over the network to the standby.<\/td><\/tr><tr><td><\/td><td><strong>ARCH<\/strong><\/td><td>Archives Online Redo Log (ORL) files to archive log files.<\/td><\/tr><tr><td><strong>Standby Database<\/strong><\/td><td><strong>RFS<\/strong><\/td><td>Remote File Server receives redo from the primary, writes it to Standby Redo Log (SRL) files.<\/td><\/tr><tr><td><\/td><td><strong>ARCH<\/strong><\/td><td>Archives SRL files into archived log files, similar to primary database.<\/td><\/tr><tr><td><\/td><td><strong>MRP<\/strong><\/td><td>Managed Recovery Process coordinates media recovery management.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Data Guard Broker Configuration<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Step<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Purpose<\/strong><\/td><td>Provides unified administration for Data Guard, including switchover and failover.<\/td><\/tr><tr><td><strong>Configuration Files<\/strong><\/td><td>Maintains information in flat files, with redundant copies stored on each database in the Data Guard configuration.<\/td><\/tr><tr><td><strong>Parameters<\/strong><\/td><td>Controlled by:<br>&#8211; <code>DG_BROKER_CONFIG_FILE_1<\/code><br>&#8211; <code>DG_BROKER_CONFIG_FILE_2<\/code>.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Configuration Steps<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Step<\/strong><\/th><th><strong>Commands\/Actions<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>1. Configure Parameters<\/strong><\/td><td><strong>Primary:<\/strong><br>&#8211; <code>ALTER SYSTEM SET dg_broker_config_file_1='path';<\/code><br>&#8211; <code>ALTER SYSTEM SET dg_broker_config_file_2='path';<\/code><br>&#8211; <code>ALTER SYSTEM SET dg_broker_start=TRUE SCOPE=BOTH;<\/code><br>&#8211; <code>ALTER SYSTEM SET local_listener='';<\/code><br><strong>Standby:<\/strong><br>Repeat the same steps on the standby database.<\/td><\/tr><tr><td><strong>2. Verify TNS<\/strong><\/td><td>Ensure connectivity between the primary (<code>tns_prod<\/code>) and standby (<code>tns_stby<\/code>).<\/td><\/tr><tr><td><strong>3. Configure DGMGRL<\/strong><\/td><td><strong>Commands:<\/strong><br>&#8211; <code>dgmgrl<\/code><br>&#8211; <code>CONNECT sys\/password@tns_prod<\/code><br>&#8211; <code>CONNECT sys\/password@tns_stby<\/code><br>&#8211; <code>SHOW CONFIGURATION<\/code><\/td><\/tr><tr><td><strong>4. Create Configuration<\/strong><\/td><td><strong>Primary:<\/strong><br><code>CREATE CONFIGURATION 'PROD' AS PRIMARY DATABASE IS 'PROD_DB' CONNECT IDENTIFIER IS 'tns_prod';<\/code><br>Ensure <code>LOG_ARCHIVE_DEST_2<\/code> is empty.<\/td><\/tr><tr><td><strong>5. Add Standby<\/strong><\/td><td><code>ADD DATABASE 'DR' AS CONNECT IDENTIFIER IS 'DR';<\/code><\/td><\/tr><tr><td><strong>6. Enable Configuration<\/strong><\/td><td><code>ENABLE CONFIGURATION;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Switchover and Switchback Commands Using DGMGRL<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Action<\/strong><\/th><th><strong>Command<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Perform Switchover to Standby<\/strong><\/td><td><code>SWITCHOVER TO DR;<\/code><\/td><\/tr><tr><td><strong>Convert Standby to Snapshot Standby<\/strong><\/td><td><code>CONVERT DATABASE 'DR' TO SNAPSHOT STANDBY;<\/code><\/td><\/tr><tr><td><strong>Convert Back to Physical Standby<\/strong><\/td><td><code>CONVERT DATABASE 'DR' TO PHYSICAL STANDBY;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Useful Commands to Show Data Guard Configuration<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Command<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><code>SHOW CONFIGURATION;<\/code><\/td><td>Displays the overall Data Guard configuration.<\/td><\/tr><tr><td><code>SHOW CONFIGURATION VERBOSE;<\/code><\/td><td>Provides detailed information about the configuration.<\/td><\/tr><tr><td><code>SHOW DATABASE 'PRIM';<\/code><\/td><td>Displays details of the primary database.<\/td><\/tr><tr><td><code>SHOW DATABASE VERBOSE 'PRIM';<\/code><\/td><td>Provides detailed information about the primary database.<\/td><\/tr><tr><td><code>VALIDATE DATABASE 'PRIM';<\/code><\/td><td>Validates the primary database setup.<\/td><\/tr><tr><td><code>VALIDATE DATABASE VERBOSE 'PRIM';<\/code><\/td><td>Provides detailed validation output for the primary database.<\/td><\/tr><tr><td><code>SHOW DATABASE 'PRIM' SENDQENTRIES;<\/code><\/td><td>Shows the send queue entries for the primary database.<\/td><\/tr><tr><td><code>SHOW DATABASE 'DR' RECVQENTRIES;<\/code><\/td><td>Shows the receive queue entries for the standby database.<\/td><\/tr><tr><td><code>VALIDATE NETWORK CONFIGURATION FOR ALL;<\/code><\/td><td>Validates the network configuration for all databases<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Edit Database Properties<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Action<\/strong><\/th><th><strong>Command<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Disable Apply Mode<\/strong><\/td><td><code>EDIT DATABASE 'DR' SET STATE='APPLY-OFF';<\/code><\/td><\/tr><tr><td><strong>Disable Transport Mode<\/strong><\/td><td><code>EDIT DATABASE 'DR' SET STATE='TRANSPORT-OFF';<\/code><\/td><\/tr><tr><td><strong>Enable Apply Mode<\/strong><\/td><td><code>EDIT DATABASE 'DR' SET STATE='APPLY-ON';<\/code><\/td><\/tr><tr><td><strong>Enable Transport Mode<\/strong><\/td><td><code>EDIT DATABASE 'DR' SET STATE='TRANSPORT-ON';<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Change Protection Mode<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Action<\/strong><\/th><th><strong>Command<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Change Log Transport to Synchronous<\/strong><\/td><td><code>EDIT DATABASE 'chennai' SET PROPERTY 'LogXptMode'='SYNC';<\/code><\/td><\/tr><tr><td><\/td><td><code>EDIT DATABASE 'delhi' SET PROPERTY 'LogXptMode'='SYNC';<\/code><\/td><\/tr><tr><td><strong>Set Protection Mode to Max Availability<\/strong><\/td><td><code>EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Enable Fast-Start Failover<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Step<\/strong><\/th><th><strong>Command<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Ensure Protection Mode<\/strong><\/td><td>Set to <strong>MAX AVAILABILITY<\/strong>.<\/td><\/tr><tr><td><strong>Enable Fast-Start Failover<\/strong><\/td><td><code>ENABLE FAST_START FAILOVER;<\/code><\/td><\/tr><tr><td><strong>Show Fast-Start Failover Status<\/strong><\/td><td><code>SHOW FAST_START FAILOVER;<\/code><\/td><\/tr><tr><td><strong>Start Observer<\/strong><\/td><td><code>nohup dgmgrl sys\/oracle@orcl \"start observer file='\/home\/oracle\/fsfo.dat'\" -logfile $HOME\/observer.log &amp;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Oracle Data Guard is a powerful feature for database high availability, disaster recovery, and data protection. This guide provides a detailed walkthrough of its features, types of standby databases, processes involved, configuration steps, and key commands. By the end of this post, you&#8217;ll have a deep understanding of Oracle Data Guard and how to manage [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowu461DA:productID":"","footnotes":""},"categories":[1225],"tags":[],"class_list":["post-2276","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/2276","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=2276"}],"version-history":[{"count":1,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/2276\/revisions"}],"predecessor-version":[{"id":2278,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/2276\/revisions\/2278"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=2276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=2276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/tags?post=2276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}