Oracle10g EM无法连接数据库实例 & 正确修改DBSnmp和SYSMAN密码

Oralce数据库如果采用典型安装后,自动创建了一个叫做DBSNMP的用户,该用户负责运行Oracle系统的智能代理(Intelligent Agent),该用户的缺省密码也是“DBSNMP”。
 
Oracle Enterprise Manager 资料档案库:
该资料档案库是一组表,是在设置 OMS 时创建的。OMS 使用资料档案库作为其永久的后端存储。如果必要,可使用多个 OMS。多个 OMS 共享一个资料档案库并提供可靠性和容错功能。
节点:
第三层由受管节点组成,其中包含数据库和其它受管服务等目标。每个节点上都驻留着一个 Oracle 智能代理,它与 OMS 进行通信并执行控制台和客户端应用程序所发送的任务。
每个节点只需要一个智能代理。
智能代理是独立于数据库、控制台以及 Management Server 运行的。由于它独立于其它组件运行,智能代理可以执行如下任务:启动和关闭数据库、在系统的另一部分关闭时仍保持运行状态。智能代理的 ID 是 dbsnmp。




--SYSMAN和DBSNMP跟涉及到Oracle的EM,所以跟其他的用户修改密码方式有所区别。下面是这两个用户的默认密码和作用说明:---------------------------------------------------------------------------

DBSNMP

DBSNMP

The account used by the Management Agent component of Oracle Enterprise Manager to monitor and manage the database .

Oracle Enterprise Manager Grid Control Installation and Basic Configuration.

SYSMAN
CHANGE_ON_INSTALL

The account used to perform Oracle Enterprise Manager database administration tasks. Note that SYS and SYSTEM can also perform these tasks.

Oracle Enterprise Manager Grid Control Installation and Basic Configuration

---------------------------------------------------------------------------------

错误修改可能造成的问题

如果像修改其它用户的方式修改其密码的话,登陆em,可能出现如下状态:

(1)提示Enterprise Manager 无法连接到数据库实例

(2)数据库实例,是红色向下的箭头

(3)到数据库的实例链接,是红色向下的箭头

(4)监听,绿色向上的箭头

(5)检查SYSMAN用户,处于锁定状态,使用解锁命令,又会自动锁定。

但是数据库其它一起正常。

正确的修改方式

1、SYSMAN密码修改

1、 停止dbconsole

[oracle@xxx ~]$ emctl stop dbconsole

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

[oracle@xxx ~]$ emctl status dbconsole

2、修改sysman用户的密码

[oracle@xxx ~]$ sqlplus / as sysdba

SQL> alter user sysman identified by yyyy;

解锁用户

SQL> alter user sysman account unlock;

确认密码已修改

SQL> conn sysman/ yyyy @qqq

Connected.

3、转到$ORACLE_HOME/(host)_(sid)/sysman/config目录下

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

b. 修改emoms.properties文件

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

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

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

[oracle@xxx ~]$emctl start dbconsole

2、修改DBSNMP密码

2、DBSNMP 密码修改

修改的流程类似修改SYSMAN,只不过第3步如下:

转到$ORACLE_HOME/(host)_(sid)/sysman/emd目录下

[oracle@xxx ~]$ cp targets.xml targets.xml.bak

[oracle@xxx ~]$vi targets.xml

修改些列代码中:

<Property NAME="UserName" VALUE="6f5848a4f53a2d0a" ENCRYPTED="TRUE"/>

<Property NAME="password" VALUE="829e1a25401de489" ENCRYPTED="TRUE"/>

用新的dbsnmp的密码代替上列password的Value值,ENCRYPTED的值修改成FALSE。

参考

[1] 正确修改DBSNMP和SYSMAN密码, http://asmboy001.blog.51cto.com/340398/133720


----------------------------------------------------------------------------------------------------------


进行10g 的EM配置时,遇到的问题及解决方法:
[oracle@myoracle admin]$ emca -repos create
STARTED EMCA at Dec 17, 2009 11:51:53 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database SID: clonedb
Listener port number: 1521
Password for SYS user: 
Password for SYSMAN user: 
Do you wish to continue? [yes(Y)/no(N)]: y
Dec 17, 2009 11:52:02 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/oracle/cfgtoollogs/emca/clonedb/emca_2009-12-17_11-51-52-AM.log.
Dec 17, 2009 11:52:02 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Dec 17, 2009 11:52:02 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Dec 17, 2009 11:52:02 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/oracle/cfgtoollogs/emca/clonedb/emca_repos_create_<date>.log for more details.--提示错误
Dec 17, 2009 11:52:02 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/oracle/cfgtoollogs/emca/clonedb/emca_2009-12-17_11-51-52-AM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/oracle/cfgtoollogs/emca/clonedb/emca_2009-12-17_11-51-52-AM.log for more details.

[oracle@myoracle clonedb]$ cat emca_repos_create_2009-12-17_12-08-35-PM.log   --查看错误信息
Check if repos user already exists.
old   6:    WHERE username=UPPER('&EM_REPOS_USER');
new   6:    WHERE username=UPPER('SYSMAN');
old   8:   IF ( '&EM_CHECK_TYPE' = 'EXISTS') THEN
new   8:   IF ( 'NOT_EXISTS' = 'EXISTS') THEN
old  11:       raise_application_error(-20000, '&EM_REPOS_USER does not exists..');
new  11:       raise_application_error(-20000, 'SYSMAN does not exists..');
old  14:   ELSIF ( '&EM_CHECK_TYPE' = 'NOT_EXISTS' ) THEN
new  14:   ELSIF ( 'NOT_EXISTS' = 'NOT_EXISTS' ) THEN
old  17:       raise_application_error(-20001, '&EM_REPOS_USER already exists..');
new  17:       raise_application_error(-20001, 'SYSMAN already exists..');
old  21:       raise_application_error(-20002, 'Invalid Check type &EM_CHECK_TYPE');
new  21:       raise_application_error(-20002, 'Invalid Check type NOT_EXISTS');
DECLARE
*
ERROR at line 1:
ORA-20001: SYSMAN already exists..                                           --提示SYSMAN用户存在
ORA-06512: at line 17

SQL> drop user sysman cascade;                                               --删除用户及相关权限
SQL> drop role MGMT_USER;
SQL> drop user MGMT_VIEW cascade;
SQL> drop public synonym MGMT_TARGET_BLACKOUTS;
SQL> drop public synonym SETEMVIEWUSERCONTEXT;
[oracle@myoracle admin]$ emca -repos create                               
STARTED EMCA at Dec 17, 2009 12:21:44 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database SID: clonedb
Listener port number: 1521
Password for SYS user: 
Password for SYSMAN user: 
Password for SYSMAN user: 
Do you wish to continue? [yes(Y)/no(N)]: y
Dec 17, 2009 12:21:53 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/oracle/cfgtoollogs/emca/clonedb/emca_2009-12-17_12-21-44-PM.log.
Dec 17, 2009 12:21:54 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Dec 17, 2009 12:31:59 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Dec 17, 2009 12:31:59 PM
 
[oracle@myoracle admin]$ vi /etc/hosts                 --原先的hosts IP设置错误。
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
192.168.10.180          myoracle
 
[oracle@myoracle ~]$ emca -config dbcontrol db
STARTED EMCA at Dec 17, 2009 12:42:48 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database SID: clonedb
Listener port number: 1521
Password for SYS user: 
Password for DBSNMP user: 
Password for SYSMAN user: 
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /u01/oracle
Database hostname ................ myoracle
Listener port number ................ 1521
Database SID ................ clonedb
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Dec 17, 2009 12:43:02 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/oracle/cfgtoollogs/emca/clonedb/emca_2009-12-17_12-42-48-PM.log.
Dec 17, 2009 12:43:26 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Dec 17, 2009 12:45:25 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Dec 17, 2009 12:45:26 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://myoracle:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Dec 17, 2009 12:45:26 PM
[oracle@myoracle ~]$ emctl start dbconsole;
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://myoracle:1158/em/console/aboutApplication
 - An instance of Oracle Enterprise Manager 10g Database Control is already running.

[oracle@myoracle ~]$ emctl status
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
Invalid arguments
Unknown command option status
Usage::
   Oracle Enterprise Manager 10g Database Control commands:
       emctl start| stop| status| setpasswd dbconsole
       emctl secure <options>
       emctl set ssl test|off|on em
       emctl set ldap <host> <port> <user dn> <user pwd> <context dn>
emctl blackout options can be listed by typing "emctl blackout"
emctl config options can be listed by typing "emctl config"
emctl secure options can be listed by typing "emctl secure"
emctl ilint  options can be listed by typing "emctl ilint"
emctl deploy  options can be listed by typing "emctl deploy"

看到的另一个文章的解决办法:
oldboy 发表于:2007.12.22 20:12
主要描述了在安装EM时,始终报下面的错误的解决办法:
Enterprise manager configuration failed due to the following error -
Failed to allocate port(s) int the specified range for the following process(es):
JMS [5540-5559], RMI [5520-5539], Database Control [5500-5519], EM agent [1830-1849]
 
今天在HPUX 11.31上安装ORACLE 10G 10.2.0.3时,数据库都配置好了,但EM报错,通过安装日志文件查看,发现以下错误:
SEVERE: Failed to allocate port(s) in the specified range(s) for the following process(es): JMS [5540-5559],RMI [5520-5539],Database Control [5500-5519],EM Agent [3938] | [1830-1849]
Refer to the log file at /U01/oracle/product/10.2.0/db_1/cfgtoollogs/emca/si2000/emca_2007-12-22_04-36-47-PM.log for more details.
Dec 22, 2007 4:37:17 PM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Failed to allocate port(s) in the specified range(s) for the following process(es): JMS [5540-5559],RMI [5520-5539],Database Control [5500-5519],EM Agent [3938] | [1830-1849]
at oracle.sysman.emcp.EMDBPreConfig.checkPorts(EMDBPreConfig.java:2255)
at oracle.sysman.emcp.EMDBPreConfig.performConfiguration(EMDBPreConfig.java:678)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:241)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:168)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:141)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:485)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1141)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:469)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:418)
经过网上查询,知道是网络端口重复了,使用以下方法解决:
emca -config dbcontrol db -DBCONTROL_HTTP_PORT 5508 -AGENT_PORT 3940 -RMI_PORT 5524 -JMS_PORT 5545
再停用一次EM,再启动EM,就好了.
emctl stop dbconsole
emctl start dbconsole
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值