Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Export/Import Grants and Roles of a Schema

kaushiksubramOct 24 2017 — edited Oct 31 2017

Hello Experts,

I'm trying to export a schema and import it to a different database, I took an export of the schema using below

expdp \"/as sysdba\" schemas=XXTEST  directory=test dumpfile=XXTEST.dmp logfile=XXTEST_export.log

and imported the schema to the target using below,

impdp \"/as sysdba\" schemas=XXTEST  directory=test dumpfile=XXTEST.dmp logfile=XXTEST_import.log

I did find the grants and roles were not migrated as a part of export/import

On the source,

=============

SYS@sourcedb>select count(*) from dba_tab_privs where GRANTEE='XXTEST';

  COUNT(*)

----------

       383

SYS@sourcedb>select count(*) from dba_sys_privs where GRANTEE='XXTEST';

  COUNT(*)

----------

        12

SYS@sourcedb>select count(*) from dba_role_privs where GRANTEE='XXTEST';

  COUNT(*)

----------

         3

But on the target after import,

======================

SYS@targetdb>select count(*) from dba_tab_privs where GRANTEE='XXTEST' ;

  COUNT(*)

----------

         0

SYS@targetdb>select count(*) from dba_sys_privs where GRANTEE='XXTEST';

  COUNT(*)

----------

        12

SYS@targetdb>select count(*) from dba_role_privs where GRANTEE='XXTEST';

  COUNT(*)

----------

         2

Is there a way to migrate the table-grants and roles along with export/import of a schema ?

Thanks,

Kaushik

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2017
Added on Oct 24 2017
9 comments
60,175 views