监听日志文件超过4G 在某些平台上无法再增长
本帖最后由 oradbguy 于 2013-8-15 21:55 编辑10.2.0.4 RAC ON AIX 5300-12 USE JFS2 filesystem
1.环境
$ulimit -a
time(seconds) unlimited
FILE(blocks) UNLIMITED
data(kbytes) unlimited
stack (kbytes) 32768
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) unlimited
ls -l /etc/security/limit*
-rw-r----- 1 root security 1343 Apr 18 2011 /etc/security/limits
ps -ef|grep tns
root 385230 397954 0 11:40:32 pts/0 0:00 grep tns
oracle 188852 1 2 Aug 12 - 15:29 /oracle/product/10.2.0/db_1/bin/tnslsnr LISTENER_IDB1 -inherit
2. 监听文件在去年就达到了4G的大小
$cd $ORACLE_HOME/network/log
$ls -l
-rw-r----- 1 oracle dba 316159841 Nov 16 2012 listener.log
-rw-r----- 1 oracle dba 4294967429 Apr 09 2012 listener_idb1.log
-rw-r----- 1 oracle dba 23625802 Aug 15 11:59 sqlnet.log
3.lsnrctl status(最近监听hang后重启过,目前运行正常,仍然不写log)
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 15-AUG-
2013 09:09:26
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER_IDB1
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.4
.0 - Production
Start Date 12-AUG-2013 05:35:54
Uptime 3 days 3 hr. 33 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/product/10.2.0/db_1/network/log/listener_idb1.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.x.x.x)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.x.x.x)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "idb" has 2 instance(s).
Instance "idb1", status READY, has 2 handler(s) for this service...
Instance "idb2", status READY, has 1 handler(s) for this service...
Service "idbXDB" has 2 instance(s).
Instance "idb1", status READY, has 1 handler(s) for this service...
Instance "idb2", status READY, has 1 handler(s) for this service...
Service "idb_XPT" has 2 instance(s).
Instance "idb1", status READY, has 2 handler(s) for this service...
Instance "idb2", status READY, has 1 handler(s) for this service...
The command completed successfully
4.目前已经通过清理监听log后恢复
$date > listener_idb1.log
$lsnrctl
lsnrctl> set log_status off
lsnrctl>set log_status on
5.在该服务器上测试:
$ls -l
-rw-r----- 1 oracle dba 316159841 Nov 16 2012 listener.log
-rw-r----- 1 oracle dba 4294967429 Apr 09 2012 listener_idb1.log
-rw-r----- 1 oracle dba 23625802 Aug 15 11:59 sqlnet.log
$cp listener.log listener.log.bak
$date >> listener.log.bak
$ls -l
-rw-r----- 1 oracle dba 316159841 Nov 16 2012 listener.log
-rw-r----- 1 oracle dba 4294967429 Apr 09 2012 listener_idb1.log
-rw-r----- 1 oracle dba 4294967460 Aug 15 14:51 listener_idb1.log.bak
-rw-r----- 1 oracle dba 23625802 Aug 15 14:51 sqlnet.log
$tail -5000 listener.log >> listener_idb1.log.bak
$ls -l listener_idb1.log.bak
-rw-r----- 1 oracle dba 4295901817 Aug 15 14:51 listener_idb1.log.bak
该测试说明OS上是没有4G 文件大小限制的。
6.在Linux RHEL 5.6_X64的虚拟机上模拟
现象相同,达到4294967350 bytes后 ,监听日志不再增长。
但是使用
cat file_size100m.log >> listener_lxc.log
可以扩展监听日志的大小。
$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 22-JUL-2013 14:55:02
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias listener_lxc
Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date 22-JUL-2013 13:15:10
Uptime 0 days 1 hr. 39 min. 51 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /opt/oracle/product/10.2.0/db_1/network/log/listener_lxc.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.100)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "lxc1024" has 1 instance(s).
Instance "lxc1024", status READY, has 1 handler(s) for this service...
Service "lxc1024XDB" has 1 instance(s).
Instance "lxc1024", status READY, has 1 handler(s) for this service...
Service "lxc1024_XPT" has 1 instance(s).
Instance "lxc1024", status READY, has 1 handler(s) for this service...
The command completed successfully
$ ls -l
total 8600540
-rw-r--r-- 1 oracle oinstall 103712508 Jul 22 13:10 listener2.log
-rw-r----- 1 oracle oinstall 961540 Jul 22 13:15 listener.log
-rw-r----- 1 oracle oinstall 4294967350 Jul 22 14:50 listener_lxc.log
--达到这个filesize后再建立后,日志不再记录
$ cat listener2.log >> listener_lxc.log
$ ls -l
total 8701928
-rw-r--r-- 1 oracle oinstall 103712508 Jul 22 13:10 listener2.log
-rw-r----- 1 oracle oinstall 961540 Jul 22 13:15 listener.log
-rw-r----- 1 oracle oinstall 4398679858 Jul 22 14:53 listener_lxc.log
7.开过SR,SR回复如下:
The limitation in the size of the listener log is done at OS level. Please contact your system administrator related to this matter.
In another point I recommend keeping the listener log under 2GB in order to avoid having listener hang issues.
In order to rotate or backup or rename listener.log or purge listener log data to avoid large listener.log file you should use one of the following procedures:
1)xxx
2)xxx
可是我明确告诉过SR,在OS levle上可以通过 cat fileA.log >> listener_idb1.log 的方式增长filesize,但是SR仍然说是OS level的限制。
8.
已经告诉客户以后通过脚本定期清除监听logfile 保持在2G以下.
但是当下希望能找到明确的文章/说法 解释4G的limit 是否真实存在在某些平台或者filesystem上。
能找到的相关网络上的讨论有:
https://forums.oracle.com/thread/923004
http://www.freelists.org/post/oracle-l/Listenerlog-not-been-updated
http://www.itpub.net/thread-1295502-1-1.html
在MOS文章OpenVMS: How to delete or refresh/recycle a SQL*Net Listener log file while the Listener is active. (文档 ID 739530.1)
中提到了4G的问题,但是不明确。
引用如下Background:
Over time, a listener log file will grow in size.
Left alone, it will grow to 2GB on OpenVMS (4GB on other platforms)
Once this file size has been reached, no additional records will be written to the log file.类似的BUG:
Bug 12744102 : WE FIND THAT SOME DB'S LISTENER.LOG CAN'T BE RECORD MORE THAN SIZE 4G
Bug 8273209 : LISTENER LOG DOESN'T EXPAND OVER 4GB 我不认为 10.2.0.4 上仍有该bug , 更倾向于 os 限制 谢谢刘大回复。
不知您指的OS限制可以通过何种手段来验证,或者排除。
经过测试,OS上可以 cat fileA.log >> listener_idb1.log,创建大于4294967429 bytes的 文件的。这能否排除OS限制呢?
热盼坛友测试解惑。 兄弟,遇到你类似的问题了:
11.2.0.3.6 RAC on AIX 6.1
:/tpsys/app/11.2.0.3/grid/network/log#ls -ltr
total 8884608
-rw-r----- 1 grid oinstall 4294967433 Aug 11 01:47 listener.log
-rw-r----- 1 grid oinstall 253359781 Sep 18 14:13 listener_scan1.log
发现很久没有更新了,其大小也是停留在4GB左右
但是listener状态正常,未影响到应用
处理后能正常写入了:
:/tpsys/app/11.2.0.3/grid/network/log$ls -ltr
total 495896
-rw-r----- 1 grid oinstall 253383033 Sep 18 14:35 listener_scan1.log
-rw-r----- 1 grid oinstall 2388 Sep 18 14:35 listener.log
你提到的MOS帖子看过,还看过以前2GB的OS限制,不过4GB又是怎么回事? 雪影舞剑 发表于 2013-9-18 14:47 static/image/common/back.gif
兄弟,遇到你类似的问题了:
11.2.0.3.6 RAC on AIX 6.1
:/tpsys/app/11.2.0.3/grid/network/ ...
http://www.itpub.net/thread-1295502-1-1.html
这个帖子里面有人回复测试,发现是因为调用函数的原因。 oradbguy 发表于 2013-11-10 19:49 static/image/common/back.gif
http://www.itpub.net/thread-1295502-1-1.html
这个帖子里面有人回复测试,发现是因为调用函数的原因。 ...
lfree版主威武,用strace跟踪来分析此问题
指出10g下使用的lseek函数导致此问题
而11g下使用的fcntl函数,没有此问题
不过我这个问题是在11g平台下发生的,跟该版主以及附近楼层的朋友分析的还是不同
页:
[1]