Saturday, January 15, 2022

IMPDP for one single table in multitenant database in a different custom schema

Few days back, we got a request to import one table to our PDB. The main point to note is import will run through sys user and it has to be imported under a custom schema. The source was 19c and target DB version was 12c. The dump file along with log files were shared with us. Now, the environment where we need to do the import consists of the DB running on VM DB system on OCI. It consists of one root and one pluggable container. 



                Image source:https://docs.oracle.com/database/121/CNCPT/cdbovrvw.htm#CNCPT89236



SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 15 11:36:36 2022


Copyright (c) 1982, 2014, Oracle.  All rights reserved.



Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management and Real Application Testing options


SQL> show pdbs;


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         2 PDB$SEED                       READ ONLY  NO

         3 RPPDB                       READ WRITE NO

SQL>


The table to be imported already exist in our system and it was owned by an another schema FUSION. We created a par file, the contents of which are given below


cat impdp.par

tables=FUSION."table name"

logfile=impdp_tables_expdp.log

parallel=4

encryption_password=****

dumpfile=tables-expdp-%U.dmp

directory=IMPORT

job_name=job_NDE

table_exists_action=truncate


Now using the par file, run the IMPDP command


impdp \"sys/*****@RPPDB as sysdba\" parfile=impdp.par


The post was an small example on how we can do a import of one single table in a multitenant Database. Hope you find it useful. Till then happy learning.

 




1 comment: