First, the demand
In the migration of some data to the new database, the developer requirements and the original database password to keep consistent, we go to collect password trouble is also prone to error, this time how to do? The ALTER USER statement from Oracle provides a identified by values clause that allows the DBA to modify the password directly using the ciphertext stored in the database dictionary without knowing the plaintext of the password.
Second, the method
Eg: for example, test1 password is password2018, you can change the Test2 user password to password2018, or create a test3 user password for password2018
1. Query the password encryption text for Test1
Select S.spare4 from sys.user$ s where s.name = ' TEST1 ';
2. Modify the Test2 password
Alter user test2 identified by values ' S.spare4 ';
3. Create TEST3 Users
Alter user test3 identified by values ' S.spare4 ';
4. Test Test2, TEST3 users
Conn Test2/password2018;conn test3/password2018
Success
5. Create users in batches
Select ' Create user ' | | name | | ' identified by Values ' | | Spare4 | | '; ' from sys.user$ where name is like ' test% ';
Alter user identified by values in 11g