Linux ·

Oracle 每隔5分钟产生2个clsc*.log文件

环境:

OS:HP-UNIX

数据库:11.2.0.4  双机RAC

(一)现象

在清理Oracle日志的时候,发现在$ORACLE_HOME/log/{instance_id}/client下面存在大量的clsc*.log。经过观察,发现每隔5分钟产生2个日志,具体如下:

...
-rw-r--r-- 1 oracle oinstall 244 Sep 25 15:55 clsc34691.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 15:55 clsc34692.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:00 clsc34693.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:00 clsc34694.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:05 clsc34695.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:05 clsc34696.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:10 clsc34697.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:10 clsc34698.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:15 clsc34699.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:15 clsc34700.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:20 clsc34701.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:25 clsc34702.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:30 clsc34703.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:35 clsc34704.log
-rw-r--r-- 1 oracle oinstall 244 Sep 25 16:40 clsc34705.log
...

查看日志数量,发现已经有很多了

fabdb1$[/grid/11.2.0/grid/log/fabdb1/client]ll |wc -l
34709

(二)原因

发现这是Oracle在11.2中的bug,在开启Oracle EM的情况下,EM会每隔5分钟使用crs_stat去收集Oracle服务的状态,导致日志的产生。

(三)解决方案

以oracle用户登录,到目录下:

$ORACLE_HOME/sysman/admin/scripts/

修改2个文件:
①  vim crs_resources.pl

# 找到这一行:
my cmd = "crs_home/bin/crs_stat";
# 修改为:
my cmd = "crs_home/bin/crsctl stat res";

② vim crs_vip.pl

# 找到这一行:
my cmd = "crs_home/bin/crs_stat";
# 修改为:
my cmd = "crs_home/bin/crsctl stat res";

重启EM

emctl stop dbconsole
emctl start dbconsole

su - grid

cd $ORACLE_HOME/log/{instance_name}/client
ls -lrt --持续监控半小时,检查是否有规律产生日志文件。

参与评论