一台数据库服务器报 cpu loader 过高,查看当前等待事件,发现对应sql:
/* SQL Analyze(1) */
select /*+ full(t) parallel(t,64) parallel_index(t,64) dbms_stats cursor_sharing_exact use_weak_name_resl dynamic_sampling(0) no_monitoring no_substrb_pad */
to_char(count("ID")),
这是收集表统计信息的sql ,并发 64 ,有点过高
查看表的并发度 为default
10:32:41 sys@Q9JSHS>select TABLE_NAME,DEGREE from dba_tables where table_name='GE_BALANCE_DETAIL';
TABLE_NAME DEGREE
------------------------------ --------------------
GE_BALANCE_DETAIL DEFAULT
12:56:14 sys@Q9JSHS>show parameter parallel_threads_per_cpu
NAME TYPE VALUE
------------------------------------