{"id":5513,"date":"2021-06-23T08:19:27","date_gmt":"2021-06-23T08:19:27","guid":{"rendered":"https:\/\/swiv.com.br\/exporting-from-non-cdb-and-importing-into-pdb-using-data-pump-utility\/"},"modified":"2026-05-27T20:02:31","modified_gmt":"2026-05-27T19:02:31","slug":"exporting-from-non-cdb-and-importing-into-pdb-using-data-pump-utility","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/06\/23\/exporting-from-non-cdb-and-importing-into-pdb-using-data-pump-utility\/","title":{"rendered":"Exporting from non-CDB and Importing into PDB using Data Pump utility"},"content":{"rendered":"\n<p>Neste artigo, vamos reproduzir um processo de Export de tablespace (usando o modo FULL TRANSPORTABLE) de um banco Non-CDB para um Pluggable Database.<\/p>\n\n\n\n<p>No ambiente de origem, vamos analisar as tablespaces existentes, e analisar aquelas que n\u00e3o s\u00e3o de sistema (SYSTEM\/SYSAUX\/UNDO ou TEMP):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Tue Jun 22 06:14:52 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt; SELECT NAME,OPEN_MODE,CDB FROM V$DATABASE;\n \nNAME      OPEN_MODE            CDB\n--------- -------------------- ---\nRMANDB    READ WRITE           NO\n \nSQL&gt; SELECT TABLESPACE_NAME FROM DBA_TABLESPACES;\n \nTABLESPACE_NAME\n------------------------------\nSYSTEM\nSYSAUX\nUNDOTBS1\nTEMP\nUSERS\nTS_CORTEX_CATALOG\nTS_HIPO_CATALOG\n \n7 rows selected.\n<\/pre><\/div>\n\n\n<p>Percebo que tenho uma tablespace chamada &#8220;TS_CORTEX_CATALOG&#8221; que pode ser utilizada para nosso teste. Validando que o owner &#8220;CORTEX_CATALOG&#8221; utiliza apenas a referida tablespace:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SELECT DISTINCT TABLESPACE_NAME FROM DBA_TABLES WHERE OWNER=&#039;CORTEX_CATALOG&#039;;\n \nTABLESPACE_NAME\n------------------------------\nTS_CORTEX_CATALOG\n<\/pre><\/div>\n\n\n<p>Dentro desse owner, vou pegar uma tabela de refer\u00eancia, para que possamos comparar quando o import for realizado no destino (PDB):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SELECT COUNT(*) FROM CORTEX_CATALOG.CONFIG;\n \n  COUNT(*)\n----------\n         1\n<\/pre><\/div>\n\n\n<p>Uma vez avaliado a tablespace de origem, podemos deix\u00e1-la como Read Only:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER TABLESPACE TS_CORTEX_CATALOG READ ONLY;\n \nTablespace altered.\n<\/pre><\/div>\n\n\n<p>Criando directory no banco de origem, onde o EXPDP ser\u00e1 realizado:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 ~]$ mkdir EXPORT\n&#x5B;oracle@oel8 ~]$ chmod 775 EXPORT\/\n&#x5B;oracle@oel8 ~]$ pwd\n\/home\/oracle\n&#x5B;oracle@oel8 ~]$ cd EXPORT\/\n&#x5B;oracle@oel8 EXPORT]$ pwd\n\/home\/oracle\/EXPORT\n&#x5B;oracle@oel8 EXPORT]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Tue Jun 22 06:26:14 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt; CREATE DIRECTORY BSS AS &#039;\/home\/oracle\/EXPORT&#039;;\n \nDirectory created.\n<\/pre><\/div>\n\n\n<p>Par\u00e2metros do EXPDP:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 EXPORT]$ cat exp.par\nUSERID=system\/oracle\nDUMPFILE=exp.dmp\nTRANSPORT_TABLESPACES=TS_CORTEX_CATALOG\nDIRECTORY=BSS\nLOGFILE=exp.log\n<\/pre><\/div>\n\n\n<p>Disparando processo:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 EXPORT]$ expdp parfile=exp.par\n \nExport: Release 18.0.0.0.0 - Production on Wed Jun 23 05:11:45 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle and\/or its affiliates.  All rights reserved.\n \nConnected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nStarting &quot;SYSTEM&quot;.&quot;SYS_EXPORT_TRANSPORTABLE_01&quot;:  system\/******** parfile=exp.par\nProcessing object type TRANSPORTABLE_EXPORT\/INDEX\/STATISTICS\/INDEX_STATISTICS\nProcessing object type TRANSPORTABLE_EXPORT\/INDEX\/STATISTICS\/FUNCTIONAL_INDEX\/INDEX_STATISTICS\nProcessing object type TRANSPORTABLE_EXPORT\/STATISTICS\/TABLE_STATISTICS\nProcessing object type TRANSPORTABLE_EXPORT\/STATISTICS\/MARKER\nProcessing object type TRANSPORTABLE_EXPORT\/PLUGTS_BLK\nProcessing object type TRANSPORTABLE_EXPORT\/POST_INSTANCE\/PLUGTS_BLK\nProcessing object type TRANSPORTABLE_EXPORT\/TABLE\nProcessing object type TRANSPORTABLE_EXPORT\/INDEX\/INDEX\nProcessing object type TRANSPORTABLE_EXPORT\/INDEX\/FUNCTIONAL_INDEX\/INDEX\nProcessing object type TRANSPORTABLE_EXPORT\/CONSTRAINT\/CONSTRAINT\nProcessing object type TRANSPORTABLE_EXPORT\/CONSTRAINT\/REF_CONSTRAINT\nProcessing object type TRANSPORTABLE_EXPORT\/TRIGGER\nMaster table &quot;SYSTEM&quot;.&quot;SYS_EXPORT_TRANSPORTABLE_01&quot; successfully loaded\/unloaded\n******************************************************************************\nDump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:\n  \/home\/oracle\/EXPORT\/exp.dmp\n******************************************************************************\nDatafiles required for transportable tablespace TS_CORTEX_CATALOG:\n  \/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\nJob &quot;SYSTEM&quot;.&quot;SYS_EXPORT_TRANSPORTABLE_01&quot; successfully completed at Wed Jun 23 05:12:42 2021 elapsed 0 00:00:55\n<\/pre><\/div>\n\n\n<p>Agora vamos nos apropriar do ambiente de destino:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Tue Jun 22 06:35:55 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt; SELECT NAME,OPEN_MODE,CDB FROM V$DATABASE;\n \nNAME      OPEN_MODE            CDB\n--------- -------------------- ---\nASWAN     READ WRITE           YES\n \nSQL&gt; SHOW PDBS;\n \n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n         2 PDB$SEED                       READ ONLY  NO\n         3 HIPOFISE2                      READ WRITE NO\n         4 HIPOFISE1                      READ WRITE NO\nSQL&gt; ALTER SESSION SET CONTAINER=HIPOFISE1;\n \nSession altered.\n \nSQL&gt; SELECT NAME FROM V$DATAFILE;\n \nNAME\n--------------------------------------------------------------------------------\n\/oracle\/dados\/ASWAN\/ASWAN\/C32359B357110BDFE0536A00A8C0F81A\/datafile\/o1_mf_system\n_jbs98k3r_.dbf\n \n\/oracle\/dados\/ASWAN\/ASWAN\/C32359B357110BDFE0536A00A8C0F81A\/datafile\/o1_mf_sysaux\n_jbs98k3v_.dbf\n \n\/oracle\/dados\/ASWAN\/ASWAN\/C32359B357110BDFE0536A00A8C0F81A\/datafile\/o1_mf_undotb\ns1_jbs98k3w_.dbf\n \n\/oracle\/dados\/ASWAN\/ASWAN\/C32359B357110BDFE0536A00A8C0F81A\/datafile\/o1_mf_users_\njbsg5qtv_.dbf\n \nNAME\n--------------------------------------------------------------------------------\n<\/pre><\/div>\n\n\n<p>No ambiente de origem, podemos disparar os comandos de SCP do datafile que \u00e9 parte da tablespace que selecionamos para migrar. O diret\u00f3rio de destino \u00e9 o local onde reside os datafiles do PDB HIPOFISE1, conforme coletamos acima:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 EXPORT]$ scp \/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf oracle@192.168.0.106:\/oracle\/dados\/ASWAN\/ASWAN\/C32359B357110BDFE0536A00A8C0F81A\/datafile\/ts_cortex_catalog.dbf\noracle@192.168.0.106&#039;s password:\nts_cortex_catalog.dbf                                                                100%  200MB 134.1MB\/s   00:01\n&#x5B;oracle@oel8 EXPORT]$\n<\/pre><\/div>\n\n\n<p>Agora podemos voltar a tablespace de origem para READ WRITE:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER TABLESPACE TS_CORTEX_CATALOG READ WRITE;\n \nTablespace altered.\n<\/pre><\/div>\n\n\n<p>Criando um DIRECTORY no banco de destino:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma ~]$ mkdir BSS\n&#x5B;oracle@quiasma ~]$ chmod 7775 BSS\/\n&#x5B;oracle@quiasma ~]$ cd BSS\/\n&#x5B;oracle@quiasma BSS]$ pwd\n\/home\/oracle\/BSS\n&#x5B;oracle@quiasma BSS]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Wed Jun 23 04:14:48 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt; ALTER SESSION SET CONTAINER=HIPOFISE1;\n \nSession altered.\n \nSQL&gt; CREATE DIRECTORY BSS AS &#039;\/home\/oracle\/BSS&#039;;\n \nDirectory created.\n<\/pre><\/div>\n\n\n<p>Copiando o arquivo dump da origem para o destino:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 EXPORT]$ pwd\n\/home\/oracle\/EXPORT\n&#x5B;oracle@oel8 EXPORT]$ ll\ntotal 3476\n-rw-r-----. 1 oracle oinstall 3551232 Jun 22 06:34 exp.dmp\n-rw-r--r--. 1 oracle oinstall    2066 Jun 22 06:34 exp.log\n-rwxrwxr-x. 1 oracle oinstall     108 Jun 22 06:33 exp.par\n&#x5B;oracle@oel8 EXPORT]$ scp exp.dmp oracle@192.168.0.106:\/home\/oracle\/BSS\/exp.dmp\noracle@192.168.0.106&#039;s password:\nexp.dmp                                                                              100% 3468KB  58.0MB\/s   00:00\n&#x5B;oracle@oel8 EXPORT]$\n<\/pre><\/div>\n\n\n<p>Configurando par\u00e2metros de import (detalhe que o processo ser\u00e1 realizado no PDB HIPOFISE1):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma BSS]$ cat imp.par\nUSERID=system\/oracle@HIPOFISE1\nDUMPFILE=exp.dmp\nTRANSPORT_DATAFILES=&#039;\/oracle\/dados\/ASWAN\/ASWAN\/C32359B357110BDFE0536A00A8C0F81A\/datafile\/ts_cortex_catalog.dbf&#039;\nDIRECTORY=BSS\nLOGFILE=imp.log\n<\/pre><\/div>\n\n\n<p>O import \u00e9 realizado, apesar de algumas triggers ficarem inv\u00e1lidas:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma BSS]$ impdp parfile=imp.par\n \nImport: Release 18.0.0.0.0 - Production on Wed Jun 23 05:16:35 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle and\/or its affiliates.  All rights reserved.\n \nConnected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nMaster table &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TRANSPORTABLE_01&quot; successfully loaded\/unloaded\nStarting &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TRANSPORTABLE_01&quot;:  system\/********@HIPOFISE1 parfile=imp.par\nProcessing object type TRANSPORTABLE_EXPORT\/PLUGTS_BLK\nProcessing object type TRANSPORTABLE_EXPORT\/TABLE\nProcessing object type TRANSPORTABLE_EXPORT\/INDEX\/INDEX\nProcessing object type TRANSPORTABLE_EXPORT\/INDEX\/FUNCTIONAL_INDEX\/INDEX\nProcessing object type TRANSPORTABLE_EXPORT\/CONSTRAINT\/CONSTRAINT\nProcessing object type TRANSPORTABLE_EXPORT\/INDEX\/STATISTICS\/INDEX_STATISTICS\nProcessing object type TRANSPORTABLE_EXPORT\/INDEX\/STATISTICS\/FUNCTIONAL_INDEX\/INDEX_STATISTICS\nProcessing object type TRANSPORTABLE_EXPORT\/CONSTRAINT\/REF_CONSTRAINT\nProcessing object type TRANSPORTABLE_EXPORT\/TRIGGER\nProcessing object type TRANSPORTABLE_EXPORT\/STATISTICS\/TABLE_STATISTICS\nProcessing object type TRANSPORTABLE_EXPORT\/STATISTICS\/MARKER\nProcessing object type TRANSPORTABLE_EXPORT\/POST_INSTANCE\/PLUGTS_BLK\nORA-39082: Object type TRIGGER:&quot;CORTEX_CATALOG&quot;.&quot;SCRL_TRIGGER&quot; created with compilation warnings\n \nORA-39082: Object type TRIGGER:&quot;CORTEX_CATALOG&quot;.&quot;XMLSTORE_INSERT_TRIGGER&quot; created with compilation warnings\n \nORA-39082: Object type TRIGGER:&quot;CORTEX_CATALOG&quot;.&quot;SCR_TRIGGER&quot; created with compilation warnings\n \nJob &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TRANSPORTABLE_01&quot; completed with 3 error(s) at Wed Jun 23 05:16:58 2021 elapsed 0 00:00:22\n \n&#x5B;oracle@quiasma BSS]$\n<\/pre><\/div>\n\n\n<p>Validando que nossa tablespace foi importada no destino:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma BSS]$ sqlplus system\/oracle@HIPOFISE1;\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Wed Jun 23 05:17:48 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \nLast Successful login time: Wed Jun 23 2021 05:16:35 -03:00\n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt; SELECT TABLESPACE_NAME FROM DBA_TABLESPACES ORDER BY TABLESPACE_NAME;\n \nTABLESPACE_NAME\n------------------------------\nSYSAUX\nSYSTEM\nTEMP\nTS_CORTEX_CATALOG\nUNDOTBS1\nUSERS\n \n6 rows selected.\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SELECT FILE_NAME, TABLESPACE_NAME FROM DBA_DATA_FILES WHERE TABLESPACE_NAME=&#039;TS_CORTEX_CATALOG&#039;;\n \nFILE_NAME\n--------------------------------------------------------------------------------\nTABLESPACE_NAME\n------------------------------\n\/oracle\/dados\/ASWAN\/ASWAN\/C32359B357110BDFE0536A00A8C0F81A\/datafile\/ts_cortex_ca\ntalog.dbf\nTS_CORTEX_CATALOG\n<\/pre><\/div>\n\n\n<p>Validando nossa tabela de refer\u00eancia:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SELECT count(*) FROM CORTEX_CATALOG.CONFIG;\n \n  COUNT(*)\n----------\n         1\n<\/pre><\/div>\n\n\n<p>Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laborat\u00f3rio pessoal para fins de aprendizado.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neste artigo, vamos reproduzir um processo de Export de tablespace (usando o modo FULL TRANSPORTABLE) de um banco Non-CDB para um Pluggable Database. No ambiente de origem, vamos analisar as tablespaces existentes, e analisar aquelas que n\u00e3o s\u00e3o de sistema (SYSTEM\/SYSAUX\/UNDO ou TEMP): Percebo que tenho uma tablespace chamada &#8220;TS_CORTEX_CATALOG&#8221; que pode ser utilizada para [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,8],"tags":[],"class_list":["post-5513","post","type-post","status-publish","format-standard","hentry","category-administration","category-multitenant"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5513","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=5513"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5513\/revisions"}],"predecessor-version":[{"id":9097,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5513\/revisions\/9097"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=5513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=5513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=5513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}