ORACLE 11g RAC EM手动配置
前一段通过静默安装方式配置了一套两个节点的11gr2 RAC,后面再配置EM却不成功,症状表现是EM配置完成后,登录页面,出现如下错误:
The 主机 CPU Chart could not be generated.
1.Error: Invalid BoundDataSource: no class, method or dataSource provided.
2.Check the log file for details.
The 活动会话数 Chart could not be generated.
1.Error: Invalid BoundDataSource: no class, method or dataSource provided.
2.Check the log file for details.
经过查找原因,发现根本原因是11g RAC在配置EM时,需要-cluster参数,如
$emca -deconfig dbcontrol db -repos drop -cluster
注意:以上命令清除RAC数据库旧配置信息,但是会使数据库进入静默模式,锁定所有用户,在生产环境是不允许的。于是分两步进行配置:(不会进入静默模式)
1)删除旧配置信息
emca -deconfig dbcontrol db 节点1
emca -deconfig dbcontrol db 节点2
sqlplus / as sysdba
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;
2)重新建立RAC数据库db control 配置信息
$emca -config dbcontrol db -repos create -cluster
配置过程中出现的问题:
? 中间出现Error警告
WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
可以无视
? ASMSNMP密码错误问题
[oracle@vm4 db_1]$ emca -config dbcontrol db -repos create -cluster
STARTED EMCA at Dec 22, 2016 5:18:40 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database unique name: racdb
Service name: racdb
Listener port number: 1521
Listener ORACLE_HOME [ /data/app/11.2.0/grid ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Password for SYSMAN user: Cluster name: rac-cluster
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /data/app/11.2.0/grid ]:
ASM port [ 1521 ]:
ASM username [ ASMSNMP ]:
ASM user password:
Dec 22, 2016 5:19:12 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Dec 22, 2016 5:19:17 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: ORA-01031: insufficient privileges
Dec 22, 2016 5:19:17 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Dec 22, 2016 5:19:22 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: ORA-01031: insufficient privileges
Password validation failed. Some of the possible reasons may be:
1) Invalid username/password.
2) Database is not up.
3) Scan listener not up.
4) Database service is not registered with scan listener.
5) Password file may be missing or configured incorrectly.
ASM user password:
解决方法:(grid用户)
1) Remove all the ASM password files from each node:
rm Grid Oracle Home/dbs/orapw+ASM1
rm Grid Oracle Home/dbs/orapw+ASM2
rm Grid Oracle Home/dbs/orapw+ASM<..n>
2) Create ASM password file manually on the first node as the OS user which owns the Grid Infrastructure:
$> orapwd file=’orapw+ASM1’ entries=5 password=’here your password’
3) Copy the password file to all nodes with the correct ASM instance name:
scp orapw+ASM1 to remote node : Grid Oracle Home/dbs/orapw+ASM2
scp orapw+ASM1 to remote node : Grid Oracle Home/dbs/orapw+ASM3
..
scp orapw+ASM1 to remote node : Grid Oracle Home/dbs/orapw+ASM<..n>
4) Add the ASMSNMP user in ASM instance, and grant sysdba privilege to it:
SQL> create user asmsnmp identified by ‘password’;
SQL> grant sysdba to asmsnmp;
5) Verify the ASMSNMP user was created:
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS
SYS TRUE TRUE TRUE
ASMSNMP TRUE FALSE FALSE
接下来建立成功,将HTTPS改为HTTP就行了
$emctl unsecure dbconsole
最终配置成功,EM页面图标显示正常了!
另外,ORACLE 11g EM 在各种情况下无法启动或者需要重建的时候,我们通常使用EMCA命令手动配置;Emca命令详细的说明可以查看连机帮助,下面给出一些常用的命令:
emca -repos create //创建一个EM资料库
emca -repos recreate //重建一个EM资料库
emca -repos drop //删除一个EM资料库
emca -config dbcontrol db //配置数据库的 Database Control
emca -deconfig dbcontrol db //删除数据库的 Database Control配置
emca -reconfig ports //重新配置db control的端口,默认端口在1158
emca -reconfig ports -dbcontrol_http_port 1160
emca -reconfig ports -agent_port 3940
emctl start dbconsole //启动EM console服务
emctl stop dbconsole //停止EM console服务
emctl status dbconsole //查看EM console服务的状态
l 配置dbconsole的步骤
emca -repos create
emca -config dbcontrol db
emctl start dbconsole
l 重新配置dbconsole的步骤
emca -repos drop
emca -repos create
emca -config dbcontrol db
emctl start dbconsole
或者
emca -config dbcontrol db -repos recreate
l 手动删除资料库
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;
【参考】
1. ORACLE 11g EM 无法启动的问题和重建,http://blog.sina.com.cn/s/blog_7c855cf70100shrv.html
2. http://www.itpub.net/thread-1757162-1-1.html
3. Reconfigure Database Control in RAC environment using EMCA,http://www.oracle-class.com/?p=2424
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16976507/viewspace-2131429/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16976507/viewspace-2131429/