(Re)create user/schema using DataPump
From dbawiki
Revision as of 15:36, 20 December 2011 by 10.250.159.106 (talk)
If the user does not yet exist on the destination database, just import it using the procedure outlined here.
If however, the user(schema) already exists, it will have to be dropped and re-created before the data can be imported.
But, before dropping the schema, run this script to generate the correct DDL beforehand!
After this DDL has been run and the results stored, the following command can be executed:
drop user <schema name> cascade;
Now, recreate the schema with the above-mentioned DDL
The dumpfile (or a part thereof) can now be imported to fill up the currently empty schema:
impdp <usr>/<pwd> parfile=schema.par
where schema.par would look like this:
directory=DP_IMPORT dumpfile=<db_name>_DP.DMP schemas=(<schema name>)
and/or maybe one or more of the following:
exclude=grantstables=(<schema name>.