Created
November 15, 2015 22:24
-
-
Save ajin/5f4b358dbafb8ad38f96 to your computer and use it in GitHub Desktop.
SQL statement to unlock and unexpire Oracle users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'alter user "'||username||'" account unlock;' || chr(10) || | |
'alter user "'||username||'" identified by values ''temp'';' || chr(10) || | |
'alter user "'||username||'" identified by values '''||extract(xmltype(dbms_metadata.get_xml('USER',username)),'//USER_T/PASSWORD/text()').getStringVal()||''';' old_password | |
from dba_users | |
where account_status != 'OPEN'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment