码迷,mamicode.com
首页 > 数据库 > 详细

oracle em启动失败--ORACLE_UNQNAME not defined

时间:2017-05-26 23:13:57      阅读:281      评论:0      收藏:0      [点我收藏+]

标签:emc重配置   database   配置文件   oracle   服务器   

客户的服务器启动不了em

报错Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.


需要做的比对

1,oracle 目录下的TNS 、LSN配置文件hostname

2,linux  /etc/hosts 里的hostname

3,oracle 用户下 .bash_profile 或者是 .bashrc

能配置hostname的地方是否都一致

我出现的问题是,用户改动过hostname ,  oracle 下的.bash_profile 申明的hostanme 和oracle 数据库的不一致所以报错,修改一致

source .bash_profile 可以使用


如果你确认hostname 和 sid 实例名都没有错

那么建议你进行emc重建操作

$ sqlplus / as sysdba
SQL> alter user dbsnmp identified by py123456;
User altered.

SQL> drop role MGMT_USER;
Role dropped.

SQL> drop user MGMT_VIEW cascade;
User dropped.

SQL> drop user sysman cascade;
User dropped.

SQL> drop user sysman cascade;

SQL> drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
Synonym dropped.

SQL> drop public synonym SETEMVIEWUSERCONTEXT;
Synonym dropped.
SQL>quit


$ emca -config dbcontrol db -repos create

进行创建操作

STARTED EMCA at May 26, 2017 10:37:01 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.


Enter the following information:
Database SID: oracle11
log4j:WARN No appenders could be found for logger (emSDK.config).
log4j:WARN Please initialize the log4j system properly.
Listener port number:
Listener ORACLE_HOME [  ]:
Password for SYS user: 
Password for DBSNMP user: 
Password for SYSMAN user: 
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):


WARNING: ORA-00955: name is already used by an existing object--- 告警这个的话是配置没清除干净


使用

$ emca -config dbcontrol db -repos recreate

执行


按步骤操作


最后可以使用em


本文出自 “10999243” 博客,请务必保留此出处http://11009243.blog.51cto.com/10999243/1929962

oracle em启动失败--ORACLE_UNQNAME not defined

标签:emc重配置   database   配置文件   oracle   服务器   

原文地址:http://11009243.blog.51cto.com/10999243/1929962

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!