{"id":10564,"date":"2018-02-07T19:50:34","date_gmt":"2018-02-07T18:50:34","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/"},"modified":"2018-02-07T19:50:34","modified_gmt":"2018-02-07T18:50:34","slug":"12cr2-pdb-archive","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/","title":{"rendered":"12cR2 PDB archive"},"content":{"rendered":"<h2>By Franck Pachot<\/h2>\n<p>.<br \/>\nIn 12.1 we had the possibility to unplug a PDB by closing it and generating a .xml file that describes the PDB metadata required to plug the datafiles into another CDB.<br \/>\nIn 12.2 we got an additional possibility to have this .xml file zipped together with the datafiles, for an easy transport. But that was not working for ASM files.<br \/>\nThe latest Release Update, Oct 17 includes the patch that fixes this issue and is the occasion to show PDB archive.<br \/>\n<!--more--><br \/>\nHere is Oracle 12.2.0.1 with Oct 2017 (<a href=\"https:\/\/updates.oracle.com\/download\/26737266.html\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/updates.oracle.com\/download\/26737266.html<\/a>) applied (needs latest OPatch <a href=\"https:\/\/updates.oracle.com\/download\/26737266.html\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/updates.oracle.com\/download\/6880880.html<\/a>)<br \/>\nWith a PDB1 pluggable database:<\/p>\n<pre><code>\n[oracle@VM106 ~]$ rman target \/\n&nbsp;\nRecovery Manager: Release 12.2.0.1.0 - Production on Wed Oct 18 16:16:41 2017\n&nbsp;\nCopyright (c) 1982, 2017, Oracle and\/or its affiliates.  All rights reserved.\n&nbsp;\nconnected to target database: CDB1 (DBID=920040307)\n&nbsp;\nRMAN&gt; report schema;\n&nbsp;\nusing target database control file instead of recovery catalog\nReport of database schema for database with db_unique_name CDB1\n&nbsp;\nList of Permanent Datafiles\n===========================\nFile Size(MB) Tablespace           RB segs Datafile Name\n---- -------- -------------------- ------- ------------------------\n1    810      SYSTEM               YES     \/acfs\/oradata\/CDB1\/datafile\/o1_mf_system_dmrbv534_.dbf\n3    540      SYSAUX               NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_sysaux_dmrbxvds_.dbf\n4    70       UNDOTBS1             YES     \/acfs\/oradata\/CDB1\/datafile\/o1_mf_undotbs1_dmrbz8mm_.dbf\n5    250      PDB$SEED:SYSTEM      NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_system_dmrc52tm_.dbf\n6    330      PDB$SEED:SYSAUX      NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_sysaux_dmrc52t9_.dbf\n7    5        USERS                NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_users_dygrpz79_.dbf\n8    100      PDB$SEED:UNDOTBS1    NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_undotbs1_dmrc52x0_.dbf\n21   250      PDB1:SYSTEM          YES     \/acfs\/oradata\/CDB1\/5BD3ED9D73B079D2E0536A4EA8C0967B\/datafile\/o1_mf_system_dygrqqq2_.dbf\n22   350      PDB1:SYSAUX          NO      \/acfs\/oradata\/CDB1\/5BD3ED9D73B079D2E0536A4EA8C0967B\/datafile\/o1_mf_sysaux_dygrqqs8_.dbf\n23   100      PDB1:UNDOTBS1        YES     +ASM1\/CDB1\/5BD3ED9D73B079D2E0536A4EA8C0967B\/DATAFILE\/undotbs1.257.957719779\n&nbsp;\nList of Temporary Files\n=======================\nFile Size(MB) Tablespace           Maxsize(MB) Tempfile Name\n---- -------- -------------------- ----------- --------------------\n1    33       TEMP                 32767       \/acfs\/oradata\/CDB1\/datafile\/o1_mf_temp_dmrc4wlh_.tmp\n2    64       PDB$SEED:TEMP        32767       \/acfs\/oradata\/CDB1\/pdbseed\/temp012017-06-10_19-17-38-745-PM.dbf\n3    64       PDB1:TEMP            32767       \/acfs\/oradata\/CDB1\/5BD3ED9D73B079D2E0536A4EA8C0967B\/datafile\/o1_mf_temp_dygrqqsh_.dbf\n<\/code><\/pre>\n<p>I have moved one file to ASM to show that it is now handled correctly.<\/p>\n<p>The pluggable database is closed, we can unplug it. Nothing changes with the unplug syntax except the extension of the file. If the file mentioned is a .pdb instead of a .xml then it is a PDB archive:<\/p>\n<pre><code>\nRMAN&gt; alter pluggable database PDB1 unplug into '\/var\/tmp\/PDB1.pdb';\n&nbsp;\nRMAN&gt; alter pluggable database PDB1 close;\n&nbsp;\nStatement processed\n&nbsp;\nRMAN&gt; alter pluggable database PDB1 unplug into '\/var\/tmp\/PDB1.pdb'\n2&gt; ;\n&nbsp;\nStatement processed\n&nbsp;\nRMAN&gt; exit\n<\/code><\/pre>\n<p>Actually it is just a zip file with the datafiles, without the full path:<\/p>\n<pre><code>\n[oracle@VM106 ~]$ unzip -t \/var\/tmp\/PDB1.pdb\nArchive:  \/var\/tmp\/PDB1.pdb\n    testing: o1_mf_system_dygrqqq2_.dbf   OK\n    testing: o1_mf_sysaux_dygrqqs8_.dbf   OK\n    testing: undotbs1.257.957719779   OK\n    testing: \/var\/tmp\/PDB1.xml        OK\nNo errors detected in compressed data of \/var\/tmp\/PDB1.pdb.\n<\/code><\/pre>\n<p>You can see that the ASM file is not different from the others.<\/p>\n<p>I drop the pluggable database<\/p>\n<pre><code>\nRMAN&gt; drop pluggable database PDB1 including datafiles;\n&nbsp;\nusing target database control file instead of recovery catalog\nStatement processed\n&nbsp;\n<\/code><\/pre>\n<p>And plug back the PDB1, as PDB2, using the zip file:<\/p>\n<pre><code>\nRMAN&gt; create pluggable database PDB2 using '\/var\/tmp\/PDB1.pdb';\n&nbsp;\nStatement processed\n&nbsp;\nRMAN&gt; report schema;\n&nbsp;\nReport of database schema for database with db_unique_name CDB1\n&nbsp;\nList of Permanent Datafiles\n===========================\nFile Size(MB) Tablespace           RB segs Datafile Name\n---- -------- -------------------- ------- ------------------------\n1    810      SYSTEM               YES     \/acfs\/oradata\/CDB1\/datafile\/o1_mf_system_dmrbv534_.dbf\n3    540      SYSAUX               NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_sysaux_dmrbxvds_.dbf\n4    70       UNDOTBS1             YES     \/acfs\/oradata\/CDB1\/datafile\/o1_mf_undotbs1_dmrbz8mm_.dbf\n5    250      PDB$SEED:SYSTEM      NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_system_dmrc52tm_.dbf\n6    330      PDB$SEED:SYSAUX      NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_sysaux_dmrc52t9_.dbf\n7    5        USERS                NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_users_dygrpz79_.dbf\n8    100      PDB$SEED:UNDOTBS1    NO      \/acfs\/oradata\/CDB1\/datafile\/o1_mf_undotbs1_dmrc52x0_.dbf\n24   250      PDB2:SYSTEM          NO      \/acfs\/oradata\/CDB1\/5BD3ED9D73B079D2E0536A4EA8C0967B\/datafile\/o1_mf_system_dygwt1lh_.dbf\n25   350      PDB2:SYSAUX          NO      \/acfs\/oradata\/CDB1\/5BD3ED9D73B079D2E0536A4EA8C0967B\/datafile\/o1_mf_sysaux_dygwt1lm_.dbf\n26   100      PDB2:UNDOTBS1        NO      \/acfs\/oradata\/CDB1\/5BD3ED9D73B079D2E0536A4EA8C0967B\/datafile\/o1_mf_undotbs1_dygwt1lo_.dbf\n&nbsp;\nList of Temporary Files\n=======================\nFile Size(MB) Tablespace           Maxsize(MB) Tempfile Name\n---- -------- -------------------- ----------- --------------------\n1    33       TEMP                 32767       \/acfs\/oradata\/CDB1\/datafile\/o1_mf_temp_dmrc4wlh_.tmp\n2    64       PDB$SEED:TEMP        32767       \/acfs\/oradata\/CDB1\/pdbseed\/temp012017-06-10_19-17-38-745-PM.dbf\n4    64       PDB2:TEMP            32767       \/acfs\/oradata\/CDB1\/5BD3ED9D73B079D2E0536A4EA8C0967B\/datafile\/o1_mf_temp_dygwt1lp_.dbf\n<\/code><\/pre>\n<p>Here all files are there, created in the db_create_file_dest.<\/p>\n<h3>File name convert<\/h3>\n<p>When you create a pluggable database and you are not in OMF you need to add a FILE_NAME_CONVERT to convert from the source file names to destination file names. When the files are referenced by a .xml file, the .xml file references the path to the files as they were in the source database. If you move then, you can update the .xml file, or you can use SOURCE_FILE_NAME_CONVERT to mention the new place. With a .pdb archive, the .xml inside contains the original path, but this is not what will be used. The path of the .pdb itself is used, as if the files were unzipped at that place.<\/p>\n<p>If you use Oracle-Managed-Files, don&#8217;t care about the file names and then you don&#8217;t need all those file name converts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Franck Pachot . In 12.1 we had the possibility to unplug a PDB by closing it and generating a .xml file that describes the PDB metadata required to plug the datafiles into another CDB. In 12.2 we got an additional possibility to have this .xml file zipped together with the datafiles, for an easy [&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":[59],"tags":[64,988],"type_dbi":[],"class_list":["post-10564","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-multitenant","tag-oracle-12-2"],"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>12cR2 PDB archive - 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\/12cr2-pdb-archive\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"12cR2 PDB archive\" \/>\n<meta property=\"og:description\" content=\"By Franck Pachot . In 12.1 we had the possibility to unplug a PDB by closing it and generating a .xml file that describes the PDB metadata required to plug the datafiles into another CDB. In 12.2 we got an additional possibility to have this .xml file zipped together with the datafiles, for an easy [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-07T18:50:34+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=\"5 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\/12cr2-pdb-archive\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/\"},\"author\":{\"name\":\"Oracle Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"headline\":\"12cR2 PDB archive\",\"datePublished\":\"2018-02-07T18:50:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/\"},\"wordCount\":358,\"commentCount\":0,\"keywords\":[\"multitenant\",\"Oracle 12.2\"],\"articleSection\":[\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/\",\"name\":\"12cR2 PDB archive - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2018-02-07T18:50:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"12cR2 PDB archive\"}]},{\"@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":"12cR2 PDB archive - 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\/12cr2-pdb-archive\/","og_locale":"en_US","og_type":"article","og_title":"12cR2 PDB archive","og_description":"By Franck Pachot . In 12.1 we had the possibility to unplug a PDB by closing it and generating a .xml file that describes the PDB metadata required to plug the datafiles into another CDB. In 12.2 we got an additional possibility to have this .xml file zipped together with the datafiles, for an easy [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/","og_site_name":"dbi Blog","article_published_time":"2018-02-07T18:50:34+00:00","author":"Oracle Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Oracle Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/"},"author":{"name":"Oracle Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"headline":"12cR2 PDB archive","datePublished":"2018-02-07T18:50:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/"},"wordCount":358,"commentCount":0,"keywords":["multitenant","Oracle 12.2"],"articleSection":["Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/","url":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/","name":"12cR2 PDB archive - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2018-02-07T18:50:34+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-pdb-archive\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"12cR2 PDB archive"}]},{"@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\/10564","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=10564"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/10564\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=10564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=10564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=10564"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=10564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}