Link to home
Start Free TrialLog in
Avatar of tifa-tifa
tifa-tifa

asked on

how to clone oracle user

how can i clone oracle user using oracle 10g
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

It depends on what you mean by clone.

Duplicating the objects (tables, indexes, etc) can be done with exp/imp (or the datapump versions expdp/impdp).

If you want to just copy a user with the grants/privs/etc???  There user to be a 'create like' in Enterprise Manager.

or there's a few scripts out there.  For example:
http://www.dba-oracle.com/t_cloning_oracle_user_id.htm
one of the other way around in cloning is to use cold backup....
Avatar of tifa-tifa

ASKER

hi. yes, would like to copy a user with the grants/privs/etc
i tried the link http://www.dba-oracle.com/t_cloning_oracle_user_id.htm 
it could not open an sql file i think oF original user.
sp2-0310: unable to open file: 20100412_142927_PXF.sql
PXF is the original user
 
you should edit the file..
i chacked in the BIN folder and there are no sql files..am i suppose to make these files myself?
i will suggest you use slightwv idea of datapump much more easier...
>>would like to copy a user with the grants/privs/etc

Are these grants/privs ones the user themselves has created of privs granted to this user?

exp/imp is good for self contained schema objects but can be troublesome when others have granted permissions to a user.

Moving forward I suggest you take the time to create scripts and proper roles.  This makes this task much easier.

You can take a FULL export then 'show' what would be done on import without actually doing it.  This will capture all the grant commands you need.  I suggest never doing a FULL import unless you know exactly what is in the export file.  A FULL import of a FULL export can mess up the dictionary objects.

>>am i suppose to make these files myself?

Scanning the script you will notice a SPOOL command.  This creates a file in whatever directory sql*plus was started in (or possibly the start-in directory in Windows).
thanx slighWV
http://www.dba-oracle.com/t_cloning_oracle_user_id.htm 
is this the only link available for this type of thing??
>>is this the only link available for this type of thing??

Probably not.  I Googled it and that was the first link that looked decent.

Since it is very hard to do this type of thing across multiple environments with 100% accuracy I suggest you use them as a starting point.  Once you understand what they are trying to do, you can tweak it for your specific environment.

I'm still not sure what you mean by 'clone'.  

Do you have a single schema (tables,indexes,views,???) that you want to copy somewhere?  

What types of grants/synonyms/objedcts have been created 'outside' this schema?

or do you have a main application schema and are wanting to quickly 'clone' application usernames?
ASKER CERTIFIED SOLUTION
Avatar of vijaycpt
vijaycpt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.