oracle 11g 修改sysman密码后,em无法连接数据库的解决办法

时间:2022-12-16 08:31:15
     更改Oracle数据库sys,system等密码后,EM可以登录,但是登录后提示“数据库状态当前不可用。可能是因为数据库的状态为装载或不装载。单击 '启动' 可以获得当前状态并打开数据库。如果无法打开数据库, 单击 '执行恢复' 可执行相应的恢复操作。”

  解决方法如下:

  1、停止dbconsole   (也可以直接去服务手工停止)

  [oracle@star~]$ emctl stop dbconsole

  查看状态,确认dbconsole已经停止

  [oracle@star~]$ emctl status dbconsole

  **如果执行emctl stop dbconsole

  报错:Environment variable ORACLE_SID not defined. Please define it.

  则执行:set ORACLE_SID=数据库名

  2、修改sysman用户的密码,我把密码改成oracle123

  [oracle@star~]$ sqlplus / as sysdba

  SQL> alter user sysman identified by oracle123;

  解锁用户:

  SQL> alter user sysman account unlock;

  确认密码已修改:

   SQL> conn sysman/oracle123@csc   

  Connected.


  3、转到$ORACLE_HOME/host_sid/sysman/config目录下

  a. 把emoms.properties另存为emoms.properties.old

  b. 修改emoms.properties文件

  找到oracle.sysman.eml.mntr.emdRepPwd=把等于后的加密字串替换成刚才更改的密码oracle123;

  找到oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE 把TRUE换成FALSE。

  4、重启dbconsole,访问EM恢复正常

  [oracle@star~]$ emctl start dbconsole

  在此登录http://loclahost:5500/em,提示让输入用户名密码。

  至此,恢复正常。