In this post, we'll talk about 2 topics.
REMAP_TABLE Single Table
To prevent damaging the original tables, we usually import tables with different names for developers to verify. The parameter we should use in data pump (impdp) is REMAP_TABLE.
To remap table, we used to use the format:
[oracle@test ~]$ impdp system/password@orclpdb tables=hr.employees remap_table=hr.employees:emp_bak dumpfile=full.dmp
Please note that, we usually use system to perform data migration, but using sys as sysdba is also working to import data.
We know how to map one table, how about two or more tables?
REMAP_TABLE Multiple Tables
There're 2 ways to set multiple remapping tables.
Delimited by Commas
Every mapping set should be delimited by a comma like the following example:
[oracle@test ~]$ impdp system/password@orclpdb tables=hr.employees,hr.jobs remap_table=hr.employees:emp_bak,hr.jobs:job_bak dumpfile=full.dmp
We used one REMAP_TABLE and multiple table mappings.
Delimiting by commas may not feasible for hundreds of table remapping, so you may split them by the parameter REMAP_TABLE.
[oracle@test ~]$ impdp system/password@orclpdb tables=hr.employees,hr.jobs remap_table=hr.employees:emp_bak remap_table=hr.jobs:job_bak dumpfile=full.dmp
As you can see, there're two REMAP_TABLE in the command. The basic rule is that the source table can not be duplicated.