{"id":2275,"date":"2025-12-16T13:22:02","date_gmt":"2025-12-16T11:22:02","guid":{"rendered":"https:\/\/www.ludovicocaldara.net\/dba\/?p=2275"},"modified":"2025-12-16T13:31:20","modified_gmt":"2025-12-16T11:31:20","slug":"reinstate-without-flashback-logging","status":"publish","type":"post","link":"https:\/\/www.ludovicocaldara.net\/dba\/reinstate-without-flashback-logging\/","title":{"rendered":"Reinstate an Oracle Database after failover without Flashback logging enabled"},"content":{"rendered":"<p dir=\"auto\">The key difference between a switchover and a failover in Data Guard is the synchronization between primary and standby to avoid data loss.<\/p>\n<p dir=\"auto\"><strong>Switchover<\/strong><br \/>\nA switchover is a planned event. The primary and standby databases synchronize to allow a smooth, lossless role reversal:<\/p>\n<ul class=\"\" dir=\"auto\">\n<li class=\"text-start \">The primary database stops the activity.<\/li>\n<li class=\"text-start \">It writes a &#8220;redo marker&#8221; to the redo stream.<\/li>\n<li class=\"text-start \">It flushes all the remaining redo to the standby.<\/li>\n<li class=\"text-start \">The standby applies all the redo and, upon reaching the marker, knows it&#8217;s up to date and can open as the new primary.<\/li>\n<li class=\"text-start \">Finally, the old primary becomes a standby and starts recovering changes from the new primary.<\/li>\n<\/ul>\n<p dir=\"auto\"><strong>Failover<\/strong><br \/>\nA failover usually happens after the primary becomes unavailable. Unlike a switchover, the new primary may not have all the latest redo from the old primary, even in synchronous mode because in-progress changes can exist past the last transmitted redo. As a result, their timelines diverge. The former primary (and possibly other standbys) must be reinstated to rejoin the configuration.<\/p>\n<p dir=\"auto\"><strong>Flashback and Reinstate<\/strong><br \/>\nOracle&#8217;s Flashback Database feature allows you to rewind a database to a specific point in time. This makes recovering a failed primary much faster and easier because it does not require a full restore.<br \/>\nWith Flashback enabled, the Data Guard Broker can quickly reinstate the former primary after a failover with a single command:<\/p>\n<pre class=\"lang:plsql decode:true language-text text\">REINSTATE DATABASE {db_unique_name};\r\n<\/pre>\n<p data-source-line=\"32\">A customer recently asked how to reinstate a former primary when Flashback Logging is disabled.<br \/>\nAlthough we strongly recommend enabling Flashback Logging, some environments cannot support it due to storage constraints.<br \/>\nIn such cases, you can still reinstate the database manually. Here\u2019s how.<\/p>\n<h2 id=\"step-by-step-reinstate-a-database-from-a-backup-and-re-enable-it-in-the-broker\" data-source-line=\"37\">Step-by-step: reinstate a database from a backup and re-enable it in the broker<\/h2>\n<p data-source-line=\"39\">We are in a Maximum Performance configuration:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">DGMGRL&gt; show config\r\n\r\nConfiguration - adgvec_site0_adgvec_d7q_lhr\r\n\r\n  Protection Mode: MaxPerformance\r\n  Members:\r\n  adgvec_site0   - Primary database\r\n    adgvec_d7q_lhr - Physical standby database \r\n\r\nFast-Start Failover:  Disabled\r\n\r\nConfiguration Status:\r\nSUCCESS   (status updated 43 seconds ago)\r\n<\/pre>\n<p data-source-line=\"57\">Let&#8217;s fail over:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">DGMGRL&gt; failover to adgvec_d7q_lhr immediate;\r\n2025-12-16T09:58:55.928+00:00\r\nPerforming failover NOW, please wait...\r\n\r\n2025-12-16T09:59:08.548+00:00\r\nFailover succeeded, new primary is \"adgvec_d7q_lhr\".\r\n\r\n2025-12-16T09:59:08.548+00:00\r\nFailover processing complete, broker ready.\r\nDGMGRL&gt; exit<\/pre>\n<p data-source-line=\"72\">Then restart the former primary in MOUNT mode:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">SQL&gt; shutdown immediate;\r\nDatabase closed.\r\nDatabase dismounted.\r\nORACLE instance shut down.\r\nSQL&gt; startup mount;\r\nORACLE instance started.\r\n\r\nTotal System Global Area   15544938664 bytes      \r\nFixed Size                     4939944 bytes      \r\nVariable Size               2650800128 bytes      \r\nDatabase Buffers           12750684160 bytes      \r\nRedo Buffers                 138514432 bytes      \r\nDatabase mounted.<\/pre>\n<p data-source-line=\"90\">The broker now says the former primary requires a reinstate:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">DGMGRL&gt; show config\r\n\r\nConfiguration - adgvec_site0_adgvec_d7q_lhr\r\n\r\n  Protection Mode: MaxPerformance\r\n  Members:\r\n  adgvec_d7q_lhr - Primary database\r\n    adgvec_site0   - Physical standby database (disabled)\r\n      ORA-16661: The standby database must be reinstated.\r\n\r\nFast-Start Failover:  Disabled\r\n\r\nConfiguration Status:\r\nSUCCESS   (status updated 15 seconds ago)<\/pre>\n<p data-source-line=\"109\">As I said, we can&#8217;t proceed with a normal reinstate if there&#8217;s no flashback:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">DGMGRL&gt; reinstate database adgvec_site0;\r\n2025-12-16T10:07:22.733+00:00\r\nReinstating database \"adgvec_site0\", please wait...\r\n\r\nError: ORA-16827: Flashback Database is disabled.\r\n\r\nFailed.\r\n2025-12-16T10:07:22.942+00:00\r\nReinstatement of database \"adgvec_site0\" failed\r\n\r\n2025-12-16T10:07:22.942+00:00\r\nReinstate processing complete, broker ready.<\/pre>\n<p data-source-line=\"126\">Let&#8217;s restore! This is the only way to bring a database to a past point in time if there is no flashback logging.<\/p>\n<p data-source-line=\"128\">First, we put the DB in <em>nomount<\/em> mode to restore the standby controlfile:<\/p>\n<pre class=\"lang:plsql decode:true \">SQL&gt; startup force nomount;\r\nORACLE instance started.\r\n\r\nTotal System Global Area 1.5545E+10 bytes\r\nFixed Size\t\t    4939944 bytes\r\nVariable Size\t\t 2650800128 bytes\r\nDatabase Buffers\t 1.2751E+10 bytes\r\nRedo Buffers\t\t  138514432 bytes<\/pre>\n<p data-source-line=\"141\">Then we wipe out the directory that contains the DB (careful with this command!)<\/p>\n<pre class=\"lang:sh decode:true \">$ rm -rf * \/u02\/app\/oracle\/oradata\/adgvec_site0\/ADGVEC_SITE0<\/pre>\n<p data-source-line=\"147\">We restore the standby controlfile and the database:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">RMAN&gt; restore standby controlfile from service adgvec_d7q_lhr;\r\nrestore standby controlfile from service adgvec_d7q_lhr;\r\nStarting restore at 16-DEC-25\r\nusing target database control file instead of recovery catalog\r\nallocated channel: ORA_DISK_1\r\nchannel ORA_DISK_1: SID=331 device type=DISK\r\n\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: restoring control file\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:01\r\noutput file name=\/u02\/app\/oracle\/oradata\/adgvec_site0\/control01.ctl\r\noutput file name=\/u03\/app\/oracle\/fast_recovery_area\/ADGVEC_SITE0\/control02.ctl\r\nFinished restore at 16-DEC-25\r\n\r\nRMAN&gt; alter database mount;\r\nreleased channel: ORA_DISK_1\r\nStatement processed\r\n\r\nRMAN&gt; restore database from service adgvec_d7q_lhr;\r\nrestore database from service adgvec_d7q_lhr;\r\nStarting restore at 16-DEC-25\r\nStarting implicit crosscheck backup at 16-DEC-25\r\nallocated channel: ORA_DISK_1\r\nchannel ORA_DISK_1: SID=486 device type=DISK\r\nCrosschecked 6 objects\r\nFinished implicit crosscheck backup at 16-DEC-25\r\n\r\nStarting implicit crosscheck copy at 16-DEC-25\r\nusing channel ORA_DISK_1\r\nFinished implicit crosscheck copy at 16-DEC-25\r\n\r\nsearching for all files in the recovery area\r\ncataloging files...\r\ncataloging done\r\n\r\nList of Cataloged Files\r\n=======================\r\nFile Name: \/u03\/app\/oracle\/fast_recovery_area\/ADGVEC_SITE0\/autobackup\/2025_07_25\/o1_mf_s_1207415482_n87gotv5_.bkp\r\nFile Name: \/u03\/app\/oracle\/fast_recovery_area\/ADGVEC_SITE0\/archivelog\/2025_10_31\/o1_mf_1_172_njbddl2f_.arc\r\n...\r\n\r\nusing channel ORA_DISK_1\r\n\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00001 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/datafile\/o1_mf_system_n87ggxdv_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:07\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00002 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/32F00060B1F21FF6E0633A875E64E7C7\/datafile\/o1_mf_system_n87ggxhw_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:03\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00003 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/datafile\/o1_mf_sysaux_n87ggxn0_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:55\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00004 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/32F00060B1F21FF6E0633A875E64E7C7\/datafile\/o1_mf_sysaux_n87ggxqm_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:03\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00007 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/datafile\/o1_mf_users_n87gh76c_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:01\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00009 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/32F00060B1F21FF6E0633A875E64E7C7\/datafile\/o1_mf_undotbs1_n87gh97l_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:01\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00011 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/datafile\/o1_mf_undotbs1_n87ghb6x_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:01\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00012 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/330D3A56F99F26B6E0635C08F40AF437\/datafile\/o1_mf_system_n87ghdl5_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:03\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00013 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/330D3A56F99F26B6E0635C08F40AF437\/datafile\/o1_mf_sysaux_n87ghdny_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:45\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00014 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/330D3A56F99F26B6E0635C08F40AF437\/datafile\/o1_mf_undotbs1_n87ghdrp_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:01\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: using network backup set from service adgvec_d7q_lhr\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00015 to \/u02\/app\/oracle\/oradata\/adgvec_d7q_lhr\/ADGVEC_D7Q_LHR\/330D3A56F99F26B6E0635C08F40AF437\/datafile\/o1_mf_users_n87ghhw8_.dbf\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:15\r\nFinished restore at 16-DEC-25\r\n\r\nRMAN&gt;<\/pre>\n<p data-source-line=\"254\">Now let&#8217;s enable the freshly reinstated standby database:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">DGMGRL&gt; enable database adgvec_site0;\r\nEnabled.\r\n\r\nDGMGRL&gt; show configuration\r\n\r\nConfiguration - adgvec_site0_adgvec_d7q_lhr\r\n\r\n  Protection Mode: MaxPerformance\r\n  Members:\r\n  adgvec_d7q_lhr - Primary database\r\n    adgvec_site0   - Physical standby database \r\n      Warning: ORA-16809: Multiple warnings detected for the member.\r\n\r\nFast-Start Failover:  Disabled\r\n\r\nConfiguration Status:\r\nWARNING   (status updated 8 seconds ago)<\/pre>\n<pre class=\"lang:plsql highlight:0 decode:true \">DGMGRL&gt; show database verbose adgvec_site0 \r\n\r\nDatabase - adgvec_site0\r\n\r\n  Role:                PHYSICAL STANDBY\r\n  Intended State:      APPLY-ON\r\n  Transport Lag:       (unknown)\r\n  Apply Lag:           6 minutes 41 seconds (computed 18 seconds ago)\r\n  Average Apply Rate:  (unknown)\r\n  Active Apply Rate:   (unknown)\r\n  Maximum Apply Rate:  (unknown)\r\n  Real Time Query:     OFF\r\n  Instance(s):\r\n    adgvec\r\n\r\n  Database Warning(s):\r\n    ORA-16853: apply lag has exceeded specified threshold\r\n    ORA-16856: transport lag could not be determined\r\n    ORA-16826: apply service state is inconsistent with the DelayMins property\r\n\r\n...\r\nDatabase Status:\r\nWARNING\r\n<\/pre>\n<p data-source-line=\"302\">Oups, I made a mistake. The Real-Time Apply isn&#8217;t working. Of course! I also deleted the standby logs, so I need to clear them.<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">DGMGRL&gt; edit database adgvec_site0 set state='APPLY-OFF';\r\nSucceeded.\r\n<\/pre>\n<pre class=\"lang:plsql decode:true \">SQL&gt; alter database clear logfile group 4, group 5, group 6, group 7;\r\n\r\nDatabase altered.\r\n<\/pre>\n<pre class=\"lang:plsql decode:true \">DGMGRL&gt; edit database adgvec_site0 set state='APPLY-ON';\r\nSucceeded.\r\n<\/pre>\n<pre class=\"lang:plsql highlight:0 decode:true \">DGMGRL&gt; sql 'alter system switch logfile';\r\nSucceeded.\r\nDGMGRL&gt; show configuration verbose;\r\n\r\nConfiguration - adgvec_site0_adgvec_d7q_lhr\r\n\r\n  Protection Mode: MaxPerformance\r\n  Members:\r\n  adgvec_d7q_lhr - Primary database\r\n    adgvec_site0   - Physical standby database \r\n\r\n  Properties:\r\n    BystandersFollowRoleChange      = 'ALL'\r\n    CommunicationTimeout            = '180'\r\n    ConfigurationSimpleName         = 'adgvec_site0_adgvec_d7q_lhr'\r\n    ConfigurationWideServiceName    = 'adgvec_CFG'\r\n    DrainTimeout                    = '0'\r\n    ExternalDestination1            = ''\r\n    ExternalDestination2            = ''\r\n    FastStartFailoverAutoReinstate  = 'TRUE'\r\n    FastStartFailoverLagGraceTime   = '0'\r\n    FastStartFailoverLagLimit       = '30'\r\n    FastStartFailoverLagType        = 'APPLY'\r\n    FastStartFailoverPmyShutdown    = 'TRUE'\r\n    FastStartFailoverThreshold      = '30'\r\n    ObserverOverride                = 'FALSE'\r\n    ObserverPingInterval            = '0'\r\n    ObserverPingRetry               = '0'\r\n    ObserverReconnect               = '0'\r\n    OperationTimeout                = '30'\r\n    PrimaryDatabaseCandidates       = ''\r\n    PrimaryLostWriteAction          = 'CONTINUE'\r\n    TraceLevel                      = 'USER'\r\n\r\nFast-Start Failover:  Disabled\r\n\r\nConfiguration Status:\r\nSUCCESS\r\n<\/pre>\n<div class=\"w-full min-h-screen h-auto\">\n<div id=\"\" class=\"crossnote markdown-preview zen-mode system-dark editor-dark \" data-for=\"preview\">\n<p data-source-line=\"361\">Everything looks good now.<\/p>\n<p data-source-line=\"363\">HTH<br \/>\nLudovico<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The key difference between a switchover and a failover in Data Guard is the synchronization between primary and standby to avoid data loss. Switchover A switchover is a planned event. The primary and standby databases synchronize to allow a smooth, &hellip; <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/reinstate-without-flashback-logging\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":140,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[329],"tags":[373,45,371,374,372,160,31],"class_list":["post-2275","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oracle-dg","tag-broker","tag-duplicate","tag-failover","tag-flashback","tag-reinstate","tag-restore","tag-standby"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/2275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/comments?post=2275"}],"version-history":[{"count":1,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/2275\/revisions"}],"predecessor-version":[{"id":2276,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/2275\/revisions\/2276"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media\/140"}],"wp:attachment":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media?parent=2275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/categories?post=2275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/tags?post=2275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}