Disclaimer

Friday, 1 October 2021

How to reset password with knowing user password in Oracle Database

SQL> select username,account_status from dba_users where username='SAMIK';
USERNAME        ACCOUNT_STATUS
------------   -----------
SAMIK          EXPIRED

SQL> select 'alter user "'||d.username||'" identified by values '''||u.password||''';' c from dba_users d, sys.user$ u where d.username = upper('&&username') and u.user# = d.user_id;
Enter value for username: SAMIK
old 1: select 'alter user "'||d.username||'" identified by values '''||u.password||''';' c from dba_users d, sys.user$ u where d.username = upper('&&username') and u.user# = d.user_id
new 1: select 'alter user "'||d.username||'" identified by values '''||u.password||''';' c from dba_users d, sys.user$ u where d.username = upper('SAMIK') and u.user# = d.user_id
C
-------------------------------------------------------------------------------------
alter user "SAMIK" identified by values 'D1335553276FBC0B';
SQL>
SQL>
SQL> alter user "SAMIK" identified by values 'D1335553276FBC0B';

User altered.


SQL> select username,account_status from dba_users where username='SAMIK';
USERNAME        ACCOUNT_STATUS
------------   -----------
SAMIK          OPEN

User altered.



No comments:

Post a Comment

Index rebuild online in Oracle - shell script

  [oracle@rac10p reorg]$ cat index_rebuild_EMP.sh #!/bin/ksh export ORACLE_HOME=/oracle/K12/19 export ORACLE_SID=K12 export PATH=$PATH:/$ORA...