Tuesday, April 21, 2015

ORA-39166: Object was not found.

oracle@hostname:$ impdp schemaname/rep123 tables=XXXX_USER directory=DATA_PUMP_DIR dumpfile=XXXX_USER.dmp logfile=impdpXXXX_USER.log TABLE_EXISTS_ACTION=APPEND;

Import: Release 11.2.0.4.0 - Production on Tue Apr 21 15:35:13 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39166: Object XXXX_REPORTING.XXXX_USER was not found.


Since the export schema is different from the import schema we need to include remap_schema parameter in impdp utility as below.

obioracle@hostname:$ impdp schema/schemapasswrd tables=export_schema.XXX_USER directory=DATA_PUMP_DIR dumpfile=XXXX_USER.dmp logfile=impdpXXXX_USER.log remap_schema=EXPORT_SCHEMA:IMPORT_SCHEMA;

Import: Release 11.2.0.4.0 - Production on/ Tue Apr 21 15:38:07 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "XXXX_REPORTING"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "XXXX_REPORTING"."SYS_IMPORT_TABLE_01":  XXXX_reporting/******** tables=EXPORT_SCHEMA.XXXX_USER directory=DATA_PUMP_DIR dumpfile=XXXX_USER.dmp logfile=impdpXXXX_USER.log remap_schema=EXPORT_SCHEMA:IMPORT_SCHEMA
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39151: Table "XXXX_REPORTING"."XXXX_USER" exists. All dependent metadata and data will be skipped due to table_exists_action of skip
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/TRIGGER
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "XXXX_REPORTING"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at Tue Apr 21 15:38:09 2015 elapsed 0 00:00:02



No comments:

Post a Comment