Object Grants with Datapump

Though have been working on oracle for many years now and have been using oracle datapump for quiet some time as well.
Recently we found an application had issues post schema import, on identifying the root cause found two things:

1. Objects grant were missing on the schema we imported where schema owner was grantee.
2. Object grants were missing on the schema based on sys objects.

To my surprise both are actually normal things. With schema and table level import object permissions where importing schema granted permission to other schemas will be played but when imported schema is grantee(permission given by other schema owner) those permissions are not played.

If you still want to see those grant use:

impdp full=y dumpfile=expdp.dmp sqlfile=fullimpdp.sql INCLUDE=GRANT

This will create a sqlfile with name fullimpdp.sql and will consists of object level permissions which are normally not being imported with impdp.

Now solution for this problem can be
1. Backup these permissions using dynamic sql. Use oracle provided script - Script to Generate object privilege GRANTS (Doc ID 1020176.6)
2. Create a sqlfile with full=y and INCLUDE=GRANT option using datapump and play on database.




Comments

Popular posts from this blog

How to Solve - "WAIT FOR EMON PROCESS NTFNS"

Query Regression - "OR" Transformation Oracle 19c

ORA - 12537: TNS: connection closed