{"id":5554,"date":"2021-06-23T08:43:44","date_gmt":"2021-06-23T08:43:44","guid":{"rendered":"https:\/\/swiv.com.br\/exporting-and-importing-between-pdbs-within-the-same-cdb\/"},"modified":"2026-05-27T20:02:31","modified_gmt":"2026-05-27T19:02:31","slug":"exporting-and-importing-between-pdbs-within-the-same-cdb","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/06\/23\/exporting-and-importing-between-pdbs-within-the-same-cdb\/","title":{"rendered":"Exporting and Importing Between PDBs within the same CDB"},"content":{"rendered":"\n<p>Neste artigo vamos realizar um export e import de SCHEMA de um PDB para outro PDB, dentro do mesmo CDB. <\/p>\n\n\n\n<p>Criando DIRECTORY nos dois PDBs:<\/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 STAGE\n&#x5B;oracle@quiasma ~]$ chmod 775 STAGE\/\n&#x5B;oracle@quiasma ~]$ cd STAGE\/\n&#x5B;oracle@quiasma STAGE]$ pwd\n\/home\/oracle\/STAGE\n&#x5B;oracle@quiasma STAGE]$ sqlplus system\/oracle@HIPOFISE1\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Wed Jun 23 05:33:34 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:17:48 -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; CREATE DIRECTORY BSS AS &#039;\/home\/oracle\/STAGE&#039;;\n \nDirectory created.\n \nSQL&gt; exit\nDisconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n&#x5B;oracle@quiasma STAGE]$ sqlplus system\/oracle@HIPOFISE2\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Wed Jun 23 05:34:05 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:33:34 -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; CREATE DIRECTORY BSS AS &#039;\/home\/oracle\/STAGE&#039;;\n \nDirectory created.\n \nSQL&gt; exit\nDisconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n&#x5B;oracle@quiasma STAGE]$\n<\/pre><\/div>\n\n\n<p>Vamos realizar o export do owner BSS1 do PDB HIPOFISE1 para o PDB HIPOFISE2:<\/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 USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE FROM DBA_USERS WHERE USERNAME=&#039;BSS1&#039;;\n \nUSERNAME\n--------------------------------------------------------------------------------\nACCOUNT_STATUS                   DEFAULT_TABLESPACE\n-------------------------------- ------------------------------\nBSS1\nOPEN                             USERS\n \n \nSQL&gt; conn system\/oracle@HIPOFISE2\nConnected.\nSQL&gt; SELECT USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE FROM DBA_USERS WHERE USERNAME=&#039;BSS1&#039;;\n \nno rows selected\n<\/pre><\/div>\n\n\n<p>Par\u00e2metros para export:<\/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 STAGE]$ cat exp.par\nUSERID=system\/oracle@HIPOFISE1\nSCHEMAS=BSS1\nDIRECTORY=BSS\nDUMPFILE=exp.dm\nLOGFILE=exp.log\nCONSISTENT=Y\n<\/pre><\/div>\n\n\n<p>Processo de export:<\/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 STAGE]$ expdp parfile=exp.par\n \nExport: Release 18.0.0.0.0 - Production on Wed Jun 23 05:38:26 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\nLegacy Mode Active due to the following parameters:\nLegacy Mode Parameter: &quot;consistent=TRUE&quot; Location: Parameter File, Replaced with: &quot;flashback_time=TO_TIMESTAMP(&#039;2021-06-23 05:38:26&#039;, &#039;YYYY-MM-DD HH24:MI:SS&#039;)&quot;\nLegacy Mode has set reuse_dumpfiles=true parameter.\nStarting &quot;SYSTEM&quot;.&quot;SYS_EXPORT_SCHEMA_01&quot;:  system\/********@HIPOFISE1 parfile=exp.par reuse_dumpfiles=true\nProcessing object type SCHEMA_EXPORT\/TABLE\/TABLE_DATA\nProcessing object type SCHEMA_EXPORT\/TABLE\/STATISTICS\/TABLE_STATISTICS\nProcessing object type SCHEMA_EXPORT\/STATISTICS\/MARKER\nProcessing object type SCHEMA_EXPORT\/USER\nProcessing object type SCHEMA_EXPORT\/SYSTEM_GRANT\nProcessing object type SCHEMA_EXPORT\/ROLE_GRANT\nProcessing object type SCHEMA_EXPORT\/DEFAULT_ROLE\nProcessing object type SCHEMA_EXPORT\/PRE_SCHEMA\/PROCACT_SCHEMA\nProcessing object type SCHEMA_EXPORT\/TABLE\/TABLE\nProcessing object type SCHEMA_EXPORT\/TABLE\/GRANT\/OWNER_GRANT\/OBJECT_GRANT\n. . exported &quot;BSS1&quot;.&quot;TESTE1&quot;                             5.078 KB       1 rows\nMaster table &quot;SYSTEM&quot;.&quot;SYS_EXPORT_SCHEMA_01&quot; successfully loaded\/unloaded\n******************************************************************************\nDump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:\n  \/home\/oracle\/STAGE\/exp.dm\nJob &quot;SYSTEM&quot;.&quot;SYS_EXPORT_SCHEMA_01&quot; successfully completed at Wed Jun 23 05:38:48 2021 elapsed 0 00:00:21\n<\/pre><\/div>\n\n\n<p>Par\u00e2metros de import:<\/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 STAGE]$ cat imp.par\nUSERID=system\/oracle@HIPOFISE2\nSCHEMAS=BSS1\nDIRECTORY=BSS\nDUMPFILE=exp.dm\nLOGFILE=imp.log\n<\/pre><\/div>\n\n\n<p>Processo de import:<\/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 STAGE]$ impdp parfile=imp.par\n \nImport: Release 18.0.0.0.0 - Production on Wed Jun 23 05:41:57 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_SCHEMA_01&quot; successfully loaded\/unloaded\nStarting &quot;SYSTEM&quot;.&quot;SYS_IMPORT_SCHEMA_01&quot;:  system\/********@HIPOFISE2 parfile=imp.par\nProcessing object type SCHEMA_EXPORT\/USER\nProcessing object type SCHEMA_EXPORT\/SYSTEM_GRANT\nProcessing object type SCHEMA_EXPORT\/ROLE_GRANT\nProcessing object type SCHEMA_EXPORT\/DEFAULT_ROLE\nProcessing object type SCHEMA_EXPORT\/PRE_SCHEMA\/PROCACT_SCHEMA\nProcessing object type SCHEMA_EXPORT\/TABLE\/TABLE\nProcessing object type SCHEMA_EXPORT\/TABLE\/TABLE_DATA\n. . imported &quot;BSS1&quot;.&quot;TESTE1&quot;                             5.078 KB       1 rows\nProcessing object type SCHEMA_EXPORT\/TABLE\/GRANT\/OWNER_GRANT\/OBJECT_GRANT\nProcessing object type SCHEMA_EXPORT\/TABLE\/STATISTICS\/TABLE_STATISTICS\nProcessing object type SCHEMA_EXPORT\/STATISTICS\/MARKER\nJob &quot;SYSTEM&quot;.&quot;SYS_IMPORT_SCHEMA_01&quot; successfully completed at Wed Jun 23 05:42:13 2021 elapsed 0 00:00:15\n<\/pre><\/div>\n\n\n<p>Validando novo owner no PDB 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 STAGE]$ sqlplus system\/oracle@HIPOFISE2\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Wed Jun 23 05:42:45 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:41:57 -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 USERNAME,ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME=&#039;BSS1&#039;;\n \nUSERNAME\n--------------------------------------------------------------------------------\nACCOUNT_STATUS\n--------------------------------\nBSS1\nOPEN\n \n \nSQL&gt; SELECT * FROM BSS1.TESTE1;\n \nDESCRICAO\n--------------------\nPDB HIPOFISE\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 realizar um export e import de SCHEMA de um PDB para outro PDB, dentro do mesmo CDB. Criando DIRECTORY nos dois PDBs: Vamos realizar o export do owner BSS1 do PDB HIPOFISE1 para o PDB HIPOFISE2: Par\u00e2metros para export: Processo de export: Par\u00e2metros de import: Processo de import: Validando novo owner no [&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-5554","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\/5554","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=5554"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5554\/revisions"}],"predecessor-version":[{"id":9096,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5554\/revisions\/9096"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=5554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=5554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=5554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}