How to include roles and grants into datapump export

For sure one way to do it, would be this one: Prepare the parameters file first: FULL=YES INCLUDE=SCHEMA:”IN (SELECT ‘PUBLIC’ FROM DUAL UNION SELECT username FROM dba_users WHERE username in (‘DB_USER1′,’DB_USER2’))” INCLUDE=PUBLIC_SYNONYM/SYNONYM:”IN (SELECT synonym_name FROM dba_synonyms WHERE owner = ‘PUBLIC’ AND table_owner in (‘DB_USER1′,’DB_USER2’))” DIRECTORY=DATA_PUMP_DIR DUMPFILE=orcl_expdp.dmp LOGFILE=orcl_expdp.log INCLUDE=ROLE:”IN (select role from dba_roles where role in…

How to include roles and grants into datapump export

For sure one way to do it, would be this one: Prepare the parameters file first: FULL=YES INCLUDE=SCHEMA:”IN (SELECT ‘PUBLIC’ FROM DUAL UNION SELECT username FROM dba_users WHERE username in (‘DB_USER1′,’DB_USER2’))” INCLUDE=PUBLIC_SYNONYM/SYNONYM:”IN (SELECT synonym_name FROM dba_synonyms WHERE owner = ‘PUBLIC’ AND table_owner in (‘DB_USER1′,’DB_USER2’))” DIRECTORY=DATA_PUMP_DIR DUMPFILE=orcl_expdp.dmp LOGFILE=orcl_expdp.log INCLUDE=ROLE:”IN (select role from dba_roles where role in…