RE: replicating users from one db to another

  • From: Don Granaman <DonGranaman@xxxxxxxxxxxxxxx>
  • To: "cemail_219@xxxxxxxxxxx" <cemail_219@xxxxxxxxxxx>, "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 6 Oct 2010 14:36:22 -0500

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: