(Re)create user/schema using DataPump
From dbawiki
Revision as of 15:34, 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
Now the dumpfile (or a part thereof) can be imported to fill up the now 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>.