0

To export a dumpfile, I can:

EXPDP system/Password@TNS 
DUMPFILE=FileName.dmp 
Schemas=TheSchemaIWantToDump 
DIRECTORY=dumpdir

So, let's say I want to restore this DMP file, but with a different name (I'm a SQL Server Dba, and I'm still learning some Oracle). I would do this:

1)create a new user

2)GRANT CONNECT to this user

3)

IMPDP System/Password@TNS 
dumpfile=ThefileName.dmp 
REMAP_SCHEMA=OldUser:NewUser 
directory=dumpdir

My question is about REMAP_SCHEMA.When I'm restoring schemas inside my own server, I know the OldUser , so I can fill it, and then :NewUser.

But if I'm sending this dump file to our client. Should I mention this OldSchema? They don't know the schema's name I'm using before the dump. Because on SQL Server I can RESTORE DATABASE , then name with the name a want FROM DISK....

How can I restore a schema with a different name?

Thanks.

1 Answer 1

1

Even if not told, OldUser can be easily found as:

IMPDP System/Password@TNS 
dumpfile=ThefileName.dmp 
directory=dumpdir
sqlfile=ThefileName.sql
include=user

This does not import anything, just creates ThefileName.sql under dumpdir with the SQL statements used for creating OldUser, including the username as well of course. Using that information, they will know what to specify in REMAP_SCHEMA=OldUser:NewUser.

2
  • Thank you Balazs. So a good pratice is, to run EXPDP with the schema about to be dumped? I mean..I run EXPDP with SYSTEM ( EXPDP SYSTEM/PASS schemas=TheSchemaIwantToDump ). Should I EXPDP Schema/;pass so they can run the above IMPDP and get the right schema?
    – Racer SQL
    Dec 21, 2018 at 11:48
  • @RacerSQL It does not matter. The information will be stored in the dumpfile Dec 21, 2018 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.