{"id":4158,"date":"2025-06-08T02:35:00","date_gmt":"2025-06-08T02:35:00","guid":{"rendered":"https:\/\/w3buddy.com\/?post_type=cposts&#038;p=4158"},"modified":"2025-06-10T15:34:31","modified_gmt":"2025-06-10T15:34:31","slug":"oracle-manual-switchover-primary-%e2%9e%9d-standby-dgmgrl","status":"publish","type":"cposts","link":"https:\/\/w3buddy.com\/blog\/notes\/oracle-dba-d2d-tasks\/oracle-manual-switchover-primary-%e2%9e%9d-standby-dgmgrl\/","title":{"rendered":"Oracle Manual Switchover (Primary \u279d Standby) \u2013 DGMGRL"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A <strong>switchover<\/strong> is a planned role reversal between a <strong>primary<\/strong> and its <strong>standby<\/strong> database in a Data Guard configuration. It allows the standby database to assume the primary role without data loss, typically for <strong>maintenance<\/strong> or <strong>disaster recovery testing<\/strong>. This operation is performed while both databases are available and synchronized.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Prerequisites<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure the following before initiating the switchover:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2705 <strong>Data Guard Broker<\/strong> is configured and working<br><em><code>dgmgrl&gt; show configuration<\/code> should display SUCCESS for all members.<\/em><\/li>\n\n\n\n<li>\u2705 <strong>Databases are synchronized<\/strong><br><em>No transport\/apply lag or errors \u2014 check with <code>show database &lt;db_name&gt;<\/code>.<\/em><\/li>\n\n\n\n<li>\u2705 <strong>SYSDBA access<\/strong> is available<br><em>You must connect to DGMGRL as a SYSDBA user.<\/em><\/li>\n\n\n\n<li>\u2705 <strong>Correct ORACLE_SID<\/strong> is set in the environment<br><em>Use <code>echo $ORACLE_SID<\/code> and set with <code>export ORACLE_SID=&lt;PRIMARY_SID&gt;<\/code> if needed.<\/em><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Prepare &amp; Validate Environment<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Set ORACLE_SID to primary DB instance\nexport ORACLE_SID=&lt;PRIMARY_SID>\n\n# Connect to DGMGRL using SYSDBA\ndgmgrl sys\/&lt;password>@&lt;PRIMARY_TNS>\n\n# Validate the primary database\nvalidate database &lt;PRIMARY_DB>;<\/code><\/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\">Ensure the output shows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Role: Primary<\/li>\n\n\n\n<li>Ready for Switchover: YES<\/li>\n\n\n\n<li>Managed by Clusterware: YES<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Perform the Switchover<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>-- Initiate switchover to the standby database\nswitchover to &lt;STANDBY_DB>;<\/code><\/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\">DGMGRL will connect to the standby, switch roles, open the new primary, and restart the former primary as standby.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Sample Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>Performing switchover NOW, please wait...\nOperation requires a connection to database \"&lt;STANDBY_DB>\"\nConnecting ...\nConnected to \"&lt;STANDBY_DB>\"\nConnected as SYSDBA.\nNew primary database \"&lt;STANDBY_DB>\" is opening...\nOracle Clusterware is restarting database \"&lt;PRIMARY_DB>\" ...\nConnected to \"&lt;PRIMARY_DB>\"\nSwitchover succeeded, new primary is \"&lt;STANDBY_DB>\"<\/code><\/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\">This confirms:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>DGMGRL connected to both databases<\/li>\n\n\n\n<li>Role reversal was completed<\/li>\n\n\n\n<li>New primary opened, and old primary restarted as standby<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Post-Switchover Checks<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>-- View current configuration and database roles\nshow configuration;\nshow database &lt;NEW_PRIMARY_DB>;\nshow database &lt;NEW_STANDBY_DB>;<\/code><\/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\">Confirm both databases show <code>SUCCESS<\/code> and correct roles (Primary \/ Physical Standby).<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Update OND Hostnames (If Applicable)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your system uses <strong>OND hostnames<\/strong>, update them to reflect the new primary and standby roles.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Additional Notes<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>-- Check Fast-Start Failover (FSFO) status\nshow fast_start failover;\n\n-- Re-enable FSFO if required\nenable fast_start failover;<\/code><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Always review <code>alert.log<\/code> and <code>drc.log<\/code> for any warnings or errors.<\/li>\n\n\n\n<li>Ensure applications or monitoring tools are aware of the role change.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A switchover is a planned role reversal between a primary and its standby database in a Data Guard configuration. It allows the standby database to assume the primary role without data loss, typically for maintenance or disaster recovery testing. This operation is performed while both databases are available and synchronized. 1. Prerequisites Ensure the following [&hellip;]<\/p>\n","protected":false},"template":"","meta":{"googlesitekit_rrm_CAowu461DA:productID":""},"categories":[952,984],"class_list":["post-4158","cposts","type-cposts","status-publish","hentry","category-notes","category-oracle-dba-d2d-tasks"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/cposts\/4158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/cposts"}],"about":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/types\/cposts"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=4158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=4158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}