楼主今天打算玩一下EM,参照官方文档,使用了emctl start dbconsole的命令,出现了一下错误。
-
[oracle@orcl ~]$ emctl start dbconsole
-
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.
我的解决方法是在/home/oracle/bash_profile文件添加ORACLE_UNQNAME
-
vim .bash_profile
-
export ORACLE_UNQNAME=$ORACLE_SID
然后再次运行emctl start dbconsole,上面的错误解决了,但是又有个新的错误。
-
[oracle@orcl ~]$ emctl start dbconsole
-
OC4J Configuration issue. /u01/app/oracle/product/11.2.0.3/dbhome_1/oc4j/j2ee/OC4J_DBConsole_orcl_orcl not found.
原来是楼主安装oracle数据库的时候是选择不安装EM的。那我们就重新安装EM资料库吧。
-
[oracle@orcl ~]$ emca -repos recreate
-
-
STARTED EMCA at Jan 16, 2017 9:01:21 PM
-
EM Configuration Assistant, Version 11.2.0.3.0 Production
-
Copyright (c) 2003, 2011, Oracle. All rights reserved.
-
-
Enter the following information:
-
Database SID: orcl
-
Listener port number: 1521
-
Password for SYS user:
-
Password for SYSMAN user:
-
-
----------------------------------------------------------------------
-
WARNING : While repository is dropped the database will be put in quiesce mode.
-
----------------------------------------------------------------------
-
Do you wish to continue? [yes(Y)/no(N)]: y
-
Jan 16, 2017 9:01:47 PM oracle.sysman.emcp.EMConfig perform
-
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2017_01_16_21_01_20.log.
-
Jan 16, 2017 9:01:47 PM oracle.sysman.emcp.EMReposConfig invoke
-
INFO: Dropping the EM repository (this may take a while) ...
-
Jan 16, 2017 9:01:49 PM oracle.sysman.emcp.EMReposConfig invoke
-
INFO: Repository successfully dropped
-
Jan 16, 2017 9:01:49 PM oracle.sysman.emcp.EMReposConfig createRepository
-
INFO: Creating the EM repository (this may take a while) ...
-
Jan 16, 2017 9:05:39 PM oracle.sysman.emcp.EMReposConfig invoke
-
INFO: Repository successfully created
-
Enterprise Manager configuration completed successfully
-
FINISHED EMCA at Jan 16, 2017 9:05:39 PM
EM资料库重建完就开始配置dbcontrol了。
-
[oracle@orcl ~]$ emca -config dbcontrol db
-
-
STARTED EMCA at Jan 16, 2017 9:14:18 PM
-
EM Configuration Assistant, Version 11.2.0.3.0 Production
-
Copyright (c) 2003, 2011, Oracle. All rights reserved.
-
-
Enter the following information:
-
Database SID: orcl
-
Listener port number: 1521
-
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0.3/dbhome_1 ]:
-
Password for SYS user:
-
Password for DBSNMP user:
-
Jan 16, 2017 9:14:40 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly
-
WARNING: ORA-28000: the account is locked
-
-
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.3/dbhome_1
-
-
Local hostname ................ orcl
-
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0.3/dbhome_1
-
Listener port number ................ 1521
-
Database SID ................ orcl
-
Email address for notifications ...............
-
Outgoing Mail (SMTP) server for notifications ...............
-
-
-----------------------------------------------------------------
-
Do you wish to continue? [yes(Y)/no(N)]: y
-
Jan 16, 2017 9:15:14 PM oracle.sysman.emcp.EMConfig perform
-
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2017_01_16_21_14_18.log.
-
Jan 16, 2017 9:15:18 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
-
INFO: Uploading configuration data to EM repository (this may take a while) ...
-
Jan 16, 2017 9:16:05 PM oracle.sysman.emcp.EMReposConfig invoke
-
INFO: Uploaded configuration data successfully
-
Jan 16, 2017 9:16:07 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
-
INFO: Securing Database Control (this may take a while) ...
-
Jan 16, 2017 9:16:55 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
-
INFO: Database Control secured successfully.
-
Jan 16, 2017 9:16:55 PM oracle.sysman.emcp.util.DBControlUtil startOMS
-
INFO: Starting Database Control (this may take a while) ...
-
Jan 16, 2017 9:17:38 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
-
INFO: Database Control started successfully
-
Jan 16, 2017 9:17:38 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
-
INFO: >>>>>>>>>>> The Database Control URL is https://orcl:1158/em <<<<<<<<<<<
-
Jan 16, 2017 9:17:45 PM oracle.sysman.emcp.EMDBPostConfig invoke
-
WARNING:
-
************************ WARNING ************************
-
-
Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0.3/dbhome_1/orcl_orcl/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.
-
-
***********************************************************
-
Enterprise Manager configuration completed successfully
-
FINISHED EMCA at Jan 16, 2017 9:17:45 PM
现在就可以用浏览器打开EM了。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31355629/viewspace-2132578/
,如需转载,请注明出处,否则将追究法律责任。