下面是测试一下10g中怎么配置DB CONSOLE,EM这个东西平时用得太多了,一点不熟悉
测试环境:OS:SOLARIS 10,DB :10.2.0.1
1,EMCA创建
- $ emca -config dbcontrol db -repos create
-
- STARTED EMCA at Dec 22, 2012 12:30:09 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: htz
- 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/app/oracle/product/11.2.0/db_1
-
- Database hostname ................ 10rac1
- Listener port number ................ 1521
- Database SID ................ htz
- Email address for notifications ...............
- Outgoing Mail (SMTP) server for notifications ...............
-
-
- Do you wish to continue? [yes(Y)/no(N)]: Y
- Dec 22, 2012 12:31:12 PM oracle.sysman.emcp.EMConfig perform
- INFO: This operation is being logged at /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/emca/htz/emca_2012-12-22_12-30-09-PM.log.
- Dec 22, 2012 12:31:13 PM oracle.sysman.emcp.EMReposConfig createRepository
- INFO: Creating the EM repository (this may take a while) ...
- Dec 22, 2012 12:31:13 PM oracle.sysman.emcp.EMReposConfig invoke
- SEVERE: Error creating the repository
- Dec 22, 2012 12:31:13 PM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Refer to the log file at /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/emca/htz/emca_repos_create_<date>.log for more details.
- Dec 22, 2012 12:31:13 PM oracle.sysman.emcp.EMConfig perform
- SEVERE: Error creating the repository
- Refer to the log file at /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/emca/htz/emca_2012-12-22_12-30-09-PM.log for more details.
- Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/emca/htz/emca_2012-12-22_12-30-09-PM.log for more details
晕,报错了,数据库是新创建的,查看一下原因。
2,日志查看
- $ cd $ORACLE_HOME/cfgtool*/
- $ ls
- cfgfw configToolAllCommands dbca emca netca oui
- $ cd emca/htz
- $ vi emca_2012-12-22_12-30-09-PM.log
- CONFIG: No value was set for the parameter SYS_PWD.
- Dec 22, 2012 12:31:01 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngine
- CONFIG: SQLEngine connecting with SID: htz, oracleHome: /u01/app/oracle/product/11.2.0/db_1, and user:
- Dec 22, 2012 12:31:01 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngine
- CONFIG: SQLEngine created successfully and connected
- Dec 22, 2012 12:31:01 PM oracle.sysman.emcp.ParamsManager setFlag
- CONFIG: Flag 'asm_db' set to false
- Dec 22, 2012 12:31:01 PM oracle.sysman.emcp.ParamsManager setFlag
- CONFIG: Flag 'asm_db' set to false
- Dec 22, 2012 12:31:03 PM oracle.sysman.emcp.ParamsManager setParam
- CONFIG: Setting param: PORT value: 1521
- Dec 22, 2012 12:31:05 PM oracle.sysman.emcp.ParamsManager getParam
- CONFIG: No value was set for the parameter SYS_PWD.
- Dec 22, 2012 12:31:05 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngine
- CONFIG: SQLEngine connecting with SID: htz, oracleHome: /u01/app/oracle/product/11.2.0/db_1, and user: SYS
- Dec 22, 2012 12:31:05 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngine
- CONFIG: SQLEngine created successfully and connected
- "emca_2012-12-22_12-30-09-PM.log" 370 lines, 26004 characters
- at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:841)
- at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:265)
- at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:306)
- at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:360)
- at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:182)
- at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:124)
- at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:142)
- at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:479)
- at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1123)
- at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:463)
- at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:412)
- Dec 22, 2012 12:31:13 PM oracle.sysman.emcp.EMReposConfig invoke
- SEVERE: Error creating the repository
- Dec 22, 2012 12:31:13 PM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Refer to the log file at /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/emca/htz/emca_repos_create_<date>.log for more details.
- Dec 22, 2012 12:31:13 PM oracle.sysman.emcp.EMConfig perform
- SEVERE: Error creating the repository
- Refer to the log file at /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/emca/htz/emca_2012-12-22_12-30-09-PM.log for more details.
- Dec 22, 2012 12:31:13 PM oracle.sysman.emcp.EMConfig perform
- CONFIG: Stack Trace:
- oracle.sysman.emcp.exception.EMConfigException: Error creating the repository
- at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:194)
- at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:124)
- at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:142)
- at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:479)
- at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1123)
- at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:463)
- at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:412)
-
- 再看另一个日志
-
- $ vi emca_repos_create_2012-12-22_12-31-13-PM.log
- "emca_repos_create_2012-12-22_12-31-13-PM.log" 21 lines, 911 characters
-
- 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..
- ORA-06512: at line 17
-
- 报用户已经存在,原来没有创建过EM,DBCA创建数据库的时候也没有勾上。
3,删除相关的用户
- $ sqlplus / as sysdba
-
- SQL*Plus: Release 10.2.0.1.0 - Production on Sat Dec 22 12:35:14 2012
-
- Copyright (c) 1982, 2005, Oracle. All rights reserved.
-
-
- Connected to:
- Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
- With the Partitioning, OLAP and Data Mining options
-
- SQL> drop user sysman cascade;
-
- User dropped.
-
- SQL> drop role MGMT_USER;
-
- Role dropped.
-
- SQL> drop user MGMT_VIEW cascade;
-
- User dropped.
-
- SQL> drop public synonym MGMT_TARGET_BLACKOUTS;
-
- Synonym dropped.
-
- SQL> drop public synonym SETEMVIEWUSERCONTEXT;
-
- Synonym dropped.
4,再次测试DB CONSOLE
- $ emca -config dbcontrol db -repos create
-
- STARTED EMCA at Dec 22, 2012 12:38:06 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: htz
- 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/app/oracle/product/11.2.0/db_1
-
- Database hostname ................ 10rac1
- Listener port number ................ 1521
- Database SID ................ htz
- Email address for notifications ...............
- Outgoing Mail (SMTP) server for notifications ...............
-
-
- Do you wish to continue? [yes(Y)/no(N)]: Y
- Dec 22, 2012 12:38:18 PM oracle.sysman.emcp.EMConfig perform
- INFO: This operation is being logged at /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/emca/htz/emca_2012-12-22_12-38-06-PM.log.
- Dec 22, 2012 12:38:18 PM oracle.sysman.emcp.EMReposConfig createRepository
- INFO: Creating the EM repository (this may take a while) ...
- Dec 22, 2012 12:39:55 PM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Repository successfully created
- Dec 22, 2012 12:39:57 PM oracle.sysman.emcp.util.DBControlUtil startOMS
- INFO: Starting Database Control (this may take a while) ...
- Dec 22, 2012 12:41:31 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
- INFO: Database Control started successfully
- Dec 22, 2012 12:41:31 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
- INFO: >>>>>>>>>>> The Database Control URL is http://10rac1:1158/em <<<<<<<<<<<
- Enterprise Manager configuration completed successfully
- FINISHED EMCA at Dec 22, 2012 12:41:31 PM
- $
5,测试是否成功
- $ emctl status dbconsole
- Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
- Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
- http://10rac1:1158/em/console/aboutApplication
- Oracle Enterprise Manager 10g is running.
-
- Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/10rac1_htz/sysman/log
6,通过http访问,一切正常
本文转自7343696 51CTO博客,原文链接:http://blog.51cto.com/luoping/1096788,如需转载请自行联系原作者