Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

This question already has an answer here:

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)?

share|improve this question

marked as duplicate by Phil, Paul White, Mark Storey-Smith, Marian, ypercube Mar 23 at 17:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers 3

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

share|improve this answer
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

share|improve this answer

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.

share|improve this answer

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