Skip to Main Content

Oracle Database Discussions

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!

How to duplicate/clone a user in ANOTHER database?

pstein-JavaNetApr 28 2009 — edited Jun 29 2009
I have found some hints on how to duplicate a user (with the same privileges and grants) on the SAME database.
But how do I clone a user from Database 1 on computer A into a Database 2 on computer B ?

Can I somehow output the current CREATE USER statement and all GRANTS and additional (role) assignments
into a file and perfom this creation script on the other, new Database?

This script must be fault tolerant. If the original tablespace does not exist then it should either create the necessary tablespace
or prompt for another. If TABLEs for GRANTing do not exist just a warning should be outputted but the script should not aborted.

Furthermor assume the user clone "todo" list consist of:

CREATE USER
GRANT 1
GRANT 2
GRANT 3

A smart script should be applicable a second time even when user does exist but e.g. GRANT2 not.
So in such a situation warnings for CREATE USER, GRANT 1 and GRANT 3 should be displayed but GRANT 2 should be executed.

Is there such an advanced tool/script for user cloning?

As second best minimum (complete !) step-by-step cooking recipe on how to do this manually are appreciated as well.

Peter
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 11 2009
Added on Apr 28 2009
13 comments
2,569 views