Thursday, June 29, 2017

Resolving 'ORA-00959: tablespace 'TABLE_SPACE' does not exist when importing db dump

This is a simple one.

I was importing data dump with following command.

impdp system/password schemas=db_dump_schema remap_schema=db_dump_schema:locally_mapped_schema directory=DB_DUMPS DUMPFILE=dump_file_name.dmp LOGFILE=DB_LOGS:import.log

But I got following error.

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 "SYSTEM"."SYS_IMPORT_SCHEMA_05" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_05":  system/******** schemas=db_dump_schema remap_schema=db_dump_schema:locally_mapped_schema directory=DB_DUMPS DUMPFILE=dump_file_name.dmp LOGFILE=DB_LOGS:import.log
Processing object type SCHEMA_EXPORT/USER
ORA-39083: Object type USER failed to create with error:
ORA-00959: tablespace 'IMPORTED_TABLE_SPACE' does not exist
Failing sql is:

Obliviously I've not mapped table space to an existing table space

So

1) Find out available table spaces

SELECT TABLESPACE_NAME, STATUS, CONTENTS FROM USER_TABLESPACES;

You'll see an output similar to


2) Remap table space to an existing one

impdp system/password schemas=db_dump_schema remap_schema=db_dump_schema:locally_mapped_schema directory=DB_DUMPS DUMPFILE=dump_file_name.dmp LOGFILE=DB_LOGS:import.log remap_tablespace=IMPORTED_TABLE_SPACE:SYSTEM,IMPORTED_SCHEMA_INDEX:SYSTEM


No comments:

Post a Comment