oracle-databasedatapumpimpdp

Oracle Import Data dump: tablespace: "USERS" already exist


I am trying to import data using impdp in oracle. However, when I tried to import it, it is giving me the following error:

ORA-29349: tablespace "USERS" already exists

Since USERS is the defualt permenant tablespace that contains users objects, I tried to exclude it from the command by adding "exclude=tablespace:\" IN ('USERS')\""

However, adding that does not help at all as the error remains.

my command looks like following: "impdp SYSTEM/MYPASSWORD@orcl full=Y DIRECTORY=dir dumpfile=mydump.dmp LOGFILE=mydump.dmp.log exclude=tablespace:\" IN ('USERS')\" transport_datafiles='/path/to/file"

Any help is appreciated


Solution

  • Ok, from what I can tell this isn't just a normal "can't create tablespace" error. This error is specific to using transportable tablespaces. In this case you won't be able to ignore. The work around is to rename the existing tablespace:

    alter tablespace users rename to users_ts;
    

    Then run your import again so that impdp can "create" the USERS tablespace from the dumpfile.

    impdp SYSTEM/MYPASSWORD@orcl full=Y DIRECTORY=dir dumpfile=mydump.dmp LOGFILE=mydump.dmp.log transport_datafiles='/path/to/file'