{"id":16948,"date":"2021-12-03T11:00:14","date_gmt":"2021-12-03T10:00:14","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/"},"modified":"2021-12-03T11:00:14","modified_gmt":"2021-12-03T10:00:14","slug":"move-a-pdb-from-a-server-to-another-one-using-nfs","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/","title":{"rendered":"Move a PDB from a server to another one using NFS"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Multitenant brings new possibilities regarding Oracle databases, and one of them is to move a database from a container to another quite easily. When containers are on the same server, it&#8217;s very easy, but when the containers are on different servers, you will need to use a database link or an RMAN restore. But there is also another solution if you don&#8217;t want to use the previous ones: using a NFS volume. <\/p>\n<h2>Test lab<\/h2>\n<p>All these tests were done between 2 ODAs: one X8-2M and one X7-2M, both running the same patch version (19.12). This is important to run the same DB home version as moving PDB between different container versions will need to patch the database if the destination container is newer, and I&#8217;m not sure you can downgrade the PDB if its new container runs an older version.<\/p>\n<p>My 2 containers are both using ASM, and as you may know, ODA is nothing else than an x86_64 server running Linux 7, so this should be the same on any other Linux boxes.<\/p>\n<h2>Requirements for the shared NFS volume<\/h2>\n<p>As you will temporarily move the PDB to this shared NFS volume, you will need special mount options when mounting your volume. Here is an example:<\/p>\n<pre><code>echo \"192.168.61.50:\/nfsoracle \/u01\/nfsdir\/ nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600\" &gt;&gt; \/etc\/fstab\nmount -a<\/code><\/pre>\n<h2>1st step, move the PDB to the NFS volume<\/h2>\n<p>The goal being to move the PDB to another server, let&#8217;s do a clean shutdown of the PDB on the source server:<\/p>\n<pre><code>. oraenv &lt;&lt;&lt; POCCDB\nsqlplus \/ as sysdba\nshow pdbs\nCON_ID     CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n2          PDB$SEED                       READ ONLY  NO\n3          POCPDB                         READ WRITE NO\n4          GOTAFO                         READ WRITE NO\n\nalter pluggable database GOTAFO close immediate;\n\nshow pdbs\n\nCON_ID     CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n2          PDB$SEED                       READ ONLY  NO\n3          POCPDB                         READ WRITE NO\n4          GOTAFO                         MOUNTED\n\nexit<\/code><\/pre>\n<p>Now let&#8217;s move this PDB to the NFS share:<\/p>\n<pre><code>rman target \/\nrun {\nallocate channel c1 type disk;\nallocate channel c2 type disk;\nbackup as copy pluggable database GOTAFO format '\/u01\/nfsdir\/DUMPS\/move_pdb\/%U';\n}\nSwitch pluggable database GOTAFO to copy;\nexit;<\/code><\/pre>\n<p>Now my PDB datafiles are located on the NFS share, and my files on ASM are flagged as backup copies of my datafiles.<\/p>\n<p>Let&#8217;s unplug this PDB, XML file being also put in this NFS share:<\/p>\n<pre><code>sqlplus \/ as sysdba\nalter pluggable database GOTAFO unplug into '\/u01\/nfsdir\/DUMPS\/move_pdb\/GOTAFO.xml';\ndrop pluggable database GOTAFO keep datafiles ;\n\nshow pdbs\n\nCON_ID     CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n2          PDB$SEED                       READ ONLY  NO\n4          POCPDB.                        READ WRITE NO\n\nexit<\/code><\/pre>\n<p>PDB doesn&#8217;t belong anymore to this container.<\/p>\n<h2>2nd step, plug the PDB to the new container<\/h2>\n<p>On the target server having the same NFS share mounted, let&#8217;s plug this PDB:<\/p>\n<pre><code>. oraenv &lt;&lt;&lt; POCCDB\nsqlplus \/ as sysdba\ncreate pluggable database GOTAFO using &#039;\/u01\/nfsdir\/DUMPS\/move_pdb\/GOTAFO.xml&#039;;\nexit;<\/code><\/pre>\n<p>Datafiles now need to move from NFS to ASM, let&#8217;s do that with RMAN:<\/p>\n<pre><code>rman target \/\nrun {\nallocate channel c1 type disk;\nallocate channel c2 type disk;\nbackup as copy pluggable database GOTAFO format '+DATA';\n}\n\u2003\nSwitch pluggable database GOTAFO to copy;\nexit;\n<\/code><\/pre>\n<p>Now database is located in ASM, and files on the share are identified as backup copies of my datafiles.<\/p>\n<h2>3rd step, open the PDB and check if everything is OK<\/h2>\n<p>Let&#8217;s open the PDB and check if datafiles are in ASM as expected:<\/p>\n<pre><code>sqlplus \/ as sysdba\n\nalter pluggable database GOTAFO open;\nalter pluggable database GOTAFO save state ;\nalter session set container=GOTAFO ;\nselect file_name from dba_data_files;\nFILE_NAME\n----------------------------------------------------------------------------------\n+DATA\/POCCDB_DRP\/D046C4A6F65A7268E0534401C80AC247\/DATAFILE\/system.908.1090162863\n+DATA\/POCCDB_DRP\/D046C4A6F65A7268E0534401C80AC247\/DATAFILE\/sysaux.909.1090162863\n+DATA\/POCCDB_DRP\/D046C4A6F65A7268E0534401C80AC247\/DATAFILE\/undotbs1.906.1090162863\n+DATA\/POCCDB_DRP\/D046C4A6F65A7268E0534401C80AC247\/DATAFILE\/users.603.1090162863\n+DATA\/POCCDB_DRP\/D046C4A6F65A7268E0534401C80AC247\/DATAFILE\/test.907.1090162863\n<\/code><\/pre>\n<p>Everything is OK, and PDB is running fine.<\/p>\n<h2>Conclusion<\/h2>\n<p>If you don&#8217;t want to use database links between your databases, or if you don&#8217;t want to restore a container on your target server, this method works and it may help.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Multitenant brings new possibilities regarding Oracle databases, and one of them is to move a database from a container to another quite easily. When containers are on the same server, it&#8217;s very easy, but when the containers are on different servers, you will need to use a database link or an RMAN restore. But [&hellip;]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,198,59],"tags":[656,61,62,220,720,2437,2438,2439,64,2440,79,96,353,68,2441],"type_dbi":[],"class_list":["post-16948","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","category-database-management","category-oracle","tag-12-2","tag-18c","tag-19c","tag-cdb","tag-container","tag-enterprise-edition","tag-move-pdb","tag-move-pdb-to-another-server","tag-multitenant","tag-nfs-share","tag-oda","tag-oracle","tag-pluggable-database","tag-standard-edition","tag-transport"],"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>Move a PDB from a server to another one using NFS - 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\/move-a-pdb-from-a-server-to-another-one-using-nfs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Move a PDB from a server to another one using NFS\" \/>\n<meta property=\"og:description\" content=\"Introduction Multitenant brings new possibilities regarding Oracle databases, and one of them is to move a database from a container to another quite easily. When containers are on the same server, it&#8217;s very easy, but when the containers are on different servers, you will need to use a database link or an RMAN restore. But [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-03T10:00:14+00:00\" \/>\n<meta name=\"author\" content=\"J\u00e9r\u00f4me Dubar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"J\u00e9r\u00f4me Dubar\" \/>\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\/move-a-pdb-from-a-server-to-another-one-using-nfs\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/\"},\"author\":{\"name\":\"J\u00e9r\u00f4me Dubar\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0fb4bbf128b4cda2f96d662dec2baedd\"},\"headline\":\"Move a PDB from a server to another one using NFS\",\"datePublished\":\"2021-12-03T10:00:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/\"},\"wordCount\":433,\"commentCount\":0,\"keywords\":[\"12.2\",\"18c\",\"19c\",\"CDB\",\"container\",\"enterprise edition\",\"move PDB\",\"move pdb to another server\",\"multitenant\",\"nfs share\",\"ODA\",\"Oracle\",\"Pluggable Database\",\"Standard Edition\",\"transport\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Database management\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/\",\"name\":\"Move a PDB from a server to another one using NFS - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2021-12-03T10:00:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0fb4bbf128b4cda2f96d662dec2baedd\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Move a PDB from a server to another one using NFS\"}]},{\"@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\/0fb4bbf128b4cda2f96d662dec2baedd\",\"name\":\"J\u00e9r\u00f4me Dubar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/efaa5a7def0aa4cdaf49a470fb4a7641a3ea6e378ae1455096a0933f99f46d6b?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/efaa5a7def0aa4cdaf49a470fb4a7641a3ea6e378ae1455096a0933f99f46d6b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/efaa5a7def0aa4cdaf49a470fb4a7641a3ea6e378ae1455096a0933f99f46d6b?s=96&d=mm&r=g\",\"caption\":\"J\u00e9r\u00f4me Dubar\"},\"description\":\"J\u00e9r\u00f4me Dubar has more than 15 years of experience in the field of Information Technology. Ten years ago, he specialized in the Oracle Database technology. His expertise is focused on database architectures, high availability (RAC), disaster recovery (DataGuard), backups (RMAN), performance analysis and tuning (AWR\/statspack), migration, consolidation and appliances, especially ODA (his main projects during the last years). Prior to joining dbi services, J\u00e9r\u00f4me Dubar worked in a Franco-Belgian IT service company as Database team manager and main consultant for 7 years. He also worked for 5 years in a software editor company as technical consultant across France. He was also teaching Oracle Database lessons for 9 years. J\u00e9r\u00f4me Dubar holds a Computer Engineering degree from the Lille Sciences and Technologies university in northern France. His branch-related experience covers the public sector, retail, industry, banking, health, e-commerce and IT sectors.\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/jerome-dubar\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Move a PDB from a server to another one using NFS - 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\/move-a-pdb-from-a-server-to-another-one-using-nfs\/","og_locale":"en_US","og_type":"article","og_title":"Move a PDB from a server to another one using NFS","og_description":"Introduction Multitenant brings new possibilities regarding Oracle databases, and one of them is to move a database from a container to another quite easily. When containers are on the same server, it&#8217;s very easy, but when the containers are on different servers, you will need to use a database link or an RMAN restore. But [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/","og_site_name":"dbi Blog","article_published_time":"2021-12-03T10:00:14+00:00","author":"J\u00e9r\u00f4me Dubar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"J\u00e9r\u00f4me Dubar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/"},"author":{"name":"J\u00e9r\u00f4me Dubar","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0fb4bbf128b4cda2f96d662dec2baedd"},"headline":"Move a PDB from a server to another one using NFS","datePublished":"2021-12-03T10:00:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/"},"wordCount":433,"commentCount":0,"keywords":["12.2","18c","19c","CDB","container","enterprise edition","move PDB","move pdb to another server","multitenant","nfs share","ODA","Oracle","Pluggable Database","Standard Edition","transport"],"articleSection":["Database Administration &amp; Monitoring","Database management","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/","url":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/","name":"Move a PDB from a server to another one using NFS - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2021-12-03T10:00:14+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0fb4bbf128b4cda2f96d662dec2baedd"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/move-a-pdb-from-a-server-to-another-one-using-nfs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Move a PDB from a server to another one using NFS"}]},{"@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\/0fb4bbf128b4cda2f96d662dec2baedd","name":"J\u00e9r\u00f4me Dubar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/efaa5a7def0aa4cdaf49a470fb4a7641a3ea6e378ae1455096a0933f99f46d6b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/efaa5a7def0aa4cdaf49a470fb4a7641a3ea6e378ae1455096a0933f99f46d6b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/efaa5a7def0aa4cdaf49a470fb4a7641a3ea6e378ae1455096a0933f99f46d6b?s=96&d=mm&r=g","caption":"J\u00e9r\u00f4me Dubar"},"description":"J\u00e9r\u00f4me Dubar has more than 15 years of experience in the field of Information Technology. Ten years ago, he specialized in the Oracle Database technology. His expertise is focused on database architectures, high availability (RAC), disaster recovery (DataGuard), backups (RMAN), performance analysis and tuning (AWR\/statspack), migration, consolidation and appliances, especially ODA (his main projects during the last years). Prior to joining dbi services, J\u00e9r\u00f4me Dubar worked in a Franco-Belgian IT service company as Database team manager and main consultant for 7 years. He also worked for 5 years in a software editor company as technical consultant across France. He was also teaching Oracle Database lessons for 9 years. J\u00e9r\u00f4me Dubar holds a Computer Engineering degree from the Lille Sciences and Technologies university in northern France. His branch-related experience covers the public sector, retail, industry, banking, health, e-commerce and IT sectors.","url":"https:\/\/www.dbi-services.com\/blog\/author\/jerome-dubar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16948","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\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=16948"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16948\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=16948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=16948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=16948"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=16948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}