Monday, January 5, 2015

[OracleDB11g] Unlock a Locked/Expired Schema

You have a locked Schema in a database. Say for example the user SCOTT in Oracle Database 11g.

Try connecting to the SCOTT schema using the default password: TIGER and you will get the following error
ORA-28000: the account is locked
To unlock the account run the following query

ALTER USER SCOTT ACCOUNT UNLOCK;

Now the schema SCOTT would be unlocked and you can connect to the schema.

You can also change the password of the schema if you wish by running the below query

ALTER USER SCOTT IDENTIFIED BY TIGER1 ACCOUNT UNLOCK;

This query will both unlock the SCOTT schema and change it's password to 'TIGER1'. Now you can connect to the SCOTT schema using the new password.

No comments:

Post a Comment