您好,登錄后才能下訂單哦!
問(wèn)題:emctl start dbconsole不能啟動(dòng)
1、 Lsnrctl監(jiān)聽(tīng)程序正常啟動(dòng)
2、 emca -config dbcontrol db -repos recreate重建數(shù)據(jù)庫(kù)出現(xiàn)如下報(bào)錯(cuò):
但是也用export ORACLE_UNQNAME=orcl設(shè)置過(guò)
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、 包括環(huán)境變量、/etc/hosts、/etc/sysconfig/network設(shè)置也都正確
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.
注意紅色部分,我主機(jī)名是004,而查看emctl啟動(dòng)的時(shí)候,某些參數(shù)被解析成了.0.0.04
最終換個(gè)主機(jī)名zhou,問(wèn)題得以解決。
問(wèn)題:用Oracle SQL Developer連接數(shù)據(jù)庫(kù)出現(xiàn)如下報(bào)錯(cuò):
listener does not currently know of sid
1、 查看數(shù)據(jù)庫(kù)實(shí)例名:
[tom@zhou ~]$ echo $ORACLE_SID
orcl
2、 查看相關(guān)配置文件
[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
紅色部分應(yīng)該是localohst,默認(rèn)有可能是localhost.domain
一、環(huán)境變量:
[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
三、主機(jī)名:
[tom@zhou ~]$ hostname
zhou
[tom@zhou ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=zhou
設(shè)置主機(jī)名,最好用root用戶(hù)使用setup工具進(jìn)行修改,在這里修改主機(jī)名,系統(tǒng)自己都會(huì)把好幾個(gè)地方的配置文件都會(huì)改好。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。