{"id":3469,"date":"2025-05-20T11:34:56","date_gmt":"2025-05-20T11:34:56","guid":{"rendered":"https:\/\/w3buddy.com\/?p=3469"},"modified":"2026-01-15T13:10:21","modified_gmt":"2026-01-15T07:40:21","slug":"how-to-open-the-standby-database-when-the-primary-is-lost","status":"publish","type":"post","link":"https:\/\/w3buddy.com\/blog\/how-to-open-the-standby-database-when-the-primary-is-lost\/","title":{"rendered":"How to Open the Standby Database When the Primary Is Lost"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In critical scenarios where the <strong>Primary Oracle Database is lost<\/strong> or unrecoverable, and only the <strong>Standby Database<\/strong> remains, we must <strong>convert the standby into a new primary<\/strong> and open it in <strong>read-write mode<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below is the <strong>step-by-step guide<\/strong> to safely activate the standby database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 <strong>Step 1: Startup and Mount the Standby Database<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL> STARTUP MOUNT;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcc4 <strong>Output Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ORACLE instance started.<br><br>Total System Global Area  1073741824 bytes<br>Fixed Size                  8902824 bytes<br>Variable Size             301990776 bytes<br>Database Buffers          738197504 bytes<br>Redo Buffers                7876608 bytes<br>Database mounted.<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 <strong>Step 2: Check Database Role &amp; Status<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL> SELECT NAME, OPEN_MODE, DATABASE_ROLE FROM V$DATABASE;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcc4 <strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">NAME     OPEN_MODE            DATABASE_ROLE<br>------   ------------------   ----------------<br>STBY     MOUNTED              PHYSICAL STANDBY<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 <strong>Step 3: Cancel Managed Recovery (If Active)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the database was applying logs, you&#8217;ll get:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL> RECOVER STANDBY DATABASE;<br>ORA-01153: an incompatible media recovery is active<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u27a1\ufe0f <strong>Cancel it:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcc4 <strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Database altered.<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 <strong>Step 4: Finish the Recovery Process<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following command to perform the final transition:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcc4 <strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Database altered.<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 <strong>Step 5: Activate the Standby Database<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now convert the standby to a primary:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcc4 <strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Database altered.<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>Note<\/strong>: This is an <strong>irreversible<\/strong> action \u2014 after activation, the standby can no longer receive logs from the old primary.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 <strong>Step 6: Confirm New Role<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL> SELECT NAME, OPEN_MODE, DATABASE_ROLE FROM V$DATABASE;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcc4 <strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">NAME     OPEN_MODE            DATABASE_ROLE<br>------   ------------------   ----------------<br>STBY     MOUNTED              PRIMARY<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 <strong>Step 7: Open the Database in Read-Write Mode<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL> ALTER DATABASE OPEN;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcc4 <strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Database altered.<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Final Verification<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL> SELECT OPEN_MODE, DATABASE_ROLE FROM V$DATABASE;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcc4 <strong>Expected Result:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">OPEN_MODE  |  DATABASE_ROLE<br>-----------|----------------<br>READ WRITE |  PRIMARY<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd0d Summary<\/h2>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table><thead><tr><th>Step<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>Startup and mount the standby<\/td><\/tr><tr><td>2<\/td><td>Check current database role<\/td><\/tr><tr><td>3<\/td><td>Cancel managed recovery<\/td><\/tr><tr><td>4<\/td><td>Finish recovery (final redo apply)<\/td><\/tr><tr><td>5<\/td><td>Activate standby (makes it a primary)<\/td><\/tr><tr><td>6<\/td><td>Verify role switch<\/td><\/tr><tr><td>7<\/td><td>Open the database in read-write mode<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In critical scenarios where the Primary Oracle Database is lost or unrecoverable, and only the Standby Database remains, we must convert the standby into a new primary and open it in read-write mode. Below is the step-by-step guide to safely activate the standby database. \ud83d\udd39 Step 1: Startup and Mount the Standby Database SQL> STARTUP [&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-3469","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/3469","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=3469"}],"version-history":[{"count":1,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/3469\/revisions"}],"predecessor-version":[{"id":3471,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/3469\/revisions\/3471"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=3469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=3469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/tags?post=3469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}