{"id":18,"date":"2015-10-18T09:51:36","date_gmt":"2015-10-18T15:51:36","guid":{"rendered":"http:\/\/www.aamirharoon.com\/?p=18"},"modified":"2015-10-18T09:51:36","modified_gmt":"2015-10-18T15:51:36","slug":"ora-01180-can-not-create-datafile-1-during-restore","status":"publish","type":"post","link":"http:\/\/www.aamirharoon.com\/?p=18","title":{"rendered":"ORA-01180: can not create datafile 1 during restore"},"content":{"rendered":"<p class=\"fontplugin_fontid_1086_AllerRg\">I came across this error at work and thought it was worth blogging. Maybe someone else can benefit from it and not spend hours looking for solution.<\/p>\n<p class=\"fontplugin_fontid_1086_AllerRg\">During a Disaster Recovery exercise, my task was to drop already existing database (it was left there from previous restore) and restore database from current backup.<\/p>\n<p class=\"fontplugin_fontid_1086_AllerRg\">It is important to note that a database already existed in ARCHIVELOG mode (later on it&#8217;ll become clear why I am mentioning this).<\/p>\n<p class=\"fontplugin_fontid_1086_AllerRg\">So, after deleting the database using dbca, I executed restore database command. \u00a0Immediately after, I got the ugly confusing not enough information error <img loading=\"lazy\" decoding=\"async\" style=\"margin-left: 3px; margin-right: 3px; vertical-align: middle; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;\" src=\"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png\" alt=\"\" width=\"16\" height=\"16\" \/><\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nRMAN-03002: failure of restore command at 09\/10\/2015 17:04:24\r\nORA-01180: can not create datafile 1\r\nORA-01110: data file 1: '+DGDATA01\/db1\/datafile\/system.211.849181900'\r\n<\/pre>\n<p class=\"fontplugin_fontid_1086_AllerRg\">\n<div class=\"fontplugin_fontid_1086_AllerRg\">I had gotten this error before and it was due to missing directory in ASM. \u00a0But this time directory already existed. \u00a0So I looked at my old notes and did some google search and found out this error could have something to do with database incarnation.<\/div>\n<div class=\"fontplugin_fontid_1086_AllerRg\"><\/div>\n<\/p>\n<p class=\"fontplugin_fontid_1086_AllerRg\">\n<div class=\"fontplugin_fontid_1086_AllerRg\">At first this didn&#8217;t make any sense to me. \u00a0I am trying to restore database, how and where database incarnation come into play? \u00a0I haven&#8217;t even open the database using resetlogs.<\/div>\n<\/p>\n<p class=\"fontplugin_fontid_1086_AllerRg\">\n<div class=\"fontplugin_fontid_1086_AllerRg\">I started to investigate and here is what I found:<\/div>\n<div class=\"fontplugin_fontid_1086_AllerRg\"><\/div>\n<\/p>\n<pre class=\"brush: sql; highlight: [4,15]; title: ; notranslate\" title=\"\">\r\nselect name, open_mode, resetlogs_change#, checkpoint_change#, ARCHIVE_CHANGE# from v$database;\r\nNAME\u00a0\u00a0\u00a0\u00a0\u00a0 OPEN_MODE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RESETLOGS_CHANGE# \u00a0\u00a0CHECKPOINT_CHANGE#\u00a0\u00a0\u00a0\u00a0\u00a0 ARCHIVE_CHANGE#\r\n--------- -------------------- -------------------- -------------------- --------------------\r\ndb1 \u00a0 \u00a0 \u00a0 MOUNTED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 160342856897\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 175422004618\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 175421783462\r\n\r\n1 row selected.\r\n\r\n\r\nRMAN&gt; list incarnation;&lt;\/div&gt;\r\n\r\nList of Database Incarnations\r\nDB Key\u00a0 Inc Key DB Name\u00a0 DB ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 STATUS\u00a0 Reset SCN\u00a0 Reset Time\r\n------- ------- -------- ---------------- ------ \u00a0---------- ----------\r\n1 \u00a0 \u00a0 \u00a0 1 \u00a0 \u00a0 \u00a0 db1 \u00a0 \u00a0 \u00a0504953174\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PARENT\u00a0 1 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a003-july\u00a0\u00a0\u00a0\u00a0 -2014 08:22:41 am\r\n2 \u00a0 \u00a0 \u00a0 2 \u00a0 \u00a0 \u00a0 db1 \u00a0 \u00a0 \u00a0504953174\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PARENT\u00a0 160342856897 11-july\u00a0\u00a0\u00a0\u00a0 -2014 08:06:17 am\r\n3 \u00a0 \u00a0 \u00a0 3 \u00a0 \u00a0 \u00a0 db1 \u00a0 \u00a0 \u00a0504953174\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CURRENT 174815835735 27-august\u00a0\u00a0 -2015 09:02:24 am\r\n<\/pre>\n<p class=\"fontplugin_fontid_1086_AllerRg\">\n<div class=\"fontplugin_fontid_1086_AllerRg\">The SCN from incarnation number 2 matched with what was in control file, which is good. \u00a0But how? why? from where? did the new incarnation number 3 came from?<\/div>\n<\/p>\n<p class=\"fontplugin_fontid_1086_AllerRg\">\n<div class=\"fontplugin_fontid_1086_AllerRg\">I had to find the answer otherwise I would not be able to  sleep. \ud83d\ude42<\/div>\n<\/p>\n<p class=\"fontplugin_fontid_1086_AllerRg\">\n<div class=\"fontplugin_fontid_1086_AllerRg\">I did some research on My Oracle Support and came across Doc ID 1573040.1<\/div>\n<\/p>\n<p class=\"fontplugin_fontid_1086_AllerRg\">\n<div class=\"fontplugin_fontid_1086_AllerRg\">\n<div>&#8220;When a BACKUP controlfile is used with a Flash Recovery Area defined, an\u00a0 implicit crosscheck of the FRA is done and any files found belonging to the database are catalog&#8217;d to the controlfile.<\/div>\n<\/div>\n<div class=\"fontplugin_fontid_1086_AllerRg\">Archivelogs created after a resetlogs operation will cause a new incarnation to be registered in the controlfile.<span class=\"apple-converted-space\">\u00a0<\/span><\/div>\n<div class=\"fontplugin_fontid_1086_AllerRg\"><\/div>\n<div class=\"fontplugin_fontid_1086_AllerRg\">The new incarnations meant the database backup needed for restore\u00a0 no longer belonged to the current incarnation.&#8221;<\/div>\n<\/p>\n<p class=\"fontplugin_fontid_1086_AllerRg\">\n<div class=\"fontplugin_fontid_1086_AllerRg\"><\/div>\n<div class=\"fontplugin_fontid_1086_AllerRg\">hmmm&#8230;.remember at the beginning I mentioned that database in archivelog mode already existed?<\/div>\n<p class=\"fontplugin_fontid_1086_AllerRg\">\n<div class=\"fontplugin_fontid_1086_AllerRg\">I did have archive logs and autobackups of controlfile and spfile from old database in FRA. \u00a0So, that explains the new incarnation that I was seeing. \u00a0Now I can sleep better \ud83d\ude42 .<\/div>\n<\/p>\n<div class=\"fontplugin_fontid_1086_AllerRg\"><\/div>\n<div class=\"fontplugin_fontid_1086_AllerRg\">So lesson learned is to clean up FRA when you drop a database.<\/div>\n<div class=\"fontplugin_fontid_1086_AllerRg\"><\/div>\n<div class=\"fontplugin_fontid_1086_AllerRg\">Once I cleaned up FRA and restarted the restore procedure, everything worked as expected.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I came across this error at work and thought it was worth blogging. Maybe someone else can benefit from it and not spend hours looking<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-11gr2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ORA-01180: can not create datafile 1 during restore - The Database Handyman<\/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.aamirharoon.com\/?p=18\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ORA-01180: can not create datafile 1 during restore - The Database Handyman\" \/>\n<meta property=\"og:description\" content=\"I came across this error at work and thought it was worth blogging. Maybe someone else can benefit from it and not spend hours looking\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.aamirharoon.com\/?p=18\" \/>\n<meta property=\"og:site_name\" content=\"The Database Handyman\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-18T15:51:36+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png\" \/>\n<meta name=\"author\" content=\"Aamir\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@aamir814\" \/>\n<meta name=\"twitter:site\" content=\"@aamir814\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Aamir\" \/>\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.aamirharoon.com\/?p=18#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=18\"},\"author\":{\"name\":\"Aamir\",\"@id\":\"https:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63\"},\"headline\":\"ORA-01180: can not create datafile 1 during restore\",\"datePublished\":\"2015-10-18T15:51:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=18\"},\"wordCount\":490,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63\"},\"image\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=18#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png\",\"articleSection\":[\"Oracle Database 11gR2\"],\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.aamirharoon.com\/?p=18#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.aamirharoon.com\/?p=18\",\"url\":\"https:\/\/www.aamirharoon.com\/?p=18\",\"name\":\"ORA-01180: can not create datafile 1 during restore - The Database Handyman\",\"isPartOf\":{\"@id\":\"https:\/\/www.aamirharoon.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=18#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=18#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png\",\"datePublished\":\"2015-10-18T15:51:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=18#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.aamirharoon.com\/?p=18\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/www.aamirharoon.com\/?p=18#primaryimage\",\"url\":\"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png\",\"contentUrl\":\"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.aamirharoon.com\/?p=18#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.aamirharoon.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ORA-01180: can not create datafile 1 during restore\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.aamirharoon.com\/#website\",\"url\":\"https:\/\/www.aamirharoon.com\/\",\"name\":\"The Database Handyman\",\"description\":\"My notes about Oracle Database, APEX, OEM Cloud Control and whatever I learn\",\"publisher\":{\"@id\":\"https:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.aamirharoon.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63\",\"name\":\"Aamir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/www.aamirharoon.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cc5bb07711a1b9719cc47e13a8205072859c1aef30fac28f412baa84b9cf9b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cc5bb07711a1b9719cc47e13a8205072859c1aef30fac28f412baa84b9cf9b?s=96&d=mm&r=g\",\"caption\":\"Aamir\"},\"logo\":{\"@id\":\"https:\/\/www.aamirharoon.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.aamirharoon.com\/about\/\",\"https:\/\/x.com\/aamir814\"],\"url\":\"http:\/\/www.aamirharoon.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ORA-01180: can not create datafile 1 during restore - The Database Handyman","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.aamirharoon.com\/?p=18","og_locale":"en_US","og_type":"article","og_title":"ORA-01180: can not create datafile 1 during restore - The Database Handyman","og_description":"I came across this error at work and thought it was worth blogging. Maybe someone else can benefit from it and not spend hours looking","og_url":"https:\/\/www.aamirharoon.com\/?p=18","og_site_name":"The Database Handyman","article_published_time":"2015-10-18T15:51:36+00:00","og_image":[{"url":"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png","type":"","width":"","height":""}],"author":"Aamir","twitter_card":"summary_large_image","twitter_creator":"@aamir814","twitter_site":"@aamir814","twitter_misc":{"Written by":"Aamir","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.aamirharoon.com\/?p=18#article","isPartOf":{"@id":"https:\/\/www.aamirharoon.com\/?p=18"},"author":{"name":"Aamir","@id":"https:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63"},"headline":"ORA-01180: can not create datafile 1 during restore","datePublished":"2015-10-18T15:51:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.aamirharoon.com\/?p=18"},"wordCount":490,"commentCount":0,"publisher":{"@id":"https:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63"},"image":{"@id":"https:\/\/www.aamirharoon.com\/?p=18#primaryimage"},"thumbnailUrl":"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png","articleSection":["Oracle Database 11gR2"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.aamirharoon.com\/?p=18#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.aamirharoon.com\/?p=18","url":"https:\/\/www.aamirharoon.com\/?p=18","name":"ORA-01180: can not create datafile 1 during restore - The Database Handyman","isPartOf":{"@id":"https:\/\/www.aamirharoon.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.aamirharoon.com\/?p=18#primaryimage"},"image":{"@id":"https:\/\/www.aamirharoon.com\/?p=18#primaryimage"},"thumbnailUrl":"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png","datePublished":"2015-10-18T15:51:36+00:00","breadcrumb":{"@id":"https:\/\/www.aamirharoon.com\/?p=18#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.aamirharoon.com\/?p=18"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/www.aamirharoon.com\/?p=18#primaryimage","url":"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png","contentUrl":"http:\/\/www.aamirharoon.com\/wp-content\/plugins\/wp-emoji-one\/icons\/1F612.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.aamirharoon.com\/?p=18#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.aamirharoon.com\/"},{"@type":"ListItem","position":2,"name":"ORA-01180: can not create datafile 1 during restore"}]},{"@type":"WebSite","@id":"https:\/\/www.aamirharoon.com\/#website","url":"https:\/\/www.aamirharoon.com\/","name":"The Database Handyman","description":"My notes about Oracle Database, APEX, OEM Cloud Control and whatever I learn","publisher":{"@id":"https:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.aamirharoon.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":["Person","Organization"],"@id":"https:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63","name":"Aamir","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/www.aamirharoon.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cc5bb07711a1b9719cc47e13a8205072859c1aef30fac28f412baa84b9cf9b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cc5bb07711a1b9719cc47e13a8205072859c1aef30fac28f412baa84b9cf9b?s=96&d=mm&r=g","caption":"Aamir"},"logo":{"@id":"https:\/\/www.aamirharoon.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.aamirharoon.com\/about\/","https:\/\/x.com\/aamir814"],"url":"http:\/\/www.aamirharoon.com\/?author=1"}]}},"_links":{"self":[{"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18"}],"version-history":[{"count":13,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":60,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/posts\/18\/revisions\/60"}],"wp:attachment":[{"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}