{"id":9246,"date":"2016-11-09T10:06:52","date_gmt":"2016-11-09T09:06:52","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/"},"modified":"2016-11-09T10:06:52","modified_gmt":"2016-11-09T09:06:52","slug":"oracle-12c-db_unknown-in-asm","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/","title":{"rendered":"Oracle 12c &#8211; DB_UNKNOWN in ASM"},"content":{"rendered":"<h2>By William Sescu<\/h2>\n<p>Have you ever noticed a DB_UNKNOWN directory in your ASM structure? It usually happens in combination with spfile creation in ASM, or with RMAN spfile restores to ASM.<\/p>\n<p>The correct location is +DATA\/&lt;SID&gt;\/PARAMETERFILE\/SPFILE.&lt;#&gt;.&lt;#&gt;, and an ASM alias from +DATA\/&lt;SID&gt;\/ pointing to it.<\/p>\n<p>But sometimes, the spfile ends up in +DATA\/DB_UNKNOWN\/PARAMETERFILE\/SPFILE.&lt;#&gt;.&lt;#&gt;<\/p>\n<p>Technically no issue. The spfile in the DB_UNKNOWN directory is perfectly ok and can be used. However, you might need to adjust your init&lt;SID&gt;.ora in case you have a config like the following<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">oracle@oel001:\/u00\/app\/oracle\/product\/12.1.0.2\/dbs\/ [OCM121] cat initOCM121.ora\nSPFILE='+data\/DB_UNKNOWN\/PARAMETERFILE\/SPFILE.293.927371209'<\/pre>\n<p>Maybe you have a 4 node RAC, then you need to adjust it on every node. Maybe you have a cluster resource with a spfile entry. Then you need to adjust that one as well. And besides that, to what database does the DB_UNKNOWN belong to? Imagine you have 20 DB&#8217;s running and you need to find out, which database has something in the DB_UNKNOWN directory, in case there are more entries.<\/p>\n<p>No &#8230; it is not a good situation. It has to be corrected. But how?<\/p>\n<p>First of all, let&#8217;s create a situation that ends up with a DB_UNKNOWN directory.<\/p>\n<p>It is quite easy to do. Typically, with spfile restores or with a &#8220;create spfile from pfile&#8221;<\/p>\n<ol>\n<li>Shutdown the DB<\/li>\n<li>Startup RMAN dummy instance<\/li>\n<li>Restore the spfile to pfile<\/li>\n<li>Shutdown the Instance<\/li>\n<li>Adjust the pfile<\/li>\n<li>Create the spfile from pfile while the DB is shutdown<\/li>\n<\/ol>\n<p>Here is an example with 12cR1 (12.1.0.2). I am jumping directly to the RMAN restore, because RMAN dummy instance was already explained in <a href=\"http:\/\/dbi-services.com\/blog\/oracle-12c-when-the-rman-dummy-instance-does-not-start-up\/\">http:\/\/dbi-services.com\/blog\/oracle-12c-when-the-rman-dummy-instance-does-not-start-up\/<\/a><\/p>\n<p>Ok. Let&#8217;s check the current location of the spfile of the cluster resource.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">oracle@oel001:\/home\/oracle\/ [OCM121] srvctl config database -d OCM121 | grep -i spfile\nSpfile: +DATA\/OCM121\/spfileOCM121.ora<\/pre>\n<p>Now we can run the RMAN restore of the spfile to pfile. Restoring it to a pfile first has the advantage, that we can take a look at all settings and maybe adjust them, before we put it back into production.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">run {\nrestore spfile to pfile '\/tmp\/initOCM121.ora' for db_unique_name='OCM121' from\n'+fra\/OCM121\/AUTOBACKUP\/2016_10_29\/s_926511850.517.926511853';\n}\n\nStarting restore at 08-NOV-2016 11:01:04\nusing target database control file instead of recovery catalog\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=364 device type=DISK\nallocated channel: ORA_DISK_2\nchannel ORA_DISK_2: SID=12 device type=DISK\nchannel ORA_DISK_2: skipped, AUTOBACKUP already found\nchannel ORA_DISK_1: restoring spfile from AUTOBACKUP +fra\/OCM121\/AUTOBACKUP\/2016_10_29\/s_926511850.517.926511853\nchannel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete\nFinished restore at 08-NOV-2016 11:01:14<\/pre>\n<p>The pfile was successfully created. Now we can correct some settings in the pfile if we want and then create a spfile again.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">oracle@oel001:\/home\/oracle\/ [OCM121] ls -l \/tmp\/initOCM121.ora\n-rw-r--r-- 1 oracle asmadmin 1777 Nov  8 11:01 \/tmp\/initOCM121.ora<\/pre>\n<p>Ok. Let&#8217;s create the new spfile while the DB is shutdown.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">oracle@oel001:\/home\/oracle\/ [OCM121] sqh\n\nSQL*Plus: Release 12.1.0.2.0 Production on Tue Nov 8 11:03:56 2016\n\nCopyright (c) 1982, 2014, Oracle.  All rights reserved.\n\nConnected to an idle instance.\n\nSQL&gt; create spfile='+DATA' from pfile='\/tmp\/initOCM121.ora';\n\nFile created.<\/pre>\n<p>Oppssss &#8230; and now it happened. The directory DB_UNKNOWN is created. While the database is shutdown, Oracle does not know the DB_NAME and so, it has to create a placeholder directory to save the spfile.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">ASMCMD&gt; pwd\n+data\nASMCMD&gt; ls -l\nType  Redund  Striped  Time             Sys  Name\n                                        Y    CDB121\/\n                                        Y    DB_UNKNOWN\/\n                                        Y    OCM121\/\n\nASMCMD&gt; pwd\n+data\/DB_UNKNOWN\/PARAMETERFILE\nASMCMD&gt; ls -l\nType           Redund  Striped  Time             Sys  Name\nPARAMETERFILE  UNPROT  COARSE   NOV 08 11:00:00  Y    SPFILE.293.927371209<\/pre>\n<p>However, this is not the configuration that we want. To correct it, cleanup the DB_UNKNOWN entries, and start your DB into the nomount state and execute then the spfile from pfile command again.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">SQL&gt; startup nomount pfile=\/tmp\/initOCM121.ora\nORACLE instance started.\n\nTotal System Global Area 1610612736 bytes\nFixed Size                  2924928 bytes\nVariable Size             436211328 bytes\nDatabase Buffers         1157627904 bytes\nRedo Buffers               13848576 bytes\n\nSQL&gt; create spfile='+DATA' from pfile='\/tmp\/initOCM121.ora';\n\nFile created.<\/pre>\n<p>And here we go. The spfile is the correct location.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">ASMCMD&gt; pwd\n+data\/OCM121\/PARAMETERFILE\nASMCMD&gt; ls -l\nType           Redund  Striped  Time             Sys  Name\nPARAMETERFILE  UNPROT  COARSE   NOV 08 11:00:00  Y    spfile.291.927372029<\/pre>\n<p>The only thing missing is the ASM alias. That one has to be created manually afterwards.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">ASMCMD&gt; cd +data\/OCM121\nASMCMD&gt; mkalias +data\/OCM121\/PARAMETERFILE\/spfile.291.927372029 spfileOCM121.ora\nASMCMD&gt;<\/pre>\n<h3>Conclusion<\/h3>\n<p>It makes a big difference if you create your spfile in the nomount state or while the database is shutdown. You might end up with a totally different directory structure in ASM. With 12.1.0.2 and 11.2.0.4 the nomount state is enough to end up in the correct location. In earlier versions you might need to startup mount to have the same effect.<\/p>\n<p>Cheers,<br \/>\nWilliam<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By William Sescu Have you ever noticed a DB_UNKNOWN directory in your ASM structure? It usually happens in combination with spfile creation in ASM, or with RMAN spfile restores to ASM. The correct location is +DATA\/&lt;SID&gt;\/PARAMETERFILE\/SPFILE.&lt;#&gt;.&lt;#&gt;, and an ASM alias from +DATA\/&lt;SID&gt;\/ pointing to it. But sometimes, the spfile ends up in +DATA\/DB_UNKNOWN\/PARAMETERFILE\/SPFILE.&lt;#&gt;.&lt;#&gt; Technically no [&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],"tags":[209,270],"type_dbi":[],"class_list":["post-9246","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","tag-oracle-12c","tag-rman"],"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>Oracle 12c - DB_UNKNOWN in ASM - 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\/oracle-12c-db_unknown-in-asm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oracle 12c - DB_UNKNOWN in ASM\" \/>\n<meta property=\"og:description\" content=\"By William Sescu Have you ever noticed a DB_UNKNOWN directory in your ASM structure? It usually happens in combination with spfile creation in ASM, or with RMAN spfile restores to ASM. The correct location is +DATA\/&lt;SID&gt;\/PARAMETERFILE\/SPFILE.&lt;#&gt;.&lt;#&gt;, and an ASM alias from +DATA\/&lt;SID&gt;\/ pointing to it. But sometimes, the spfile ends up in +DATA\/DB_UNKNOWN\/PARAMETERFILE\/SPFILE.&lt;#&gt;.&lt;#&gt; Technically no [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-09T09:06:52+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=\"4 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\/oracle-12c-db_unknown-in-asm\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/\"},\"author\":{\"name\":\"Oracle Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"headline\":\"Oracle 12c &#8211; DB_UNKNOWN in ASM\",\"datePublished\":\"2016-11-09T09:06:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/\"},\"wordCount\":546,\"commentCount\":0,\"keywords\":[\"Oracle 12c\",\"RMAN\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/\",\"name\":\"Oracle 12c - DB_UNKNOWN in ASM - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2016-11-09T09:06:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Oracle 12c &#8211; DB_UNKNOWN in ASM\"}]},{\"@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":"Oracle 12c - DB_UNKNOWN in ASM - 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\/oracle-12c-db_unknown-in-asm\/","og_locale":"en_US","og_type":"article","og_title":"Oracle 12c - DB_UNKNOWN in ASM","og_description":"By William Sescu Have you ever noticed a DB_UNKNOWN directory in your ASM structure? It usually happens in combination with spfile creation in ASM, or with RMAN spfile restores to ASM. The correct location is +DATA\/&lt;SID&gt;\/PARAMETERFILE\/SPFILE.&lt;#&gt;.&lt;#&gt;, and an ASM alias from +DATA\/&lt;SID&gt;\/ pointing to it. But sometimes, the spfile ends up in +DATA\/DB_UNKNOWN\/PARAMETERFILE\/SPFILE.&lt;#&gt;.&lt;#&gt; Technically no [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/","og_site_name":"dbi Blog","article_published_time":"2016-11-09T09:06:52+00:00","author":"Oracle Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Oracle Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/"},"author":{"name":"Oracle Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"headline":"Oracle 12c &#8211; DB_UNKNOWN in ASM","datePublished":"2016-11-09T09:06:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/"},"wordCount":546,"commentCount":0,"keywords":["Oracle 12c","RMAN"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/","url":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/","name":"Oracle 12c - DB_UNKNOWN in ASM - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2016-11-09T09:06:52+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/oracle-12c-db_unknown-in-asm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Oracle 12c &#8211; DB_UNKNOWN in ASM"}]},{"@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\/9246","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=9246"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9246\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=9246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=9246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=9246"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=9246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}