環境:
ORACLE RDBMS Version: 11.1.0.6.0 + Windows 2003
問題描述:
10月9號,長假歸來第一天,公司開發庫數據庫無法進入,當時沒有查看日誌文件,也沒看ora-報錯號,直接重啓數據庫了(這次解決問題的方法不正確!)。
10月12號上午8:30到公司又發現數據庫無法登陸,登陸報ORA-3136錯誤。下定決心查看到底什麼問題。
解決過程:
重啓後啓動數據庫,打開日誌文件,11g的日誌文件存放與10g又不一樣,有一個參數diagnostic_dest控制,定位該日誌文件,發現在9號與12號之間有大量重複的報錯信息:
Fatal NI connect error 12170.
VERSION INFORMATION:
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 11.1.0.6.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 11.1.0.6.0 - Production
Time: 09-10月-2009 08:55:20
Tracing not turned on.
Tns error struct:
ns main err code: 12535
TNS-12535: TNS: 操作超時
ns secondary err code: 12606
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.3.8)(PORT=3208))
WARNING: inbound connection timed out (ORA-3136)
Fri Oct 09 08:55:23 2009
Completed: alter database open
Fri Oct 09 08:55:36 2009
網上查看相關資料,是和網絡連接相關的錯誤,metalink提出的解決方案是:
1. set INBOUND_CONNECT_TIMEOUT_<listenername>=0 in listener.ora
2. set SQLNET.INBOUND_CONNECT_TIMEOUT = 0 in sqlnet.ora of server.
其中修改listener的inbound_connect_timeout參數的方法有二種(我採用的第一種方式):
第一種:
C:/>lsnrctl
LSNRCTL for 32-bit Windows: Version 11.1.0.6.0 - Production on 12-10月-2009 10:1
6:57
Copyright (c) 1991, 2007, Oracle. All rights reserved.
歡迎來到LSNRCTL, 請鍵入"help"以獲得信息。
LSNRCTL> help
以下操作可用
星號 (*) 表示修改符或擴展命令:
start stop status
services version reload
save_config trace change_password
quit exit set*
show*
LSNRCTL> show
show之後提供了以下操作
星號 (*) 表示修改符或擴展命令:
rawmode displaymode
rules trc_file
trc_directory trc_level
log_file log_directory
log_status current_listener
inbound_connect_timeout startup_waittime
snmp_visible save_config_on_stop
dynamic_registration
LSNRCTL> show inbound_connect_timeout
正在連接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
LISTENER 參數 "inbound_connect_timeout" 設爲 60
命令執行成功
LSNRCTL> set inbound_connect_timeout 0
正在連接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
LISTENER 參數 "inbound_connect_timeout" 設爲 0
命令執行成功
LSNRCTL> show inbound_connect_timeout
正在連接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
LISTENER 參數 "inbound_connect_timeout" 設爲 0
命令執行成功
LSNRCTL> set save_config_on_stop on #指定在一個lsnrctl會話期內所發生的修改在退出時是否應該被保存起來,下次監聽啓動也是生效的 on 保存 off 不保存
正在連接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
LISTENER 參數 "save_config_on_stop" 設爲 ON
命令執行成功
LSNRCTL> exit
第二種:
修改listener.ora文件,加入: INBOUND_CONNECT_TIMEOUT_LISTENER_NAME=0
修改好了,過幾天再查看下有沒有該問題存在,(*^__^*)…嘻嘻
網上資料:
Oracle10gR2 ORA-3136 錯誤解決http://www.eygle.com/archives/2006/07/sqlnet_inbound_connect_timeout.html
http://blog.chinaunix.net/u1/50863/showart_410003.html
ORA-12518: TNS: 監聽程序無法分發客戶機
http://www.itpub.net/viewthread.php?tid=521086&extra=&page=1
lsnrctl 使用詳解
http://hi.baidu.com/gaobonm/blog/item/b5c383821acd0eb66c8119d8.html
相關參數說明:
Use the INBOUND_CONNECT_TIMEOUT parameter to specify how long the Oracle Connection Manager listener waits for a valid connection from a client or another instance of Oracle Connection Manager. This parameter accepts the following values:
60 (default) to disable the timeout
n>0 to enable the timeout, where n equals the timeout period in seconds