2

I need to grant all the privileges of a user (say 'AAA') to another user (say 'BBB').

Is there such an Oracle command (11.2.0.3.0)?

6

Get all privileges from AAA

 SELECT DBMS_METADATA.GET_GRANTED_DDL('ROLE_GRANT','AAA') FROM DUAL;

 SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','AAA') FROM DUAL;

 SELECT DBMS_METADATA.GET_GRANTED_DDL('OBJECT_GRANT','AAA') FROM DUAL;

Change the DDL commands with the user 'BBB' and execute.

0
expdp userid=system directory=DATA_PUMP_DIR dumpfile=AAA.dmp schemas=AAA
impdp userid=system directory=DATA_PUMP_DIR dumpfile=AAA.dmp remap_schema=AAA:BBB

or make use of dbms_metadata

user_ddl.sql

0

You might want to look at roles here Paul...

Not the answer you're looking for? Browse other questions tagged or ask your own question.