emca是一个命令提示符,使用格式和方法在命令提示符下输入emca,屏幕上会出现emca使用帮助。使用以下命令就可以搞定
emca -config dbcontrol db -repos create 创建em资料库并同时配制Database Control
emca -deconfig dbcontrol db -repos drop 删除Database Control并同时删除em资料库
[oracle@ocmdb ~]$ emca
/u01/app/oracle/product/1 .2.0/db_1/bin/emca [operation] [mode] [dbType] [flags] [parameters]
-h | --h | -help | --help: prints this help message
-version: prints the version
-config dbcontrol db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure Database Control for a database
-config centralAgent (db | asm) [-cluster] [-silent] [parameters]: configure central agent management
-config all db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure both Database Control and central agent management
-deconfig dbcontrol db [-repos drop] [-cluster] [-silent] [parameters]: de-configure Database Control
-deconfig centralAgent (db | asm) [-cluster] [ -silent] [parameters]: de-configure central agent management
-deconfig all db [-repos drop] [-cluster] [-silent] [parameters]: de-configure both Database Control and central agent management
-addInst (db | asm) [-silent] [parameters]: configure EM for a new RAC instance
-deleteInst (db | asm) [-silent] [parameters]: de-configure EM for a specified RAC instance
-reconfig ports [-cluster] [parameters]: explicitly reassign Database Control ports
-reconfig dbcontrol -cluster [-silent] [parameters]: reconfigures RAC Database Control deployment
-displayConfig dbcontrol -cluster [-silent] [parameters]: displays information about the RAC Database Control configuration
-upgrade (db | asm | db_asm) [-cluster] [-silent] [parameters]: upgrades an earlier version of the EM configuration to the current version
-restore (db | asm | db_asm) [-cluster] [-silent] [parameters]: restores the current version of the EM configuration to an earlier version
Parameters and Options:
[parameters]: [ -respFile fileName ] [ -paramName paramValue ]*
db: perform configuration operation for a database (including databases that use ASM)
asm: perform configuration operation for an ASM-only instance
db_asm: perform upgrade/restore operation for a database and an ASM instance
-repos create: create a new Database Control repository
-repos drop: drop the current Database Control repository
-repos recreate: drop the current Database Control repository and recreate a new one
-cluster: perform configuration operation for a RAC database
-silent: perform configuration operation without prompting for parameters
-backup: configure automatic backup for a database
Parameters for single instance databases
HOST: Database hostname
SID: Database SID
PORT: Listener port number
ORACLE_HOME: Database ORACLE_HOME
HOST_USER: Host username for automatic backup
HOST_USER_PWD: Host user password for automatic backup
BACKUP_SCHEDULE: Automatic backup schedule (HH:MM)
EMAIL_ADDRESS: Email address for notifications
MAIL_SERVER_NAME: Outgoing Mail (SMTP) server for notifications
ASM_OH: ASM ORACLE_HOME
ASM_SID: ASM SID
ASM_PORT: ASM port
ASM_USER_ROLE: ASM user role
ASM_USER_NAME: ASM username
ASM_USER_PWD: ASM user password
SRC_OH: ORACLE_HOME for the database to be upgraded
DBSNMP_PWD: Password for DBSNMP user
SYSMAN_PWD: Password for SYSMAN user
SYS_PWD: Password for SYS user
DBCONTROL_HTTP_PORT: Database Control HTTP port
AGENT_PORT: EM agent port
RMI_PORT: RMI port for Database Control
JMS_PORT: JMS port for Database Control
Additional Parameters for cluster databases
CLUSTER_NAME: Cluster name
DB_UNIQUE_NAME: Database unique name
SERVICE_NAME: Service name
EM_NODE: Database Control node name
EM_SID_LIST: Agent SID list [comma separated]
[oracle@ocmdb ~]$
如果安装数据软件不是高级安装中只安装oracle软件的情况下则需要先删除再配置,配置时需要修改数据中的几个用户密码:
SQL> alter user dbsnmp identified by oracle;
User altered.
SQL> alter user dbsnmp identified by oracle;
配置过程:
[oracle@ocmdb ~]$ emca -deconfig dbcontrol db -repos drop
STARTED EMCA at Jun 16, 2013 1:49:13 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: PROD
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
Jun 16, 2013 1:52:22 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-49-13-AM.log.
Jun 16, 2013 1:52:24 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Jun 16, 2013 1:52:24 AM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Jun 16, 2013 1:52:25 AM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/product/10.2.0/db_1/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ocmdb)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=prod))) -repos_user SYSMAN -action drop -verbose -output_file /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_repos_drop_2013-06-16_01-52-24-AM.log
Jun 16, 2013 1:52:25 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error dropping the repository
Jun 16, 2013 1:52:25 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_repos_drop_<date>.log for more details.
Jun 16, 2013 1:52:25 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error dropping the repository
Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-49-13-AM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-49-13-AM.log for more details.
STARTED EMCA at Jun 16, 2013 1:53:03 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: PROD
Incorrect usage. Run 'emca -help' for more details.
[oracle@ocmdb ~]$ emca -config dbcontrol db -repos create
STARTED EMCA at Jun 16, 2013 1:53:33 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: PROD
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Invalid username/password.
Password for DBSNMP user:
Invalid username/password.
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/10.2.0/db_1
Database hostname ................ ocmdb
Listener port number ................ 1521
Database SID ................ PROD
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 16, 2013 2:07:11 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-53-33-AM.log.
Jun 16, 2013 2:07:13 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jun 16, 2013 2:09:38 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Jun 16, 2013 2:09:38 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_repos_create_<date>.log for more details.
Jun 16, 2013 2:09:38 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-53-33-AM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-53-33-AM.log for more details.
查看状态是报错:
[oracle@ocmdb ~]$ emctl status dbconsole
TZ set to PRC
OC4J Configuration issue. /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_ocmdb_PROD not found.
检查日志
SQL> alter system set shared_pool_size=100m;
System altered.
SQL> alter system set job_queue_processes=5;
System altered.
[oracle@ocmdb ~]$ emca -config dbcontrol db -repos create
STARTED EMCA at Jun 16, 2013 3:30:39 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: PROD
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/10.2.0/db_1
Database hostname ................ ocmdb
Listener port number ................ 1521
Database SID ................ PROD
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 16, 2013 3:31:00 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_03-30-38-AM.log.
Jun 16, 2013 3:31:02 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jun 16, 2013 3:31:02 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Jun 16, 2013 3:31:02 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_repos_create_<date>.log for more details.
Jun 16, 2013 3:31:02 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_03-30-38-AM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_03-30-38-AM.log for more details.
任然没有成功!
[oracle@ocmdb ~]$
[oracle@ocmdb ~]$ emca -config dbcontrol db
STARTED EMCA at Jun 16, 2013 3:38:16 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: PROD
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/10.2.0/db_1
Database hostname ................ ocmdb
Listener port number ................ 1521
Database SID ................ PROD
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Jun 16, 2013 3:39:10 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_03-38-16-AM.log.
Jun 16, 2013 3:39:21 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jun 16, 2013 3:41:00 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jun 16, 2013 3:41:00 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://ocmdb:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 16, 2013 3:41:00 AM
User altered.
配置成功!
[oracle@ocmdb ~]$ emctl status 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://ocmdb:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/ocmdb_PROD/sysman/log
可以正常登陆EM进行管理了!
命令总结:
emca -config dbcontrol db -repos create 创建em资料库,并配制Database Control
emca -deconfig dbcontrol db -repos drop 取消配制Database Control,并删除em资料库
emca -repos create 创建一个EM资料库
emca -repos recreate 重建一个EM资料库
emca -repos drop 删除一个EM资料库
emca -config dbcontrol db 配置数据库的 Database Control
emca -deconfig dbcontrol db 删除数据库的 Database Control配置
emctl start dbconsole 先设置ORACLE_SID环境变量后,启动EM console服务
emctl stop dbconsole 先设置ORACLE_SID环境变量后,停止EM console服务
emctl status dbconsole 先设置ORACLE_SID环境变量后,查看EM console服务的状态
emca -config dbcontrol db -repos create 创建em资料库并同时配制Database Control
emca -deconfig dbcontrol db -repos drop 删除Database Control并同时删除em资料库
[oracle@ocmdb ~]$ emca
/u01/app/oracle/product/1 .2.0/db_1/bin/emca [operation] [mode] [dbType] [flags] [parameters]
-h | --h | -help | --help: prints this help message
-version: prints the version
-config dbcontrol db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure Database Control for a database
-config centralAgent (db | asm) [-cluster] [-silent] [parameters]: configure central agent management
-config all db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure both Database Control and central agent management
-deconfig dbcontrol db [-repos drop] [-cluster] [-silent] [parameters]: de-configure Database Control
-deconfig centralAgent (db | asm) [-cluster] [ -silent] [parameters]: de-configure central agent management
-deconfig all db [-repos drop] [-cluster] [-silent] [parameters]: de-configure both Database Control and central agent management
-addInst (db | asm) [-silent] [parameters]: configure EM for a new RAC instance
-deleteInst (db | asm) [-silent] [parameters]: de-configure EM for a specified RAC instance
-reconfig ports [-cluster] [parameters]: explicitly reassign Database Control ports
-reconfig dbcontrol -cluster [-silent] [parameters]: reconfigures RAC Database Control deployment
-displayConfig dbcontrol -cluster [-silent] [parameters]: displays information about the RAC Database Control configuration
-upgrade (db | asm | db_asm) [-cluster] [-silent] [parameters]: upgrades an earlier version of the EM configuration to the current version
-restore (db | asm | db_asm) [-cluster] [-silent] [parameters]: restores the current version of the EM configuration to an earlier version
Parameters and Options:
[parameters]: [ -respFile fileName ] [ -paramName paramValue ]*
db: perform configuration operation for a database (including databases that use ASM)
asm: perform configuration operation for an ASM-only instance
db_asm: perform upgrade/restore operation for a database and an ASM instance
-repos create: create a new Database Control repository
-repos drop: drop the current Database Control repository
-repos recreate: drop the current Database Control repository and recreate a new one
-cluster: perform configuration operation for a RAC database
-silent: perform configuration operation without prompting for parameters
-backup: configure automatic backup for a database
Parameters for single instance databases
HOST: Database hostname
SID: Database SID
PORT: Listener port number
ORACLE_HOME: Database ORACLE_HOME
HOST_USER: Host username for automatic backup
HOST_USER_PWD: Host user password for automatic backup
BACKUP_SCHEDULE: Automatic backup schedule (HH:MM)
EMAIL_ADDRESS: Email address for notifications
MAIL_SERVER_NAME: Outgoing Mail (SMTP) server for notifications
ASM_OH: ASM ORACLE_HOME
ASM_SID: ASM SID
ASM_PORT: ASM port
ASM_USER_ROLE: ASM user role
ASM_USER_NAME: ASM username
ASM_USER_PWD: ASM user password
SRC_OH: ORACLE_HOME for the database to be upgraded
DBSNMP_PWD: Password for DBSNMP user
SYSMAN_PWD: Password for SYSMAN user
SYS_PWD: Password for SYS user
DBCONTROL_HTTP_PORT: Database Control HTTP port
AGENT_PORT: EM agent port
RMI_PORT: RMI port for Database Control
JMS_PORT: JMS port for Database Control
Additional Parameters for cluster databases
CLUSTER_NAME: Cluster name
DB_UNIQUE_NAME: Database unique name
SERVICE_NAME: Service name
EM_NODE: Database Control node name
EM_SID_LIST: Agent SID list [comma separated]
[oracle@ocmdb ~]$
如果安装数据软件不是高级安装中只安装oracle软件的情况下则需要先删除再配置,配置时需要修改数据中的几个用户密码:
SQL> alter user dbsnmp identified by oracle;
User altered.
SQL> alter user dbsnmp identified by oracle;
配置过程:
[oracle@ocmdb ~]$ emca -deconfig dbcontrol db -repos drop
STARTED EMCA at Jun 16, 2013 1:49:13 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: PROD
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
Jun 16, 2013 1:52:22 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-49-13-AM.log.
Jun 16, 2013 1:52:24 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Jun 16, 2013 1:52:24 AM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Jun 16, 2013 1:52:25 AM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/product/10.2.0/db_1/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ocmdb)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=prod))) -repos_user SYSMAN -action drop -verbose -output_file /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_repos_drop_2013-06-16_01-52-24-AM.log
Jun 16, 2013 1:52:25 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error dropping the repository
Jun 16, 2013 1:52:25 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_repos_drop_<date>.log for more details.
Jun 16, 2013 1:52:25 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error dropping the repository
Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-49-13-AM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-49-13-AM.log for more details.
[oracle@ocmdb ~]$ emca -config dbcontrol db -repos drop
STARTED EMCA at Jun 16, 2013 1:53:03 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: PROD
Incorrect usage. Run 'emca -help' for more details.
[oracle@ocmdb ~]$ emca -config dbcontrol db -repos create
STARTED EMCA at Jun 16, 2013 1:53:33 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: PROD
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Invalid username/password.
Password for DBSNMP user:
Invalid username/password.
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/10.2.0/db_1
Database hostname ................ ocmdb
Listener port number ................ 1521
Database SID ................ PROD
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 16, 2013 2:07:11 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-53-33-AM.log.
Jun 16, 2013 2:07:13 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jun 16, 2013 2:09:38 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Jun 16, 2013 2:09:38 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_repos_create_<date>.log for more details.
Jun 16, 2013 2:09:38 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-53-33-AM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_01-53-33-AM.log for more details.
[oracle@ocmdb ~]$
没有成功,系统显示 shared_pool_size 和 job_queue_processes 参数不够大。已sys登入系统改掉该参数
查看状态是报错:
[oracle@ocmdb ~]$ emctl status dbconsole
TZ set to PRC
OC4J Configuration issue. /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_ocmdb_PROD not found.
检查日志
SQL> alter system set shared_pool_size=100m;
System altered.
SQL> alter system set job_queue_processes=5;
System altered.
[oracle@ocmdb ~]$ emca -config dbcontrol db -repos create
STARTED EMCA at Jun 16, 2013 3:30:39 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: PROD
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/10.2.0/db_1
Database hostname ................ ocmdb
Listener port number ................ 1521
Database SID ................ PROD
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 16, 2013 3:31:00 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_03-30-38-AM.log.
Jun 16, 2013 3:31:02 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jun 16, 2013 3:31:02 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Jun 16, 2013 3:31:02 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_repos_create_<date>.log for more details.
Jun 16, 2013 3:31:02 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_03-30-38-AM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_03-30-38-AM.log for more details.
任然没有成功!
[oracle@ocmdb ~]$
[oracle@ocmdb ~]$ emca -config dbcontrol db
STARTED EMCA at Jun 16, 2013 3:38:16 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: PROD
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/10.2.0/db_1
Database hostname ................ ocmdb
Listener port number ................ 1521
Database SID ................ PROD
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Jun 16, 2013 3:39:10 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/prod/emca_2013-06-16_03-38-16-AM.log.
Jun 16, 2013 3:39:21 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jun 16, 2013 3:41:00 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jun 16, 2013 3:41:00 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://ocmdb:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 16, 2013 3:41:00 AM
User altered.
配置成功!
[oracle@ocmdb ~]$ emctl status 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://ocmdb:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/ocmdb_PROD/sysman/log
可以正常登陆EM进行管理了!
命令总结:
emca -config dbcontrol db -repos create 创建em资料库,并配制Database Control
emca -deconfig dbcontrol db -repos drop 取消配制Database Control,并删除em资料库
emca -repos create 创建一个EM资料库
emca -repos recreate 重建一个EM资料库
emca -repos drop 删除一个EM资料库
emca -config dbcontrol db 配置数据库的 Database Control
emca -deconfig dbcontrol db 删除数据库的 Database Control配置
emctl start dbconsole 先设置ORACLE_SID环境变量后,启动EM console服务
emctl stop dbconsole 先设置ORACLE_SID环境变量后,停止EM console服务
emctl status dbconsole 先设置ORACLE_SID环境变量后,查看EM console服务的状态