REMAP_TABLE:
REMAP_TABLE is used to duplicate/rename a table using impdp data pump import.
- Export the employee table
[oracle@18c empdata]$ expdp system/oracle directory=test_dir tables=hari.employee dumpfile=employee.dmp logfile=employee.log
Export: Release 18.0.0.0.0 - Production on Thu Aug 23 19:21:46 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Starting "SYSTEM"."SYS_EXPORT_TABLE_01": system/******** directory=test_dir tables=hari.employee dumpfile=employee.dmp logfile=employee.log
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "HARI"."EMPLOYEE" 5.515 KB 5 rows
Master table "SYSTEM"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
/u01/empdata/employee.dmp
Job "SYSTEM"."SYS_EXPORT_TABLE_01" successfully completed at Thu Aug 23 19:22:01 2018 elapsed 0 00:00:15
- Import the table into same schema HARI with tablename emp_data with remap_table option.
[oracle@18c empdata]$ impdp system/oracle DIRECTORY=test_dir DUMPFILE=employee.dmp LOGFILE=employee.log remap_table=hari.employee:emp_data Import: Release 18.0.0.0.0 - Production on Thu Aug 23 19:27:48 2018 Version 18.3.0.0.0 Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/******** DIRECTORY=test_dir DUMPFILE=employee.dmp LOGFILE=employee.log remap_table=hari.employee:emp_data Processing object type TABLE_EXPORT/TABLE/TABLE Processing object type TABLE_EXPORT/TABLE/TABLE_DATA . . imported "HARI"."EMP_DATA" 5.515 KB 5 rows Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at Thu Aug 23 19:28:07 2018 elapsed 0 00:00:18
- Check the tables is present in schema ‘HARI’
SQL> conn hari/oracle Connected. SQL> select TABLE_NAME from user_tables where table_name like '%EMP%'; TABLE_NAME ---------- EMP_DATA EMPLOYEE
Catch Me On:- Hariprasath Rajaram
Telegram:https://t.me/joinchat/I_f4DhGF_Zifr9YZvvMkRg
LinkedIn:https://www.linkedin.com/in/hari-prasath-aa65bb19/
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page: https://www.facebook.com/dbahariprasath/?
Twitter: https://twitter.com/hariprasathdba