背景:
今天,公司有一位同事找我,说连接数据库的时候报“ORA-28000: the account is locked”,通过dba_users视图查看,数据库用户的状态为OPEN,就是连接不上报错,随后对问题展开分析。
分析:
1、检查primary和standyb数据库用户状态表dba_users,看到account_status都为OPEN状态;
2、使用用户连接primary可以正常登录,连接standby数据库报错“ORA-28000: the account is locked”;
报错信息如下:
ORA-28000: the account is locked
28000. 00000 - "The account is locked."
*Cause: The wrong password was entered multiple consecutive times as
specified by the profile parameter FAILED_LOGIN_ATTEMPTS, or the
DBA locked the account, or the user is a common user locked in
the root container.
*Action: Wait for the PASSWORD_LOCK_TIME or contact the DBA.
在Standby端解锁用户:
SQL> alter user IMES_PES account unlock;
原因:standby database是在内存中把用户锁定,但由于是read only状态,所以并没有更改用户表中的状态信息。具体说明如下:
ORA-28000 “the account is locked” in the standby database, even after the account was unlocked in the primary. (Doc ID 1600401.1)