
{"id":8090,"date":"2019-04-26T15:11:05","date_gmt":"2019-04-26T15:11:05","guid":{"rendered":"https:\/\/rax-stg-wp-aws.com\/blogs\/roll-a-standby-database-forward-with-rman\/"},"modified":"2026-11-03T19:29:16","modified_gmt":"2026-11-03T19:29:16","slug":"roll-a-standby-database-forward-with-rman","status":"publish","type":"blogs","link":"https:\/\/www.rackspace.com\/en-gb\/blogs\/roll-a-standby-database-forward-with-rman\/","title":{"rendered":"Roll a standby database forward with RMAN"},"content":{"rendered":"<p><strong>Introduction<\/strong><\/p>\n<p>If a physical standby database loses or corrupts an archived redo data or&nbsp;has an unresolvable archive gap, which is the result of archive logs getting&nbsp;missed on the primary database or the archives getting corrupted, then no&nbsp;valid backups exists for recovery.<\/p>\n<p>\nIf an archive exists on the primary database, troubleshoot the issue, and if&nbsp;the archive is not corrupted, the archive is automatically&nbsp; transferred. If&nbsp;an archive is corrupted at the operating system (OS) level and you do have a&nbsp;backup, then restore the database by using the archive log from the backup. If&nbsp;none of these solutions work, you can recover the standby database with an&nbsp;incremental system change number (SCN) for standby\/Roll Forward.<\/p>\n<p>This blog shows you how to use the Oracle\u00a9 Recovery Manager (RMAN)&nbsp;incremental backup to roll the standby database forward faster than by using a&nbsp;redo log apply.<\/p>\n<p><strong>&nbsp;How does an incremental backup work?<\/strong><\/p>\n<p>The following image shows the incremental backup process:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26597-body-Picture1_9.png\" alt=\"roll database pic 1\" \/><\/p>\n<p>All the changes between the SCN of the original image copy and the SCN of the incremental backup are applied to the image.&nbsp;To use this method, create a backup on the primary database that starts at the&nbsp;standby database\u2019s current SCN, which you can then use to roll forward the standby database.<\/p>\n<p><strong>&nbsp;Steps to roll forward a physical standby database<\/strong><\/p>\n<p>Use the following steps to roll forward a physical standby database.<\/p>\n<p><strong>&nbsp;Find the SCN gap<\/strong><\/p>\n<p>1. Use the following code to record the SCN gap between the standby and the<br \/>\n&nbsp; &nbsp;production databases:<\/p>\n<p>&nbsp; &nbsp; <em>&nbsp; &nbsp; SQL&gt; select status,instance_name,database_role from v$database,v$instance;<\/em><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; STATUS &nbsp; &nbsp; &nbsp; INSTANCE_NAME &nbsp; &nbsp;DATABASE_ROLE<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; MOUNTED &nbsp; &nbsp; &nbsp;PROD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PHYSICAL STANDBY<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; SQL&gt; SELECT to_char(CURRENT_SCN) FROM V$DATABASE;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; CURRENT_SCN<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;-<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; 5997422841660<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; SQL&gt; select min(fhscn) from x$kcvfh;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; CURRENT_SCN<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;-<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; 5997422841643<\/p>\n<p>2. Note the lower SCN from the preceding queries, and run the following code:<\/p>\n<p>\n&nbsp; &nbsp; &nbsp; &nbsp; <em>SQL&gt; select status,instance_name,database_role from v$database,v$instance;<\/em><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; STATUS &nbsp; &nbsp; &nbsp; INSTANCE_NAME &nbsp; &nbsp;DATABASE_ROLE<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; OPEN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PRIMARY<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; SQL&gt; SELECT to_char(CURRENT_SCN) FROM V$DATABASE;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; CURRENT_SCN<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;-<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; 5997428587053<br \/>\n&nbsp;<\/p>\n<p><strong>&nbsp;&nbsp;Take an incremental SCN backup and create a standby controlfile backup<\/strong><\/p>\n<p>1. Run the following code on the production server to take an SCN backup:<\/p>\n<p>&nbsp; &nbsp; &nbsp; <em>&nbsp; [oracle@pslmtli.rackspace.com] $ rman target \/<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; RMAN&gt;BACKUP INCREMENTAL FROM SCN 5997422841643 DATABASE FORMAT &#8216;\/u01\/orapi\/stage\/TEMP\/DBDR_%U&#8217; tag &#8216;ArchiveGap&#8217;;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Starting backup at 25-MAR-18<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; channel ORA_DISK_1: starting full datafile backup set<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; channel ORA_DISK_1: specifying datafile(s) in backup set<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; including current control file in backup set<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; channel ORA_DISK_1: starting piece 1 at 25-MAR-18<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; channel ORA_DISK_1: finished piece 1 at 25-MAR-18<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; piece handle=\/u01\/orapi\/stage\/TEMP\/ DBDR123.bak tag= ArchiveGap comment=NONE<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Finished backup at 25-MAR-18<\/em><\/p>\n<p>2. Run the following code to create the standby <strong>controlfile<\/strong>&nbsp;backup:<\/p>\n<p><em>&nbsp; RMAN&gt; backup current controlfile for standby format =&#8217;\/u01\/orapi\/stage\/TEMP\/standby_control.bctl&#8217;;<\/em><\/p>\n<p>3. Transfer the backups from the primary server to the standby.<\/p>\n<p>\n4. Run the following code to apply a incremental SCN backup on the standby<br \/>\n&nbsp; &nbsp;database, which catalogs all the backup pieces and the <strong>controlfile<\/strong><\/p>\n<p><em>&nbsp;[oracle@nslmtli.rackspace.com] $ rman target \/<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; Recovery Manager: Release 11.2.0.1.0 &#8211; Production on Sun Mar 2515:51:02 2012<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; Copyright (c) 1982, 2009, Oracle and\/or its affiliates. &nbsp;All rights reserved.<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; connected to target database: PSTLI (DBID=431934829, not open)<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; RMAN&gt; catalog start with \u2018\/u01\/archives\/stage\/temp\/\u2019;<\/em><\/p>\n<p>5. Run the following code to recover the standby database with the cataloged&nbsp;incremental backup pieces:<\/p>\n<p>&nbsp;<em> &nbsp; &nbsp; &nbsp; RMAN&gt; RECOVER DATABASE NOREDO;<\/em><\/p>\n<p>6. Run the following code to shutdown the physical standby database, start it&nbsp;in the <em>nomount<\/em>&nbsp;stage, and restore the standby <strong>controlfile&nbsp;<\/strong>&nbsp;backup that&nbsp;you took from the primary database:<\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; RMAN&gt; shutdown immediate<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; database dismounted<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Oracle instance shut down<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; RMAN&gt; startup nomount<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; connected to target database (not started)<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Oracle instance started<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; Total System Global Area &nbsp; &nbsp; 659730432 bytes<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; Fixed Size &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2216264 bytes<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Variable Size &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;398462648 bytes<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Database Buffers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 255852544 bytes<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Redo Buffers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3198976 bytes<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; RMAN&gt; restore standby controlfile from \u2018\/u01\/archives\/stage\/temp\/standby_control.bctl\u2019;<\/em><\/p>\n<p><em>&nbsp; &nbsp; &nbsp; &nbsp; Finished restore at 25-MAR-18<\/em><\/p>\n<p>\n7. Shutdown the standby database and mount the standby database so that you can&nbsp;&nbsp; &nbsp;mount the standby database with the new <strong>controlfile&nbsp;<\/strong>that was restored in&nbsp;the previous step.<\/p>\n<p>Now the standby database is synchronized with the primary database.<\/p>\n<p><strong>&nbsp;Conclusion<\/strong><\/p>\n<p>You can use RMAN incremental backups to synchronize a physical standby database&nbsp;with the primary database. By using the RMAN <em>BACKUP INCREMENTAL FROM SCN<\/em>&nbsp;command, you can create a backup on the primary database that starts at the&nbsp;standby database&#8217;s current SCN, which you can then use to roll the standby&nbsp;database forward in time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Roll a standby database forward with RMAN<\/p>\n","protected":false},"author":2,"featured_media":8092,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"content-type":"","nid":"26597","content_type":"blog","created_by":"10130","authored_on":"2024-02-09T16:11:05+00:00","field_article_industries":"","tag_category":"Technical","field_blog_author_text":"by Rackspace Technology Staff","seo_description":"Utilize Oracle Recovery Manager (RMAN) incremental backup for faster standby database roll-forward, ensuring efficient data recovery and minimal downtime.\r\n","field_featured_image":"","insights_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/26597-insights_image-oracle-technical-blog-1-insights.jpg","field_partners":"","rxt_platforms":"Oracle","product":"","publisheddate":"2019-04-26T15:11:05","rxt_solutions":"Cloud Optimization, Data, Databases","opengraph_tag":"","x_tag":"","teaser_flag":"Technical Blog","seo_titile":"Roll a Standby Database Forward with RMAN | Rackspace Technology","field_topics":"","field_slug":"roll-standby-database-forward-with-rman","footnotes":""},"categories":[178],"tags":[204],"class_list":["post-8090","blogs","type-blogs","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-technical"],"_links":{"self":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs"}],"about":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/types\/blogs"}],"author":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/comments?post=8090"}],"version-history":[{"count":3,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8090\/revisions"}],"predecessor-version":[{"id":9870,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8090\/revisions\/9870"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media\/8092"}],"wp:attachment":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media?parent=8090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/categories?post=8090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/tags?post=8090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}