Pages

Saturday 21 December 2013

Solution For ORA-28001 AND ORA-28002 ORACLE DATABASE ERROR



PROBLEM :

When you working on Oracle you may get this issue that Your account may locked, or password is expired.
To solve this problem here is the solution, it may take less than a minute. Oracle give you 28001 OR 28002 error code.

SOLUTION :

Connect as SYS AS SYSDBA user.
For example my “SCOTT” user is locked and password is expired for  “SCOTT” user.
SQL > select username,account_status from dba_users;
It will so you list of all user and status of the user’s account.
Now my scott account is “EXPIRED & LOCKED”
First of all UNLOCK the user account.
SQL> ALTER USER scott ACCOUNT UNLOCK;
Now again execute previous query.
SQL > select username,account_status from dba_users;
                Now my scott account is “EXPIRED”
Secondly, execute the following query.

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;
                It will give you update query. Execute that update query.
SQL > alter user "SCOTT" identified by values 'F894844C34402B67';
That’s all your work is done.
Now check the status of the scott user.
SQL > select username,account_status from dba_users;
                Now my scott account is “OPEN”

IF YOU HAVE ANY OTHER SOLUTION THAN PLEASE COMMENT IT.

No comments:

Post a Comment