[oracle] Import one schema into another new schema - Oracle

I have a data dmp file exported from one schema user1 using the exp commandline utility.

I want to import this dump onto another newly created (empty) schema user 2 using the imp commandline utility.

I tried a few things like:

imp system/password@tesdb fromuser=user1 touser=user2 file=E:\Data\user1.dmp log=E:\Data\user1.log

I get an error

IMP-00002: failed to open user1.dmp for read
Import file: EXPDAT.DMP >

Any help appreciated.

This question is related to oracle

The answer is


The issue was with the dmp file itself. I had to re-export the file and the command works fine. Thank you @Justin Cave


After you correct the possible dmp file problem, this is a way to ensure that the schema is remapped and imported appropriately. This will also ensure that the tablespace will change also, if needed:

impdp system/<password> SCHEMAS=user1 remap_schema=user1:user2 \
            remap_tablespace=user1:user2 directory=EXPORTDIR \
            dumpfile=user1.dmp logfile=E:\Data\user1.log

EXPORTDIR must be defined in oracle as a directory as the system user

create or replace directory EXPORTDIR as 'E:\Data';
grant read, write on directory EXPORTDIR to user2;