{"id":12268,"date":"2019-02-21T08:05:50","date_gmt":"2019-02-21T07:05:50","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/"},"modified":"2019-02-21T08:05:50","modified_gmt":"2019-02-21T07:05:50","slug":"create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/","title":{"rendered":"Create a primary database using the backup of a standby database on 12cR2"},"content":{"rendered":"<p>The scope of this blog will be to show how to create a primary role database based on a backup of a standby database on 12cR2.<\/p>\n<p><strong>Step1: We are assuming that an auxiliary instance has been created and started in nomount mode.<\/strong><\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">rman target \/\nrestore primary controlfile from 'backup_location_directory\/control_.bkp';\nexit;\n\n<\/pre>\n<p>By specifying &#8220;restore primary&#8221; , will modify the flag into the controlfile, and will mount a primary role instance instead of a standby one.<\/p>\n<p><strong>Step2: Once mounted the instance, we will restore the backup of the standby database.<\/strong><\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">run\n{\ncatalog start with 'backup_location_directory';\nrestore database;\nalter database flashback off;\nrecover database \n}\n<\/pre>\n<p>If in the pfile used to start the instance, you specified the recovery destination and size parameters it will try to enable the flashback.<br \/>\nThe flashback enable , before during the recovery is not allowed, so we will deactivate for the moment.<\/p>\n<p><strong>Step3: Restore\/recover completed successfully, we will try to open the database, but got some errors: <\/strong><\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">alter database open :\n\nORA-03113: end-of-file on communication channel\nProcess ID: 2588\nSession ID: 1705 Serial number: 5<\/pre>\n<p><strong>Step4: Fix the errors and try to open the database:<\/strong><\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">--normal redo log groups\nalter database clear unarchived logfile group YYY;\n\n--standby redo log groups\nalter database clear unarchived logfile group ZZZ;\nalter database drop logfile group ZZZ;\n<\/pre>\n<p>Is not enough. Looking on the database alert log file we can see :<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">LGWR: Primary database is in MAXIMUM AVAILABILITY mode \nLGWR: Destination LOG_ARCHIVE_DEST_2 is not serviced by LGWR \nLGWR: Destination LOG_ARCHIVE_DEST_1 is not serviced by LGWR \n\nErrors in file \/&lt;TRACE_DESTINATION&gt;_lgwr_1827.trc: \nORA-16072: a minimum of one standby database destination is required \nLGWR: terminating instance due to error 16072 \nInstance terminated by LGWR, pid = 1827<\/pre>\n<p><strong>Step5: Complete the opening procedure:<\/strong><\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">alter system set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST';\nalter database set standby database to maximize performance;\n\nSQL&gt; select name,open_mode,protection_mode from v$database;\n\nNAME      OPEN_MODE            PROTECTION_MODE\n--------- -------------------- --------------------\nNAME      MOUNTED              MAXIMUM PERFORMANCE\n\nSQL&gt; alter database flashback on;\n\nDatabase altered.\n\nSQL&gt; alter database open;\n\nDatabase altered.\n\nSQL&gt; select name,db_unique_name,database_role from v$database;\n\nNAME      DB_UNIQUE_NAME                 DATABASE_ROLE\n--------- ------------------------------ ----------------\nNAME      NAME_UNIQUE                    PRIMARY<\/pre>\n<pre class=\"brush: sql; gutter: true; first-line: 1\"><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The scope of this blog will be to show how to create a primary role database based on a backup of a standby database on 12cR2. Step1: We are assuming that an auxiliary instance has been created and started in nomount mode. rman target \/ restore primary controlfile from &#8216;backup_location_directory\/control_.bkp&#8217;; exit; By specifying &#8220;restore primary&#8221; [&hellip;]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,198,59],"tags":[656,297,135,1122,280,23,84,349,96,988,209],"type_dbi":[],"class_list":["post-12268","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","category-database-management","category-oracle","tag-12-2","tag-availability-groups","tag-cloud","tag-data-gard","tag-database","tag-dba","tag-high-availability","tag-optimizer","tag-oracle","tag-oracle-12-2","tag-oracle-12c"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Create a primary database using the backup of a standby database on 12cR2 - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create a primary database using the backup of a standby database on 12cR2\" \/>\n<meta property=\"og:description\" content=\"The scope of this blog will be to show how to create a primary role database based on a backup of a standby database on 12cR2. Step1: We are assuming that an auxiliary instance has been created and started in nomount mode. rman target \/ restore primary controlfile from &#039;backup_location_directory\/control_.bkp&#039;; exit; By specifying &#8220;restore primary&#8221; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-21T07:05:50+00:00\" \/>\n<meta name=\"author\" content=\"Oracle Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oracle Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/\"},\"author\":{\"name\":\"Oracle Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"headline\":\"Create a primary database using the backup of a standby database on 12cR2\",\"datePublished\":\"2019-02-21T07:05:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/\"},\"wordCount\":177,\"commentCount\":1,\"keywords\":[\"12.2\",\"Availability groups\",\"Cloud\",\"Data Gard\",\"database\",\"DBA\",\"High availability\",\"Optimizer\",\"Oracle\",\"Oracle 12.2\",\"Oracle 12c\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Database management\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/\",\"name\":\"Create a primary database using the backup of a standby database on 12cR2 - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2019-02-21T07:05:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a primary database using the backup of a standby database on 12cR2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\",\"name\":\"Oracle Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g\",\"caption\":\"Oracle Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/oracle-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Create a primary database using the backup of a standby database on 12cR2 - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/","og_locale":"en_US","og_type":"article","og_title":"Create a primary database using the backup of a standby database on 12cR2","og_description":"The scope of this blog will be to show how to create a primary role database based on a backup of a standby database on 12cR2. Step1: We are assuming that an auxiliary instance has been created and started in nomount mode. rman target \/ restore primary controlfile from 'backup_location_directory\/control_.bkp'; exit; By specifying &#8220;restore primary&#8221; [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/","og_site_name":"dbi Blog","article_published_time":"2019-02-21T07:05:50+00:00","author":"Oracle Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Oracle Team","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/"},"author":{"name":"Oracle Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"headline":"Create a primary database using the backup of a standby database on 12cR2","datePublished":"2019-02-21T07:05:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/"},"wordCount":177,"commentCount":1,"keywords":["12.2","Availability groups","Cloud","Data Gard","database","DBA","High availability","Optimizer","Oracle","Oracle 12.2","Oracle 12c"],"articleSection":["Database Administration &amp; Monitoring","Database management","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/","url":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/","name":"Create a primary database using the backup of a standby database on 12cR2 - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2019-02-21T07:05:50+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/create-a-primary-database-using-the-backup-of-a-standby-database-on-12cr2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create a primary database using the backup of a standby database on 12cR2"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee","name":"Oracle Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g","caption":"Oracle Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/oracle-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=12268"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12268\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=12268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=12268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=12268"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=12268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}