ORA-2800: account is locked error in qtp

Bharath Krishnamurthy picture Bharath Krishnamurthy · Nov 5, 2012 · Viewed 17.3k times · Source

I am getting the following error while connecting to db for checking db timings through QTP scripts:

"Cannot update system time with database time due to error: ERROR: [Oracle][ODBC][Ora]ORA-28000: the account is locked"

But the database SID and credentials given are correct and verified the same in some db client. I am not sure why its throwing error in QTP?

Can anyone please help me resolve the issue?

Answer

J.Hudler picture J.Hudler · Nov 5, 2012

1) Login to your Oracle Database using admin privileges:

cmd> sqlplus / as sysdba

or

cmd> sqlplus system/{systemPassword}@{OracleSID}

2) Unlock your user's account using the following command:

sql> alter user {yourDbUser} account unlock;

3) Still in SQL*Plus command prompt, prevent account locks to not occur again:

sql> ALTER PROFILE "DEFAULT" LIMIT PASSWORD_LIFE_TIME UNLIMITED;

sql> ALTER PROFILE "DEFAULT" LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED;

Edit due comment

The above instructions should solve your problem. I'm posting an additional command I've found related to this subject you can try (I'm not confident it is the solution though):

sql> grant connect, resource to {yourDbUser};

You can also check for the status of other locked users in your database. Maybe your tool is trying to connect with some other user that, besides the one you are using, still have this issue.