oracle 啟動監聽報錯TNS-12547: TNS:lost contact
資料庫伺服器作業系統為Red Hat AS4,屬於32位作業系統,最大文字檔案不能超過2G。
當$ORACLE_HOME/network/log中listener.log大小等於2G的時候,無法繼續寫入日誌,監聽服務會自動停掉,啟動或停止listener時都會報錯
資料庫伺服器作業系統為Red Hat AS4,屬於32位作業系統,最大文字檔案不能超過2G。
當$ORACLE_HOME/network/log中listener.log大小等於2G的時候,無法繼續寫入日誌,監聽服務會自動停掉,啟動或停止listener時都會報錯
1.經常手工去清除listener.log檔案的內容,在資料庫伺服器執行以下命令
2、讓命令lsnrctl不記錄log,在資料庫伺服器執行以下命令
也可以在listener.ora檔案中加入logging_listener=off,即可關閉監聽日誌
然後檢視listener.ora檔案,發現HOST=ixdba
應該是這裡的問題了,那麼只需在/etc/hosts增加如下即可
今天上午,遇到一個問題,客戶容災庫其中一個節點啟動監聽報錯 TNS-12547: TNS:lost contact (另外一個節點啟動正常)
檢視lintener.log日誌檔案,大小遠不足2G,第一種可能排除;
檢視/etc/hosts的內容:127.0.0.1 loopback localhost # loopback (lo0) name/address也正常,第二種可能排除
這裡依舊嘗試了一下,rm lintener.log,在touch一個listener.log,在啟動監聽
r2:/oracle/app/oracle/product/9.2.0/network/log>lsnrctl start
LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production on 09-JUL-2008 12:24:21
自我總結:
服務端:
1、在修改完/etc/hosts檔案後,需將hostname臨時重置一下。
[root@localhost ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 zwl localhost
(這個可以忽略)2、/u01/oracle/product/10.2.0/network/admin/sqlnet.ora
tcp.validnode_checking=no SQLNET.AUTHENTICATION_SERVICES= (ALL)
3、檢查例項名
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
export ORACLE_SID=ora10g
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
4、檢查監聽
[oracle@localhost ~]$ cat /u01/oracle/product/10.2.0/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/oracle/product/10.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ora10g)
(ORACLE_HOME = /u01/oracle/product/10.2.0)
(SID_NAME = ora10g)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.46.131)(PORT = 1521))
)
[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 17-DEC-2013 16:50:40
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.46.131)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 17-DEC-2013 16:31:26
Uptime 0 days 0 hr. 19 min. 14 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File /u01/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.46.131)(PORT=1521)))
Services Summary...
Service "ora10g" has 1 instance(s).
Instance "ora10g", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
客戶端:
1、tnsnames.ora可以手動新增
D:\app\Administrator\product\11.1.0\client_1\NETWORK\ADMIN\tnsnames.ora
ORA10G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.46.131)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora10g)
)
)
2、客戶端cmd tnsping ora10g 能解析即OK,或者使用Net manager 配置一下tns也一樣,和第一步效果是一樣的,然後就可以使用pl/sql訪問了。
注意tnsping 的有可能是網路服務名,這個可以看一下Net manager 配置。但是也可能是例項名與網路服務名是一樣的。直接寫檔案tnaname.ora也是一樣的道理。
C:\Documents and Settings\Administrator> tnsping ora10g_clone2
TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 - Production on 17-12月-
2013 16:33:50
Copyright (c) 1997, 2007, Oracle. All rights reserved.
已使用的引數檔案:
D:\app\Administrator\product\11.1.0\client_1\network\admin\sqlnet.ora
已使用 TNSNAMES 介面卡來解析別名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.46.131)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ora10g)))
OK (10 毫秒)
C:\Documents and Settings\Administrator> tnsping ora10g_clone3
TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 - Production on 17-12月-
2013 16:38:27
Copyright (c) 1997, 2007, Oracle. All rights reserved.
已使用的引數檔案:
D:\app\Administrator\product\11.1.0\client_1\network\admin\sqlnet.ora
已使用 TNSNAMES 介面卡來解析別名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.46.128)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ora10g)))
OK (0 毫秒)
3、客戶端監聽與tns
D:\app\Administrator\product\11.1.0\client_1\NETWORK\ADMIN\tnsnames.ora
ORA10G_CLONE2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.46.131)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora10g)
)
)
ORA10G_CLONE3 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.46.128)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora10g)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = Oracle8)
(SID_NAME = ora10g)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.46.128)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.46.131)(PORT = 1521))
)
)
一般監聽發生問題需檢查如下五項:
1、/etc/hosts及域名解析配置檔案(注意hostname要和tnsname.ora的host一致,實在搞不清楚就直接使用固定的IP地址吧)
2、監聽日誌大小
3、監聽狀態
4、$ORACLE_HOME/oracle可執行檔案許可權
5、檢查資料庫配置show parameter local_listener
總結:
show parameter local_listener查到的引數
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string ORA11G
該VALUE引數對應了tnsnames.ora檔案中的監聽配置
ORA11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.111)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA11G)
)
)
LISTENER_ORA11G =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.111)(PORT = 1521))
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28371090/viewspace-1061905/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle案例04——TNS-12547: TNS:lost contactOracle
- sqlplus登入資料庫報錯ORA-12547: TNS:lost contactSQL資料庫
- 【ORA】ORA-12547 TNS: Lost Contact錯誤診斷
- 【ORA-】ORA-12547: TNS:lost contact錯誤的跟蹤分析
- 12cRAC打季度補丁時遇到ORA-12547: TNS:lost contact錯誤
- Oracle TNS報錯大全Oracle
- 在Suse 12.4上安裝11.2.0.4的rac執行root.sh報錯“ORA-12547: TNS:lost contact”
- Oracle啟動兩個監聽Oracle
- deleted事件監聽報錯delete事件
- oracle netca建立監聽報錯/u01/oracle/bin/netca: line 178: 11819 AbortedOracle
- 2.5.4. 測試Oracle net——2.5.4.1. 啟動監聽程式Oracle
- 模型deleted事件監聽報錯解析模型delete事件
- 啟動資料庫監聽資料庫
- ORACLE rac資料庫監聽與應用TNS連線串配置與ORA12519Oracle資料庫
- 【ERROR】Windows環境Oracle打psu後監聽啟動報錯:上下文生成失敗,找不到從屬程式集ErrorWindowsOracle
- JMS監聽Oracle AQOracle
- oracle靜態監聽Oracle
- 【DB寶49】Oracle如何設定DB、監聽和EM開機啟動Oracle
- 6、oracle網路(監聽)Oracle
- Oracle dblink監聽問題Oracle
- Oracle的TNS-12502 錯誤原因及解決Oracle
- 解決MMM啟動監控報錯的問題
- 【ASM】Oracle RAC css啟動報錯"Duplicate voting file found"ASMOracleCSS
- Oracle 監聽異常處理Oracle
- Oracle 監聽投毒COST解決Oracle
- Oracle 建立非1521埠監聽Oracle
- Oracle啟動報錯:ORA-03113: end-of-file on communication channelOracle
- ORACLE啟動報錯之ORA-03113&ORA-16038&ORA-30012Oracle
- myeclipse啟動報錯Eclipse
- hyperf 啟動、重啟、停止、檔案變化監聽命令包
- ORACLE 18C啟動資料庫報錯ORA-04031Oracle資料庫
- oracle rac scan監聽更改埠號Oracle
- oracle監聽不到例項服務Oracle
- ORACLE TNS Io異常End of TNS data channel&ORA-12518Oracle
- 本地nacos啟動報錯
- Homestead 啟動 elasticsearch 報錯Elasticsearch
- zabbix-agent啟動之後10050埠未監聽
- Oracle 19C 監聽無法動態註冊例項Oracle
- Oracle 12c DG備庫啟動報錯standby database requires recoveryOracleDatabaseUI