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.
Best Answer
Even if not told,
OldUser
can be easily found as:This does not import anything, just creates
ThefileName.sql
underdumpdir
with the SQL statements used for creatingOldUser
, including the username as well of course. Using that information, they will know what to specify inREMAP_SCHEMA=OldUser:NewUser
.