{"id":93,"date":"2008-09-29T18:03:36","date_gmt":"2008-09-29T22:03:36","guid":{"rendered":"http:\/\/www.dev-notes.com\/blog\/2008\/09\/29\/oracle-11g-data-guard-switchover-failover-quick-step-by-step-guide\/"},"modified":"2008-09-29T18:03:36","modified_gmt":"2008-09-29T22:03:36","slug":"oracle-11g-data-guard-switchover-failover-quick-step-by-step-guide","status":"publish","type":"post","link":"https:\/\/www.dev-notes.com\/blog\/2008\/09\/29\/oracle-11g-data-guard-switchover-failover-quick-step-by-step-guide\/","title":{"rendered":"Oracle 11g Data Guard switchover\/failover quick step-by-step guide"},"content":{"rendered":"<p><b>Assumptions<\/b><\/p>\n<p>In this sample, it is assumed that you already have your Oracle 11g primary database functioning, and have already set up a Oracle 11g physical standby database, and can access them using the Data Guard Command-Line Interface (dgmgrl) utility.  The current primary database will be referred to as &#8220;orcl1&#8221; and the current physical standby database will be referred to as &#8220;orcl2&#8221;.  The SID for both primary and standby is &#8220;orclsid&#8221;.  The current primary host is &#8220;host1&#8221; and the standby host is &#8220;host2&#8221;.<\/p>\n<p><b>Switchover\/Failover Procedures<\/b><\/p>\n<p>First, launch the Data Guard Command-Line Interface and connect to the database.<\/p>\n<pre class=\"code\">\n[oracle@host1 ~]$ dgmgrl\nDGMGRL for Linux: Version 11.1.0.6.0 - Production\n\nCopyright (c) 2000, 2005, Oracle. All rights reserved.\n\nWelcome to DGMGRL, type \"help\" for information.\nDGMGRL> connect sys@orcl1\nPassword:\nConnected.\n<\/pre>\n<p>Then, issue switchover or failover command depending on your situation.  Generally, a switchover is used to willingly pass the role of the primary database to the physical standby database (or, one of the physical standby databases), while a failover is typically done only when a major problem prevents you from normally using the primary database.  Below is what you may see when you perform a switch over.<\/p>\n<pre class=\"code\">\nDGMGRL> switchover to orcl2\nPerforming switchover NOW. Please wait...\nOperation requires shutdown of instance \"orclsid\" on database \"orcl1\".\nShutting down instance \"orclsid\"...\nORA-01109: database not open\n\nDatabase dismounted.\nORACLE instance shut down.\nOperation requires shutdown of instance \"orclsid\" on database \"orcl2\".\nShutting down instance \"orclsid\"...\ndatabase not mounted\nORACLE instance shut down.\nOperation requires startup of instance \"orclsid\" on database \"orcl1\".\nStarting instance \"orclsid\"...\nORACLE instance started.\nDatabase mounted.\nOperation requires startup of instance \"orclsid\" on database \"orcl2\".\nStarting instance \"orclsid\"...\nORACLE instance started.\nDatabase mounted.\nSwitchover succeeded. New primary is \"orcl2\"\n<\/pre>\n<p>And in the case of a failover&#8230;<\/p>\n<pre class=\"code\">\nDGMGRL> failover to orcl2\nPerforming failover NOW, please wait...\nFailover succeeded, new primary is \"orcl2\"\n<\/pre>\n<p>To confirm Data Guard switchover or failover has completed successfully, log in to Data Guard Command-Line Interface and issue the &#8220;show configuration&#8221; command.<\/p>\n<pre class=\"code\">\n[oracle@host2 ~]$ dgmgrl\nDGMGRL for Linux: Version 11.1.0.6.0 - Production\n\nCopyright (c) 2000, 2005, Oracle. All rights reserved.\n\nWelcome to DGMGRL, type \"help\" for information.\nDGMGRL> connect sys@orcl2\nPassword:\nConnected.\nDGMGRL> show configuration\n\nConfiguration\n  Name:                DRSolution\n  Enabled:             YES\n  Protection Mode:     MaxAvailability\n  Databases:\n    orcl2 - Primary database\n    orcl1 - Physical standby database\n\nFast-Start Failover: DISABLED\n\nCurrent status for \"DRSolution\":\nSUCCESS\n<\/pre>\n<p>The above sample shows what the display would look like after a switchover.  In the case of a failover, the physical standby database will show as &#8220;disabled&#8221; as below.<\/p>\n<pre class=\"code\">\nDGMGRL> show configuration\n\nConfiguration\n  Name:                DRSolution\n  Enabled:             YES\n  Protection Mode:     MaxAvailability\n  Databases:\n    orcl2 - Primary database\n    orcl1 - Physical standby database (disabled)\n\nFast-Start Failover: DISABLED\n\nCurrent status for \"DRSolution\":\nWarning: ORA-16608: one or more databases have warnings\n<\/pre>\n<p>As an additional note, as the former physical standby database of orcl2 is now operating as your new primary database, you may wish to use Enterprise Manager to help you manage orcl2.  If that is the case, you will need to perform the following to recreate the DBControl repository to enable Enterprise Manager on host2.<\/p>\n<pre class=\"code\">\n[oracle@host2 ~]$ emca -config dbcontrol db -repos recreate\nSTARTED EMCA at Sep 29, 2008 2:02:40 PM\nEM Configuration Assistant, Version 11.1.0.5.0 Production\nCopyright (c) 2003, 2005, Oracle.  All rights reserved.\n\nEnter the following information:\nDatabase SID: orclsid\nDatabase Control is already configured for the database orclsid\nYou have chosen to configure Database Control for managing the database orclsid\nThis will remove the existing configuration and the default settings and perform a fresh configuration\nDo you wish to continue? [yes(Y)\/no(N)]:\n<\/pre>\n<p>At this point, you should have your former physical standby database orcl2 running fully as your primary database server.<\/p>\n<p>After a failover, the physical standby database will not be present in your current setup.  In the case that the failed database could be brought back, issue the following command in Data Guard Command-Line Interface to reinstate the failed database as a physical standby database.<\/p>\n<pre class=\"code\">\nDGMGRL> reinstate database orcl1\nReinstating database \"orcl1\", please wait...\nOperation requires shutdown of instance \"orclsid\" on database \"orcl1\"\nShutting down instance \"orclsid\"...\nDatabase closed.\nDatabase dismounted.\nORACLE instance shut down.\nOperation requires startup of instance \"orclsid\" on database \"orcl1\"\nStarting instance \"orclsid\"...\nORACLE instance started.\nDatabase mounted.\nContinuing to reinstate database \"orcl1\" ...\nOperation requires shutdown of instance \"orclsid\" on database \"orcl1\"\nShutting down instance \"orclsid\"...\nORA-01109: database not open\n\nDatabase dismounted.\nORACLE instance shut down.\nOperation requires startup of instance \"orclsid\" on database \"orcl1\"\nStarting instance \"orclsid\"...\nORACLE instance started.\nDatabase mounted.\nContinuing to reinstate database \"orcl1\" ...\nReinstatement of database \"orcl1\" succeeded\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This sample provides a very quick step-by-step guide on how to use the Oracle Data Guard Command-Line Interface (dgmgrl) to perform a switchover or a failover between two Oracle 11g databases set up as primary and standby servers.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-oracle"],"_links":{"self":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":0,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}