您好,登錄后才能下訂單哦!
問題: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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。