Skip to content

impdp REMAP_TABLE Multiple Examples

  • by

In this post, we'll talk about 2 topics.

  1. REMAP_TABLE Single Table
  2. REMAP_TABLE Multiple Tables

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:

REMAP_TABLE=<SCHEMA_NAME>.<OLD_TABLE_NAME>:<NEW_TABLE_NAME>

For example:

[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.

Repeated REMAP_TABLE

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.

Leave a Reply

Your email address will not be published. Required fields are marked *