{"id":17139,"date":"2022-02-24T14:47:11","date_gmt":"2022-02-24T13:47:11","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/"},"modified":"2023-01-06T11:36:33","modified_gmt":"2023-01-06T10:36:33","slug":"important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/","title":{"rendered":"Important DBCA Parameter if you plan to use Storage Snapshot Cloning in ASM"},"content":{"rendered":"<p>I am currently working on a customer project to create database clones using storage snapshots. The advantages are obvious, because using a storage snapshot as a clone not only saves space, but is also extremely fast compared to a full clone.<br \/>\nThis post is not about explaining in detail how to implement the snapshot clone technically, but it should point out an important point to think about when creating the source DB with the DBCA.<\/p>\n<p>A short overview how the snapshot cloning is done with ASM:<\/p>\n<ul>\n<li>Set Source DB in backup mode<\/li>\n<li>Create a snapshot of the whole ASM disk group on storage level<\/li>\n<li>Deactivate backup mode on source DB<\/li>\n<li>Present snapshot of LUNS on test server<\/li>\n<li>Rename diskgroup with renamedg utility<\/li>\n<li>Mount diskgroup under new name in ASM<\/li>\n<li><strong>adjust db_unique_name in ASM<\/strong><\/li>\n<li>create new control files for the DB<\/li>\n<li>open DB with open resetlogs<\/li>\n<\/ul>\n<p>The point I want to go into here is &#8221; adjust db_unique_name in ASM&#8221;. If you create e.g. on the diskgroup +DATA a new DB, the directory structure in the ASM for the DB looks like this:<\/p>\n<pre>+DATA\/PROD_SITE1\n+DATA\/PROD_SITE1\/CONTROLFILE\n+DATA\/PROD_SITE1\/DATAFILE\n+DATA\/PROD_SITE1\/ONLINELOG\n+DATA\/PROD_SITE1\/TEMPFILE<\/pre>\n<p>&nbsp;<\/p>\n<p>If we assume that our cloned database should be named TEST01 and we have renamed the diskgroup in ASM from + DATA to +DATA_TEST, after mounting the new diskgroup the directory structure on this diskgroup looks like this:<\/p>\n<pre>+DATA_TEST\/PROD_SITE1\n+DATA_TEST\/PROD_SITE1\/CONTROLFILE\n+DATA_TEST\/PROD_SITE1\/DATAFILE\n+DATA_TEST\/PROD_SITE1\/ONLINELOG\n+DATA_TEST\/PROD_SITE1\/TEMPFILE<\/pre>\n<p>&nbsp;<\/p>\n<p>Before we can create new controlfiles with the DB name TEST01 we have to rename in ASM the directory with the db_unique_name from PROD_SITE1 to TEST01_SITE1.<br \/>\nIn ASM there is no mv command, so the directories have to be adjusted with SQL statement on the ASM instance. This works as follows:<\/p>\n<pre class=\"brush: sql; gutter: false; first-line: 1\">SQL&gt; alter diskgroup DATA_TEST rename directory '+DATA_TEST\/PROD_SITE1' to '+DATA_TEST\/TEST01_SITE1';\n\nERROR at line 1:\nORA-15032: not all alterations performed\nORA-15177: cannot operate on system aliases<\/pre>\n<p>Here we have a problem. In ASM there are two types of directories. <strong>&#8220;System Generated (Y)&#8221;<\/strong> and <strong>&#8220;manually created (N)&#8221;<\/strong>.<br \/>\nIf i query the directory in asmcmd i see, that my database that was created with dbca has a &#8220;System generated&#8221; name.<\/p>\n<pre class=\"brush: sql; gutter: false; first-line: 1\">ASMCMD&gt; ls -la\n\nType  Redund  Striped  Time  Sys  Name\n                             Y    ASM\/\n                             Y    PROD_SITE1\/<\/pre>\n<p>&nbsp;<\/p>\n<p>When Oracle creates a directory it is always System generated and when manually created with mkdir in asm it is &#8220;non System generated&#8221;.<br \/>\nYou have to know that a &#8220;System generated directory&#8221; <strong>can never be renamed<\/strong>. This is not possible in ASM and there is no workaround for this.<br \/>\nBecause we created our source DB with the DBCA, the directory PROD_SITE1 was created as &#8220;System generated&#8221;, so we don&#8217;t have the possibility to change the path for the datafiles to our new name TEST01_SITE1.<\/p>\n<p>One possibility would be to add the new control files anyway and still refer to the old db_unique_name as path. With this the DB could be started and if you query e.g. v$datafile afterwards you would still see the wrong db-unique_name there.<br \/>\nTo correct this we could force an online move of the datafile, but the disadvantage is that we copy the whole DB once in ASM and that is exactly what we want to prevent with the snapshot cloning.<\/p>\n<pre class=\"brush: sql; gutter: false; first-line: 1\">alter database move datafile {DATAFILE_PATH} to '+DATA_TEST';<\/pre>\n<p>So what is the solution for this problem?<br \/>\nWe have to make sure already when creating the source DB (PROD) that the DBCA does not create the directory as &#8220;system generated&#8221;, so that after cloning&nbsp; we have the possibility to rename it on the new diskgroup.<\/p>\n<p>For this in the DBCA there is the parameter<\/p>\n<p><strong>-datafileDestination<\/strong><\/p>\n<p>If this parameter is set explicitly during the DBCA create database statement, the directory is created in ASM as &#8220;manually generated&#8221; and therefore it can be renamed later.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am currently working on a customer project to create database clones using storage snapshots. The advantages are obvious, because using a storage snapshot as a clone not only saves space, but is also extremely fast compared to a full clone. This post is not about explaining in detail how to implement the snapshot clone [&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":[2474,37,1171,2499],"type_dbi":[],"class_list":["post-17139","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","tag-alain-fuhrer","tag-asm","tag-oracle-19c","tag-snapshot-clones"],"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>Important DBCA Parameter if you plan to use Storage Snapshot Cloning 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\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Important DBCA Parameter if you plan to use Storage Snapshot Cloning in ASM\" \/>\n<meta property=\"og:description\" content=\"I am currently working on a customer project to create database clones using storage snapshots. The advantages are obvious, because using a storage snapshot as a clone not only saves space, but is also extremely fast compared to a full clone. This post is not about explaining in detail how to implement the snapshot clone [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-24T13:47:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-06T10:36:33+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=\"3 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\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/\"},\"author\":{\"name\":\"Oracle Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"headline\":\"Important DBCA Parameter if you plan to use Storage Snapshot Cloning in ASM\",\"datePublished\":\"2022-02-24T13:47:11+00:00\",\"dateModified\":\"2023-01-06T10:36:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/\"},\"wordCount\":595,\"commentCount\":0,\"keywords\":[\"Alain Fuhrer\",\"ASM\",\"Oracle 19c\",\"Snapshot Clones\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/\",\"name\":\"Important DBCA Parameter if you plan to use Storage Snapshot Cloning in ASM - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2022-02-24T13:47:11+00:00\",\"dateModified\":\"2023-01-06T10:36:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Important DBCA Parameter if you plan to use Storage Snapshot Cloning 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":"Important DBCA Parameter if you plan to use Storage Snapshot Cloning 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\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/","og_locale":"en_US","og_type":"article","og_title":"Important DBCA Parameter if you plan to use Storage Snapshot Cloning in ASM","og_description":"I am currently working on a customer project to create database clones using storage snapshots. The advantages are obvious, because using a storage snapshot as a clone not only saves space, but is also extremely fast compared to a full clone. This post is not about explaining in detail how to implement the snapshot clone [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/","og_site_name":"dbi Blog","article_published_time":"2022-02-24T13:47:11+00:00","article_modified_time":"2023-01-06T10:36:33+00:00","author":"Oracle Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Oracle Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/"},"author":{"name":"Oracle Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"headline":"Important DBCA Parameter if you plan to use Storage Snapshot Cloning in ASM","datePublished":"2022-02-24T13:47:11+00:00","dateModified":"2023-01-06T10:36:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/"},"wordCount":595,"commentCount":0,"keywords":["Alain Fuhrer","ASM","Oracle 19c","Snapshot Clones"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/","url":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/","name":"Important DBCA Parameter if you plan to use Storage Snapshot Cloning in ASM - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2022-02-24T13:47:11+00:00","dateModified":"2023-01-06T10:36:33+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/important-dbca-parameter-if-you-plan-to-use-storage-snapshot-cloning-in-asm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Important DBCA Parameter if you plan to use Storage Snapshot Cloning 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\/17139","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=17139"}],"version-history":[{"count":1,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/17139\/revisions"}],"predecessor-version":[{"id":21465,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/17139\/revisions\/21465"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=17139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=17139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=17139"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=17139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}