一、Oracle OEM开启失败---环境变量ORACLE_UNQNAME未定义问题
登陆https://h1:1158/em 之后,看到数据库实例都是关闭的.启动不了 (1)查看dbconsole状态:emctl status dbconsole
显示:Environment variable ORACLE_UNQNAME not defined. Please define it. 解决方法:
在启动的时候先设置一下oracle_unqname
set oracle_unqname=$ORACLE_SID
如果还是失败,在环境变量中添加:
[oracle@h1 ~]$ vi ~/.bash_profile
在最后添加:export ORACLE_UNQNAME=$ORACLE_SID
[oracle@h1 ~]$ source ./bash_profile
使环境变量生效
2.emctl start dbconsole
如果还出现上述的错误:删除dbconsole重新配置 [oracle@h1 ~]$ emca -deconfig dbconsole db -repos drop
STARTED EMCA at Mar 14, 2013 9:06:48 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: bitc
Listener port number: 1522
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: Y
Mar 14, 2013 9:07:05 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /app/oracle/cfgtoollogs/emca/ORCL/emca_2013_03_14_21_06_47.log.
Mar 14, 2013 9:07:05 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Mar 14, 2013 9:08:35 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Mar 14, 2013 9:08:35 PM
3.如果删除失败,则旧数据清除
[oracle@h1 ~]$ sqlplus "/as SYSDBA"
SQL*Plus:> Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition> With the Partitioning, OLAP, Data Mining and Real Application Testing options #(1)进入数据库删除dbconsole以前的用户,并且修改DBSNMP密码
SQL>> #(2)删除早期DBCONSOLE创建的用户: sql>drop role MGMT_USER; sql>drop user MGMT_VIEW cascade; sql>drop user sysman cascade; #(3)删除早期DBCONSOLE创建的对象: sql>drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS; sql>drop public synonym SETEMVIEWUSERCONTEXT;
Oracle Enterprise Manager 11g Database Control> Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
https://h1:5501/em/console/aboutApplication
- An instance of Oracle Enterprise Manager 11g Database Control is already running.
[oracle@h1 ~]$ emctl status dbconsole