OS : Windows Server 2008 32Bit
DB : 11.2.0sql
前天應用不能訪問數據庫了 (後臺應用能訪問數據庫),故障發生。
立刻登陸到服務器裏查看監聽狀態,發現有TNS-12541 ,TNS-12560等錯誤數據庫
手動把監聽服務啓動,這時候服務狀態上顯示爲已啓動,但在CMD窗口執行lsnrctl status的時候依然返回錯誤信息:windows
C:\>lsnrctl status LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 13-2月 -2018 10:39:47 Copyright (c) 1991, 2010, Oracle. All rights reserved. 正在鏈接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=john-PC)(PORT= TNS-12541: TNS: 無監聽程序 TNS-12560: TNS: 協議適配器錯誤 TNS-00511: 無監聽程序 32-bit Windows Error: 61: Unknown error 正在鏈接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 過段時間回顯很是慢。
**網上有個解決TNS-12535錯誤的案例,平臺和版本都很相似,以下:服務器
DIAG_ADR_ENABLED = OFF
app
DIAG_ADR_ENABLED_<listenername> = OFF 若是監聽是listener時,則前面的名稱爲:DIAG_ADR_ENABLED_LISTENER = OFF
但這並非問題發生緣由,在繼續排查過程當中偶然發現監聽日誌大小竟然爲4G。ide
Oracle一個BUG,BUG號爲9879101 : THE CONNECT THROUGH LISTENER WAS SLOW WHEN LISTNER LOG GROWED 4GB。this
有MOS上一篇文章,ID 1319797.1 : WINDOWS: Listener Hangs & Lsnrctl Commands Are Slow or Hang,裏面給出瞭解決方法:3d
You can solve this problem by deleting the large listener in $ORACLE_BASE\diag\tnslsnr\<hostname>\listener\trace\<listener_name>.log 1) Stop the listener process using the command line or Control Panel Service. 2) Delete the log file(s) that are at or approaching the 4G size limit at this location: $ORACLE_BASE\diag\tnslsnr\<hostname>\listener\trace\<listener_name>.log 3) Issue any lsnrctl command and you will see a new listener.log in its place under: $ORACLE_BASE\diag\tnslsnr\<hostname>\listener\trace\ Since ADR Diagnostics are enabled for this listener these steps cannot be done dynamically using the lsnrctl utility. e.g. LSNRCTL>set log_file mylog Will yield: TNS-01251: Cannot set trace/log directory under ADR. However, it is possible to disable the flat file listener logging using the following commands: LSNRCTL>set current_listener <listener_name> LSNRCTL>set log_status OFF LSNRCTL>save_config
1)LSNRCTL進入交互模式
2)set log_file mylog
3)執行set current_listener LISTENER
4)set log_status off
5)save_config
6)stop 中止監聽器
7)手工刪除ADR指定的監聽日誌路徑下的listener.log文件
8)start重啓監聽器
9)status查看狀態
日誌
到此問題解決。code