问题:emctl start dbconsole不能启动
1、 Lsnrctl监听程序正常启动
2、 emca -config dbcontrol db -repos recreate重建数据库出现如下报错:
但是也用export ORACLE_UNQNAME=orcl设置过
3、 查看日志error 111
[tom@004 log]$ pwd
/u01/app/tom/product/11.2.0/dbhome_1/localhost_orcl/sysman/log
[tom@004 log]$ more emdctl.trc
......
2014-06-28 01:32:03,320 Thread-3266332416 WARN http: nmehl_connect_internal: connect failed to (localhost:1158): 拒绝连接 (error = 111)
4、 包括环境变量、/etc/hosts、/etc/sysconfig/network设置也都正确
5、 [tom@004 log]$ emctl status dbconsole
OC4J Configuration issue. /u01/app/tom/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_0.0.0.4_orcl not found.
注意红色部分,我主机名是004,而查看emctl启动的时候,某些参数被解析成了.0.0.04
最终换个主机名zhou,问题得以解决。
问题:用Oracle SQL Developer连接数据库出现如下报错:
listener does not currently know of sid
1、 查看数据库实例名:
[tom@zhou ~]$ echo $ORACLE_SID
orcl
2、 查看相关配置文件
[tom@zhou admin]$ pwd
/u01/app/tom/product/11.2.0/dbhome_1/network/admin
[tom@zhou admin]$ ls
listener.ora samples shrept.lst sqlnet.ora tnsnames.ora
[tom@zhou admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/tom/product/11.2.0/dbhome_1/
network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
[tom@zhou admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/tom/product/11.2.0/dbhome_1/
network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01/app/tom
红色部分应该是localohst,默认有可能是localhost.domain
一、环境变量:
[tom@zhou ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/tom/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_HOSTNAME=localhost
[tom@zhou ~]$ hostname
zhou
二、Hosts文件:
[tom@zhou ~]$
[tom@zhou ~]$ cat /etc/hosts
127.0.0.1localhost.localdomainlocalhost.localdomainlocalhost4localhost4.localdomain4localhostzhou
::1localhost.localdomainlocalhost.localdomainlocalhost6localhost6.localdomain6 localhostzhou
三、主机名:
[tom@zhou ~]$ hostname
zhou
[tom@zhou ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=zhou
设置主机名,最好用root用户使用setup工具进行修改,在这里修改主机名,系统自己都会把好几个地方的配置文件都会改好。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。