Fatal NI connect error 12541, connecting to: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=WIN-EPRQ7FK9EK2)(PORT=1521))(CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=E:\app\Administrator\product\11.2.0\dbhome_4\bin\emagent.exe)(HOST=WIN-EPRQ7FK9EK2)(USER=SYSTEM))))
VERSION INFORMATION: TNS for 64-bit Windows: Version 11.2.0.1.0 - Production Windows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 11.2.0.1.0 - Production Time: 13-6月 -2017 10:58:58 Tracing not turned on. Tns error struct: ns main err code: 12541 TNS-12541: TNS: 无监听程序 ns secondary err code: 12560 nt main err code: 511 TNS-00511: 无监听程序 nt secondary err code: 61 nt OS err code: 0
故障原因
oracle运行时间过长,listener.log日志超过4G导致,此为oracle bug;BUG号为9879101 : THE CONNECT THROUGH LISTENER WAS SLOW WHEN LISTNER LOG GROWED 4GB
@echo off echo ================================================ echo E:\app\Administrator\diag\tnslsnr\WIN-EPRQ7FK9EK2\listener\trace\listener.log 备份文件,用来解决日志问超过4G,数据库监听死掉问题 echo ================================================ ::以“YYYYMMDD”格式取出当前时间。 set BACKUPDATE=%date:~0,4%%date:~5,2%%date:~8,2% set DATADIR=E:\app\Administrator\diag\tnslsnr\WIN-EPRQ7FK9EK2\listener\trace\
echo 备份日志文件 e: cd %DATADIR% lsnrctl set log_status off rename listener.log listener.log_%BACKUPDATE% lsnrctl set log_status on echo 删除30天以前的日志文件 forfiles -p %DATADIR% -s -m listener.log_* -d -30 -c "cmd /c del @path"