Enterprise Manager show database status is unavailable
查看日志:$ORACLE_HOME/lucky_orcl/sysman/log/emoms.log
2011-08-02 14:40:46,822 [HTTPThreadGroup-4] ERROR eml.OMSHandshake processFailure.806 - OMSHandshake failed.(AGENT URL = https://maclean04.oracledatabase12g.com:3938/emd/main)(ERROR = INTERNAL_ERROR)(CAUSE =java.sql.SQLException: ORA-28000: the account is locked ) 2011-08-02 14:40:48,244 [HTTPThreadGroup-4] ERROR conn.ConnectionService verifyRepositoryEx.891 - Invalid Connection Pool. ERROR = ORA-28000: the account is locked
从以上EM日志可以发现问题为ORA-28000,显然是EM相关的数据库用户被locked。10g中与EM相关的数据库用户包括SYSMAN和DBSNMP,分别查询该2个用户的状态:
SQL> select account_status,lock_date,username from dba_users where username in ('SYSMAN','DBSNMP'); ACCOUNT_STATUS LOCK_DATE USERNAME -------------------------------- --------------- ------------------------------ OPEN DBSNMP LOCKED(TIMED) 02-JUL-11 SYSMAN
SYSMAN用户被锁定了,状态为LOCKED(TIMED),说明是登陆密码不正确多次登陆后被锁的。
SQL> alter user sysman account unlock; User altered.
重启EM后重新登陆,发现问题仍未解决,再次检查账户信息 SQL> select account_status,lock_date,username from dba_users where username in ('SYSMAN','DBSNMP'); ACCOUNT_STATUS LOCK_DATE USERNAME -------------------------------- --------------- ------------------------------ OPEN DBSNMP LOCKED(TIMED) 02-AUG-11 SYSMAN
发现SYSMAN用户又被locked,显然是有人在数据库内修改了SYSMAN的密码后,没有重新配置EM中的SYSMAN密码,导致每次EM启动时都会尝试用错误的密码登陆数据库,最终造成SYSMAN用户被LOCKED(TIMED)住,并出现”ORA-28000: the account is locked”错误。
找出根本原因后问题就显得十分简单了,我们只需要关闭EM,并同步数据库和EM中的SYSMAN密码,再重启EM就可以了:
1.
emctl stop dbconsole
2.
alter user sysman identified by ;
alter user sysman account unlock;
3.
emctl setpasswd dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
https://maclean.oracledatabase12g.com:1158/em/console/aboutApplication
Please enter new repository password:
Repository password successfully updated.
4.
emctl start dbconsole