4

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?

Thomas
  • 6,291
  • 6
  • 40
  • 69
  • Try to connect to your schema using the same credentials from sql plus and see whether you are getting the same error. If it is then you may ask dba to unlock the user. – Jacob Nov 05 '12 at 11:08
  • Thank you for your response. No, I am not getting the same error and I am able to connect using sql clients :( – Bharath Krishnamurthy Nov 05 '12 at 11:50

2 Answers2

12

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.

Community
  • 1
  • 1
J.Hudler
  • 1,238
  • 9
  • 26
  • Thank you for your response. The account is not actually locked because I am able to connect to db using sql client. Any thoughts ? – Bharath Krishnamurthy Nov 05 '12 at 11:49
  • @user1799868 - I've complemented my answer with "what would I do" follow-ups. – J.Hudler Nov 05 '12 at 18:59
  • Thank you Hudler. You are right. My bad, I was doing wrong call through my framework. Recently the production database schema arrangement were changed and automation framework does not support this change. So I will have to make some change to the framework :) – Bharath Krishnamurthy Nov 07 '12 at 15:13
  • I'm glad I could help. If you confirm that my answer pointed you to the solution, I would appreciate you to flag it as accepted :) – J.Hudler Nov 07 '12 at 18:04
  • I'm having the same problem and this answer is not solving my problem – Pedro Rolo Jan 21 '14 at 18:22
  • We had this problem and were trying to solve it in this way, but we somehow weren't issuing these commands in the correct context (I do not know details about how did the person who solved the issue get onto the correct context). maybe this answer might be improved by stating something like «do not forget to access the appropriate context by issuing the command `foobarbanana`». – Pedro Rolo Jan 22 '14 at 10:52
  • 1
    @PedroMorteRolo: The context is given by the prefixes `cmd>` for command-prompt and `sql>` for the SQL*Plus command-line. – J.Hudler Jan 28 '14 at 19:56
  • Be very careful changing profiles. Changing the default profile may not prevent the problem from happening again, if the user is not in the DEFAULT profile. And changing the DEFAULT, or any profile, may violate security policies at many organizations. – Jon Heller Jul 24 '14 at 19:36
1

This solution is for Oracle 10g and error ORA-28000:the account is locked Type in the SQL Command Line:

conn sys as sysdba

enter password

alter user system account unlock;
Eric Brown
  • 13,774
  • 7
  • 30
  • 71