From:http://blog.sina.com.cn/s/blog_6734ea6d0102v6sn.html
Add operating system environment variable: oracle_hostname=localhost
Then run Emca-config Dbcontrol db under cmd (if multiple DB instances, first execute set oracle_unqname= Oralcle_sid, where Oralcle_sid is your instance name)
C:\Documents and Settings\administrator>emca-config Dbcontrol db
EMCA started on 2012-3-10 18:01:26
EM Configuration Assistant, 11.2.0.0.2 official version
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database Sid:xdjwdb10
Listener Port number: 1521
Listener Oracle_home [D:\app\Administrator\product\11.2.0\dbhome_1]: LISTENER
SYS User's password:
DBSNMP User's password:
Sysman User's password:
Sysman User's password: e-mail address of the notification (optional):
Outgoing (SMTP) server for notifications (optional):
-----------------------------------------------------------------
The following settings have been specified
The database is oracle_home ..... ..... D:\app\Administrator\product\11.2.0\dbhome_1
Local hostname ...... localhost, the name of the
The listener is oracle_home ...... ..... LISTENER
Listener port number ...... ....... 1521
Database SID ..... XDJWDB10-----
The e-mail address of the notification .....
Notification of the outgoing (SMTP) server ..... .....
-----------------------------------------------------------------
Do you want to continue? [Yes (Y)/No (N)]: Y
2012-3-10 18:01:50 Oracle.sysman.emcp.EMConfig Perform
Info: Logging This action to D:\app\Administrator\cfgtoollogs\emca\XDJWDB10\emca_201
2_03_10_18_01_26.log.
2012-3-10 18:01:54 Oracle.sysman.emcp.EMReposConfig uploadconfigdatatorepository
Info: Uploading configuration data to the EM data archive (this operation may take some time) ...
2012-3-10 18:02:59 Oracle.sysman.emcp.EMReposConfig Invoke
Info: The configuration data was uploaded successfully
2012-3-10 18:03:00 Oracle.sysman.emcp.ParamsManager Getlocallistener
Warning: An error occurred while retrieving the listener for localhost
2012-3-10 18:03:04 Oracle.sysman.emcp.util.DBControlUtil Configuresoftwarelib
Info: The software library has been configured successfully.
2012-3-10 18:03:04 Oracle.sysman.emcp.EMDBPostConfig configuresoftwarelibrary
Info: Provisioning profile is being deployed ...
2012-3-10 18:03:40 Oracle.sysman.emcp.EMDBPostConfig configuresoftwarelibrary
Info: Provisioning file deployment was successful.
2012-3-10 18:03:40 Oracle.sysman.emcp.util.DBControlUtil Securedbconsole
Info: Protecting Database Control (This operation may take some time) ...
2012-3-10 18:03:49 Oracle.sysman.emcp.util.DBControlUtil Securedbconsole
Info: Database Control has been successfully protected.
2012-3-10 18:03:49 Oracle.sysman.emcp.util.DBControlUtil startoms
Info: Starting Database Control (This operation may take some time) ...
2012-3-10 18:05:05 Oracle.sysman.emcp.EMDBPostConfig performconfiguration
Info: The Database Control was successfully started
2012-3-10 18:05:07 Oracle.sysman.emcp.EMDBPostConfig performconfiguration
Info: >>>>>>>>>>> Control URL for Https://localhost:5500/em <<<< <<<<<<<<br>2012-3-10 18:05:11 Oracle.sysman.emcp.EMDBPostConfig Invoke
Warning:
WARNING ************************
The management repository is placed in safe mode, in which Enterprise Manager data is encrypted.
The encryption key has been placed in the file d:/app/administrator/product/11.2.0/dbhome_1/localhost_xdjw
The Db10/sysman/config/emkey.ora. Be sure to back up this file, because if this file is lost, the number of encryption
The data will not be available.
***********************************************************
Configuration of Enterprise Manager completed successfully
EMCA ended on 2012-3-10 18:05:11
Ps:
Create an EM repository
Emca-repos Create
Rebuilding an EM database
Emca-repos recreate
Delete an EM repository
Emca-repos Drop
Metabase Control for the configuration database
Emca-config Dbcontrol DB
To delete a database control configuration
Emca-deconfig Dbcontrol DB
Reconfigure the port for DB control, the default port at 1158
Emca-reconfig ports
Emca-reconfig Ports-dbcontrol_http_port 1160
Emca-reconfig Ports-agent_port 3940
Start the EM console service after setting the ORACLE_SID environment variable first
Emctl Start Dbconsole
Stop the EM console service after setting the ORACLE_SID environment variable first
Emctl Stop Dbconsole
Check the status of the EM console service after setting the ORACLE_SID environment variable first
Emctl Status Dbconsole
Steps to configure Dbconsole
Emca-repos Create
Emca-config Dbcontrol DB
Emctl Start Dbconsole
Steps to reconfigure Dbconsole
Emca-repos Drop
Emca-repos Create
Emca-config Dbcontrol DB
Emctl Start Dbconsole
Check Status: Emctl status Dbconsole
C:\Documents and Settings\administrator>emctl status Dbconsole
Oc4j Configuration issue. D:\app\administrator\product\11.2.0\dbhome_1/oc4j/j2ee
/OC4J_DBCONSOLE_LOCALHOST_ORCL not found.
Late:
Emctl Status Dbconsole
environment variable oracle_unqname not defined. Please set Oracle_unqname to database unique name
Workaround:
Set the Oracle_unqname when you start.
Set Oracle_unqname= $ORACLE _sid
Oracle 11g has been prompted for severity: The listener is not started or the database service is not registered with the listener