oracle 启动监听报错TNS-12547: TNS:lost contact
監聽啟動出錯,報以下錯誤:
lsnrctl start
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 06-JUL-2009 14:37:59
Copyright (c) 1991, 2002, Oracle Corporation.? All rights reserved.
Starting /opt/oracle/product/9ir2/bin/tnslsnr: please wait...
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
Linux Error: 32: Broken pipe
數據庫服務器操作系統為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文件的內容,在數據庫服務器執行以下命令
?????? cd $ORACLE_HOME/network/log
?????? cat </dev/null> listener.log
2、讓命令lsnrctl不記錄log,在數據庫服務器執行以下命令
?????? lsnrctl
?????? set log_status off
???????quit
?????也可以在listener.ora文件中加入logging_listener=off,即可關閉監聽日志
?
可能跟這個問題相關的第二種情況,錯誤信息如下:
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
Linux Error: 104: Connection reset by peer
這個問題應該跟主機名有關了,查看/etc/hosts文件
[root@olivenan root]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
然后查看listener.ora文件,發現HOST=ixdba
應該是這里的問題了,那么只需在/etc/hosts增加如下即可
[root@olivenan root]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1? localhost
127.0.0.1? ixdba
?
以下是另外一種情況
?今天上午,遇到一個問題,客戶容災庫其中一個節點啟動監聽報錯 TNS-12547: TNS:lost contact (另外一個節點啟動正常)
根據抱錯,懷疑是lintener.log日志文件太大了,超過2G了,所以無法啟動,還有一個可能是/etc/hosts 目錄下沒有 127.0.0.1???? loopback localhost 記錄,這是通常導致此錯誤的常見原因
查看lintener.log日志文件,大小遠不足2G,第一種可能排除;
r2:/oracle/app/oracle/product/9.2.0/network/log>ls -lrt
total 24
drwxr-xr-x?? 2 oracle?? dba???????????? 256 Nov 15 2007? bak
-rw-r--r--?? 1 oracle?? dba??????????? 6414 Feb 24 15:32 sqlnet.log
-rw-r--r--?? 1 oracle?? dba??????????? 3025 Jul 09 11:38 listener.log
查看/etc/hosts的內容:127.0.0.1???? loopback localhost????? # loopback (lo0) name/address也正常,第二種可能排除
/etc/hosts
#
# This file contains the hostnames and their address for hosts in the
# network.? This file is used to resolve a hostname into an Internet
# address.?
#
# At minimum, this file must contain the name and address for each
# device defined for TCP in your /etc/net file.? It may also contain
# entries for well-known (reserved) names such as timeserver
# and printserver as well as any other host name and address.
#
# The format of this file is:
# Internet Address????? Hostname??????? # Comments
# Items are separated by any number of blanks and/or tabs.? A '#'
# indicates the beginning of a comment; characters up to the end of the
# line are not interpreted by routines which search this file.? Blank
# lines are allowed.
# Internet Address????? Hostname??????? # Comments
# 192.9.200.1?????????? net0sample????? # ethernet name/address
# 128.100.0.1?????????? token0sample??? # token ring name/address
# 10.2.0.2????????????? x25sample?????? # x.25 name/address
127.0.0.1?????????????? loopback localhost????? # loopback (lo0) name/address
這里依舊嘗試了一下,rm lintener.log,在touch一個listener.log,在啟動監聽
Lsnrctl stop? -----先停掉listener
rm listener.log ----cd $ORACLE_HOME/network/log
touch listener.log
lsnrctl start
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=135.10.34.38)(PORT=1521)))
TNS-12547: TNS:lost contact
?TNS-12560: TNS rotocol adapter error
? TNS-00517: Lost contact
?? IBM/AIX RISC System/6000 Error: 73: Connection reset by peer
報錯依舊,查看lintener.log里的記錄
09-JUL-2008 12:17:05 * 12546
TNS-12546: TNS ermission denied
?TNS-12560: TNS rotocol adapter error
? TNS-00516: Permission denied
查看其進程:
r2:/oracle/app/oracle/product/9.2.0/network/admin>ps -ef |grep lsnr
? oracle 192870 168578?? 0 12:16:13? pts/9? 0:00 grep lsnr
? oracle 254244 274714?? 0 11:06:44? pts/0? 0:00 lsnrctl
? oracle 242390????? 1?? 0 11:06:57? pts/0? 0:00 /oracle/app/oracle/product/9.2.0/bin/tnslsnr LISTENER -inherit
rzyzdb2:/oracle/app/oracle/product/9.2.0/network/admin>
kill -9 242390
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
Copyright?? 1991, 2006, Oracle Corporation.? All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=135.10.34.38)(PORT=1521)))
TNS-12537: TNS:connection closed
?TNS-12560: TNS rotocol adapter error
? TNS-00507: Connection closed
查看節點2的sqlnet.ora發現:
問題就在此(sqlnet.ora里面有ip限制的,38這個ip,也就是出故障的這個ip不再sqlnet.ora內容里,將38添加到sqlnet.ora后,啟動正常)
總結
以上是生活随笔為你收集整理的oracle 启动监听报错TNS-12547: TNS:lost contact的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Oracle增大redo log fil
- 下一篇: 塔式服务器、机架式服务器、刀片服务器区别