Difference between revisions of "(Re)create user/schema using DataPump"
From dbawiki
| Line 6: | Line 6: | ||
drop user <schema name> cascade; | drop user <schema name> cascade; | ||
Now, recreate the schema with the above-mentioned DDL<br /> | Now, recreate the schema with the above-mentioned DDL<br /> | ||
| − | + | The dumpfile (or a part thereof) can now be imported to fill up the currently empty schema: | |
impdp <usr>/<pwd> parfile=schema.par | impdp <usr>/<pwd> parfile=schema.par | ||
where schema.par would look like this: | where schema.par would look like this: | ||
Revision as of 15:36, 20 December 2011
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>.