您的位置:首页 > 数据库 > Oracle

手工配置oracle数据库

2013-11-19 10:21 351 查看
在安装oralce的过程中,最后弹出这样的报错,



参照文章http://www.2cto.com/database/201109/102928.html

[oracle@RedHatOS ~]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Nov 18, 2013 8:52:28 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: oracle
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
Nov 18, 2013 8:52:51 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/oracle/emca_2013_11_18_20_52_27.log.
Nov 18, 2013 8:52:52 PM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
WARNING: ORA-12541: TNS:no listener

Nov 18, 2013 8:52:52 PM oracle.sysman.emcp.EMConfig perform
SEVERE:

Database connection through listener failed. Fix the error and run EM Configuration Assistant again.

Some of the possible reasons may be:

1) Listener port 1521 provided is incorrect. Provide the correct port.
2) Listener is not up. Start the Listener.
3) Database service oracle is not registered with listener. Register the database service.
4) Listener is up on physical host and ORACLE_HOSTNAME environment variable is set to virtual host. Unset ORACLE_HOSTNAME environment variable.
5) Listener is up on virtual host. Set environment variable ORACLE_HOSTNAME=<virtual host>.
6) /etc/hosts does not have correct entry for hostname.

Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/oracle/emca_2013_11_18_20_52_27.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/oracle/emca_2013_11_18_20_52_27.log for more details.
[oracle@RedHatOS ~]$
排除问题,确定为第六可能是原因,于是修改/etc/hosts
[root@RedHatOS ~]# cat /etc/hosts
127.0.0.1   RedHatOS(原来为空,修改)  localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.10         RedHatOS
重新删除

[oracle@RedHatOS ~]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Nov 18, 2013 9:00:31 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: oracle
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
Nov 18, 2013 9:00:47 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/oracle/emca_2013_11_18_21_00_31.log.
Nov 18, 2013 9:00:48 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed. Some of the possible reasons may be:
1) EM is configured with different hostname then physical host. Set environment variable ORACLE_HOSTNAME=<hostname> and re-run EMCA script
2) ORACLE_HOSTNAME is set. Unset it and re-run EMCA script
Nov 18, 2013 9:00:48 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Nov 18, 2013 9:07:15 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Nov 18, 2013 9:07:15 PM
成功,然后创建

[oracle@RedHatOS ~]$ emca -config dbcontrol db -repos create

STARTED EMCA at Nov 18, 2013 9:09:22 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: oracle
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2/db_1 ]: /u01/app/oracle/product/11.2/db_1
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/db_1

Local hostname ................ RedHatOS
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2/db_1
Listener port number ................ 1521
Database SID ................ oracle
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Nov 18, 2013 9:10:07 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/oracle/emca_2013_11_18_21_09_21.log.
Nov 18, 2013 9:10:09 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Nov 18, 2013 9:27:06 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Nov 18, 2013 9:27:17 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Nov 18, 2013 9:30:05 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Nov 18, 2013 9:30:12 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Nov 18, 2013 9:30:33 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Nov 18, 2013 9:30:33 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Nov 18, 2013 9:33:01 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Nov 18, 2013 9:33:01 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://RedHatOS:1158/em <<<<<<<<<<<
Nov 18, 2013 9:33:10 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/db_1/RedHatOS_oracle/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 Nov 18, 2013 9:33:10 PM


查看状态,说明配置成功

[oracle@RedHatOS ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved. https://RedHatOS:1158/em/console/aboutApplication Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2/db_1/RedHatOS_oracle/sysman/log
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Oracle