Re: replicating users from one db to another

  • From: Andy Klock <andy@xxxxxxxxxxxxxxx>
  • To: DonGranaman@xxxxxxxxxxxxxxx
  • Date: Wed, 6 Oct 2010 15:55:38 -0400

This should give you what you asked for:

select dbms_metadata.get_ddl('USER',username) from dba_users;

You didn't mention profiles, roles, object, and system privileges...

On Wed, Oct 6, 2010 at 3:36 PM, Don Granaman <DonGranaman@xxxxxxxxxxxxxxx>wrote:

>  select 'alter user ' || username || ' identified by values ''' ||
> PASSWORD || '''' ||
>
>      ' account ' || decode(ACCOUNT_STATUS,'LOCKED','LOCK;','UNLOCK;') from
> DBA_USERS;
>
>
>
> In 10g and lower.  11g is “different”.  I don’t know offhand if
>
>
>
> select 'alter user ' || name || ' identified by values ''' || PASSWORD ||
> '''' ||
>
> ' account ' || decode(ASTATUS,'LOCKED','LOCK;','UNLOCK;') from USER$;
>
>
>
> will work in 11g or not.
>  ------------------------------
>
> *From:* oracle-l-bounce@xxxxxxxxxxxxx [mailto:
> oracle-l-bounce@xxxxxxxxxxxxx] *On Behalf Of *J. Dex
> *Sent:* Wednesday, October 06, 2010 8:33 AM
> *To:* oracle-l@xxxxxxxxxxxxx
> *Subject:* replicating users from one db to another
>
>
>
> I would like to pull all the userids AND current passwords from a
> particular database and create them in another database so they are exactly
> the same.   Does anybody have a script or sql that grabs not only the
> userids but also the current passwords so they can be created somewhere
> else?
>
>
>

Other related posts: