下面是测试一下Oracle 10g中怎么配置DB CONSOLE,EM这个东西平时用得太多了,一点不熟悉
测试环境:OS:SOLARIS 10,DB :10.2.0.1
1,EMCA创建
$ emca -config dbcontrol db -repos create
STARTED EMCA atDec 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
Passwordfor SYS user:
Passwordfor DBSNMP user:
Passwordfor 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 tocontinue? [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_.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 setfor 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, anduser:
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'settofalse
Dec 22, 2012 12:31:01 PM oracle.sysman.emcp.ParamsManager setFlag
CONFIG: Flag 'asm_db'settofalse
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 setfor 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, anduser: 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_.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创建数据库的时候也没有勾上。