首页 » Cloud, ORACLE 9i-23ai » Oracle 12c R2 注意事项: 每个session自动创建一空trace file 包含 KSIPC

Oracle 12c R2 注意事项: 每个session自动创建一空trace file 包含 KSIPC

最近突然有一个oracle 12c R2环境的trace目录使用率暴涨,分析发现一天创建了几十万个trace,几乎是每个会话创建一个trace, 当前数据库也并未启用event。简单记录

# # sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Nov 4 15:26:16 2019
Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


USERNAME             INST_NAME            HOST_NAME                 SID   SERIAL#  VERSION    STARTED  SPID            OPID  CPID            SADDR            PADDR
-------------------- -------------------- ------------------------- ----- -------- ---------- -------- --------------- ----- --------------- ---------------- ----------------
SYS                  anbob-anbob1       weejar1                   355   47536    12.2.0.1.0 20190910 47203           249   47201           00000005A22602C0 00000005E20E44A0


SQL> select * from v$diag_info;

   INST_ID NAME                          VALUE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                CON_ID
---------- ----------------------------- -----------------------------------------------------------------------------
         1 Diag Enabled                  TRUE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      0
         1 ADR Base                      /oracle/app/oracle                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        0
         1 ADR Home                      /oracle/app/oracle/diag/rdbms/anbob/anbob1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              0
         1 Diag Trace                    /oracle/app/oracle/diag/rdbms/anbob/anbob1/trace                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        0
         1 Diag Alert                    /oracle/app/oracle/diag/rdbms/anbob/anbob1/alert                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        0
         1 Diag Incident                 /oracle/app/oracle/diag/rdbms/anbob/anbob1/incident                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     0
         1 Diag Cdump                    /oracle/app/oracle/diag/rdbms/anbob/anbob1/cdump                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        0
         1 Health Monitor                /oracle/app/oracle/diag/rdbms/anbob/anbob1/hm                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           0
         1 Default Trace File            /oracle/app/oracle/diag/rdbms/anbob/anbob1/trace/anbob1_ora_47203.trc                                                                                                                                                                                                                                                                                                                                                                                                                                                                  0
         1 Active Problem Count          0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         0
         1 Active Incident Count         0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         0

11 rows selected.

SQL> host
# vi /oracle/app/oracle/diag/rdbms/anbob/anbob1/trace/anbob1_ora_47203.trc
Trace file /oracle/app/oracle/diag/rdbms/anbob/anbob1/trace/anbob1_ora_47203.trc
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Build label:    RDBMS_12.2.0.1.0_LINUX.X64_170125
ORACLE_HOME:    /oracle/app/oracle/product/12.2.0/db_1
System name:    Linux
Node name:      weejar1
Release:        4.4.21-69-default
Version:        #1 SMP Tue Oct 25 10:58:20 UTC 2016 (9464f67)
Machine:        x86_64
Instance name: anbob1
Redo thread mounted by this instance: 1
Oracle process number: 249
Unix process pid: 47203, image: oracle@weejar1 (TNS V1-V3)


*** 2019-11-04T15:26:16.967435+08:00
*** CLIENT ID:() 2019-11-04T15:26:16.967480+08:00
*** SERVICE NAME:() 2019-11-04T15:26:16.967486+08:00
*** MODULE NAME:() 2019-11-04T15:26:16.967491+08:00
*** ACTION NAME:() 2019-11-04T15:26:16.967496+08:00
*** CLIENT DRIVER:() 2019-11-04T15:26:16.967501+08:00

KSIPC: KSIPC: Unable to attach to ipcor topo svc object
~             

# cd /oracle/app/oracle/diag/rdbms/anbob/anbob1/trace

# ls -l|grep   "^-" |awk '{print $6$7 " " $5 }'|sort|awk ' { 
>  arr[$1]+=$2 
>  freq[$1]++
>  } 
>  END{
> printf "%20s\t%20s\t%20s\n" ,"date" , "size" , "num_file"
> printf "%20s\t%20s\t%20s\n" ,"----------------------" , "--------------------" , "-------------------"
>  for (key in arr) 
>  printf "%20s\t%20s\t%20s\n", key, arr[key] ,freq[key] 
>  }' 
                date                    size                num_file
----------------------  --------------------     -------------------
               Oct14                   10291                       3
               Oct15                15867899                    9364
               Oct16                44671620                   17800
               Oct17              1583739055                   28698
               Oct18             24193508779                  160892
			   
                                           

解决方法:

这是用户登录时遇到的IPC错误, 生成了不需要的trace文件,该错误不影响性能和使用, 可以直接删除,通常重启实例可以解决。

打赏

对不起,这篇文章暂时关闭评论。