(Re)create user/schema using DataPump

From dbawiki
Revision as of 20:00, 30 November 2011 by 127.0.0.1 (talk) (Created page with "If the user does not yet exist on the destination database, just import it using the procedure outlined here. If however, the user already exists and the grants are differen...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

If the user does not yet exist on the destination database, just import it using the procedure outlined here.

If however, the user already exists and the grants are different on the destination database than they were on the source database, then they should be retained to be reapplied after the import.

create grants script
drop user <schema name> cascade;

The schema should ideally be checked beforehand that it does not own objects like 'type's that may exist elsewhere...

After the import, reapply the original grants:

run create grants script

Finally, recompile all invalid objects:

exec utl_recomp...