{"id":6543,"date":"2015-12-15T21:50:48","date_gmt":"2015-12-15T20:50:48","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/"},"modified":"2015-12-15T21:50:48","modified_gmt":"2015-12-15T20:50:48","slug":"ocm-12c-preparation-transportable-tablespaces","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/","title":{"rendered":"OCM 12c preparation: Transportable Tablespaces"},"content":{"rendered":"<h2>By Franck Pachot<\/h2>\n<p>.<br \/>\nI use transportable tablespaces a lot since 8i, here are just a few examples.<br \/>\nSame disclaimer here as in the first post of the series: don\u2019t expect to get those posts close to what you will have at the exam, but they cover important points that matches the exam topics.<\/p>\n<h3>Documentation<\/h3>\n<p>Information about the exam says: <i>Create a plugged-in tablespace by using the transportable tablespace feature<\/i>. this is the TTS feature we know for a long time. The &#8216;plugged-in&#8217; term is how it was originally called (see patent: <a href=\"http:\/\/www.google.tl\/patents\/US5890167\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.google.tl\/patents\/US5890167<\/a> from 1997). When 12c came with pluggable database, I said that it was just an extension of the TTS feature where the SYSTEM tablespace can be transported as well, thanks to multitenant architecture that separates application dictionary.<br \/>\nWhat&#8217;s new in 12c is the ability to transport a whole database, which means use TTS for all non-system tablespaces.<br \/>\nSo about documentation, open the Oracle\u00ae Database Administrator&#8217;s Guide, search for &#8216;transport&#8217; and you have a whole chapter about transporting data. then go to: Transporting Database<\/p>\n<h3>Read only<\/h3>\n<p>I&#8217;ve a PDB pluggable database with some tablespaces and tables, and I set the user tablespace read-only;<\/p>\n<pre><code>\nsqlplus \/ as sysdba\ncreate pluggable database PDB admin user admin identified by admin file_name_convert=('\/u01\/app\/oracle\/oradata\/pdbseed','\/u02\/app\/oracle\/oradata\/PDB');\nalter pluggable database PDB open;\nalter session set container=PDB;\ngrant dba to DEMO identified by demo;\ncreate tablespace USERS datafile '\/tmp\/usersPDB.dbf' size 10M;\ncreate table DEMO.DEMO tablespace USERS as select current_timestamp ts from dual;\nalter tablespace USERS read only;\nquit\n<\/code><\/pre>\n<h3>Transport database<\/h3>\n<p>Then I create a new pluggable database from seed and create a database link to transport the tablespace into it:<\/p>\n<pre><code>\nsqlplus \/ as sysdba\ncreate pluggable database PDBNEW admin user admin identified by admin file_name_convert=('\/u01\/app\/oracle\/oradata\/pdbseed','\/u02\/app\/oracle\/oradata\/PDBNEW');\nalter session set container=PDBNEW;\nstartup\ncreate database link DBL_PDB connect to system identified by oracle using '\/\/localhost\/PDB';\ncreate directory TMP as '\/tmp';\nquit\ncp \/tmp\/usersPDB.dbf \/tmp\/usersPDBNEW.dbf\nimpdp '\"sys\/oracle@\/\/localhost\/PDBNEW as sysdba\"' network_link=DBL_PDB directory=TMP FULL=Y TRANSPORTABLE=always transport_datafiles=\/tmp\/usersPDBNEW.dbf\n<\/code><\/pre>\n<p>This is database transport. It&#8217;s just the possibility to use both FULL=Y and TRANSPORTABLE. I don&#8217;t like FULL imports because they bring some mess with pseudo system schemas. But with multitenant, what is in a PDB is only user schemas.<\/p>\n<h3>Transport tablespace<\/h3>\n<p>If I wanted to transport only the tablespace, I need to have the user created before:<\/p>\n<pre><code>\nsqlplus \/ as sysdba\nalter pluggable database PDBNEW close;\ndrop pluggable database PDBNEW including datafiles;\ncreate pluggable database PDBNEW admin user admin identified by admin file_name_convert=('\/u01\/app\/oracle\/oradata\/pdbseed','\/u02\/app\/oracle\/oradata\/PDBNEW');\nalter session set container=PDBNEW;\nstartup\ncreate database link DBL_PDB connect to system identified by oracle using '\/\/localhost\/PDB';\ncreate directory TMP as '\/tmp';\ngrant dba to DEMO identified by demo;\nquit\nimpdp '\"sys\/oracle@\/\/localhost\/PDBNEW as sysdba\"' network_link=DBL_PDB directory=TMP TRANSPORT_TABLESPACES=USERS transport_datafiles=\/tmp\/usersPDBNEW.dbf\n<\/code><\/pre>\n<p>This is the simple transport tablespace we know from a long time. Need to create the user, then all metadata is imported by data pump and data comes with the files. Here I used NETWORK_LINK because it&#8217;s the most simple, but everything is the same with a dumpfile. Need to copy datafiles with it to the target.<br \/>\nOn different endianness, RMAN can be used to convert. All is referenced in the &#8216;transporting data&#8217; chapter of documentation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Franck Pachot . I use transportable tablespaces a lot since 8i, here are just a few examples. Same disclaimer here as in the first post of the series: don\u2019t expect to get those posts close to what you will have at the exam, but they cover important points that matches the exam topics. Documentation [&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,59],"tags":[220,64,607,96,209,66,223],"type_dbi":[],"class_list":["post-6543","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","category-oracle","tag-cdb","tag-multitenant","tag-ocm","tag-oracle","tag-oracle-12c","tag-pdb","tag-pluggable-databases"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>OCM 12c preparation: Transportable Tablespaces - 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\/ocm-12c-preparation-transportable-tablespaces\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OCM 12c preparation: Transportable Tablespaces\" \/>\n<meta property=\"og:description\" content=\"By Franck Pachot . I use transportable tablespaces a lot since 8i, here are just a few examples. Same disclaimer here as in the first post of the series: don\u2019t expect to get those posts close to what you will have at the exam, but they cover important points that matches the exam topics. Documentation [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-15T20:50:48+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\\\/ocm-12c-preparation-transportable-tablespaces\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ocm-12c-preparation-transportable-tablespaces\\\/\"},\"author\":{\"name\":\"Oracle Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/66ab87129f2d357f09971bc7936a77ee\"},\"headline\":\"OCM 12c preparation: Transportable Tablespaces\",\"datePublished\":\"2015-12-15T20:50:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ocm-12c-preparation-transportable-tablespaces\\\/\"},\"wordCount\":368,\"commentCount\":0,\"keywords\":[\"CDB\",\"multitenant\",\"OCM\",\"Oracle\",\"Oracle 12c\",\"PDB\",\"Pluggable Databases\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ocm-12c-preparation-transportable-tablespaces\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ocm-12c-preparation-transportable-tablespaces\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ocm-12c-preparation-transportable-tablespaces\\\/\",\"name\":\"OCM 12c preparation: Transportable Tablespaces - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2015-12-15T20:50:48+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/66ab87129f2d357f09971bc7936a77ee\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ocm-12c-preparation-transportable-tablespaces\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ocm-12c-preparation-transportable-tablespaces\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ocm-12c-preparation-transportable-tablespaces\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OCM 12c preparation: Transportable Tablespaces\"}]},{\"@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":"OCM 12c preparation: Transportable Tablespaces - 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\/ocm-12c-preparation-transportable-tablespaces\/","og_locale":"en_US","og_type":"article","og_title":"OCM 12c preparation: Transportable Tablespaces","og_description":"By Franck Pachot . I use transportable tablespaces a lot since 8i, here are just a few examples. Same disclaimer here as in the first post of the series: don\u2019t expect to get those posts close to what you will have at the exam, but they cover important points that matches the exam topics. Documentation [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/","og_site_name":"dbi Blog","article_published_time":"2015-12-15T20:50:48+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\/ocm-12c-preparation-transportable-tablespaces\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/"},"author":{"name":"Oracle Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"headline":"OCM 12c preparation: Transportable Tablespaces","datePublished":"2015-12-15T20:50:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/"},"wordCount":368,"commentCount":0,"keywords":["CDB","multitenant","OCM","Oracle","Oracle 12c","PDB","Pluggable Databases"],"articleSection":["Database Administration &amp; Monitoring","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/","url":"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/","name":"OCM 12c preparation: Transportable Tablespaces - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2015-12-15T20:50:48+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/ocm-12c-preparation-transportable-tablespaces\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"OCM 12c preparation: Transportable Tablespaces"}]},{"@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\/6543","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=6543"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/6543\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=6543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=6543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=6543"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=6543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}