進行hanganalyze文件問題收集,懷疑是並行出現了問題
這裏的通過sql_id看不到全部的sql_text,也是個問題,這個先解決首要問題,所以先忽略
|
我們發現cpu使用率很高,再通過hanganalyze文件分析並行,我們進一步查看數據庫並行的情況,parallel_max_servers
關於parallel_max_servers這個參數值的設置
th 11.2.0.2 there is a new method to compute the default for PARALLEL_MAX_SERVERS.
In the Oracle Rdbms Reference Guide we find:
parallel_max_servers = PARALLEL_THREADS_PER_CPU * CPU_COUNT * concurrent_parallel_users * 5
In the formula, the value assigned to concurrent_parallel_users running at the default degree of parallelism on an
instance is dependent on the memory management setting.
- If automatic memory management is disabled (manual mode), then the value of concurrent_parallel_users is 1.
- If PGA automatic memory management is enabled, then the value of concurrent_parallel_users is 2.
- If global memory management or SGA memory target is used in addition to PGA automatic memory management,
then the value of concurrent_parallel_users is 4.
The value is capped by processes -15 (this is true for versions prior 11.2.0.2 as well).
As example we have the following values
parallel_threads_per_cpu = 2
cpu_count = 4
pga_aggregate_target = 500M
sga_target = 900M
processes = 150
parallel_max_servers = 2 * 4 * 4 * 5 = 160
parallel_max_servers = min( 150-15 , 160 ) = 135
So with these values we get a default of 135 for parallel_max_servers.
Note if the parallel_max_servers is reduced due to value of processes, then you see similar to the following in alert log (e.g. at instance start up):
Mon May 06 18:43:06 2013
Adjusting the default value of parameter parallel_max_servers
SQL> show parameter cpu
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cpu_count integer 60
parallel_threads_per_cpu integer 2
resource_manager_cpu_allocation integer 60
而操作系統上的邏輯cpu爲72,這裏是oracle使用cpu的個數,沒有全部分配給oracle使用,這裏有個疑問
[root@wtyzcdb23 ~]# grep processor /proc/cpuinfo | wc -l
72
數據庫使用的不是自動內存管理(AMM)
PGA內存自動管理
而根據之前的parallel_max_servers的設置方法計算:
Parallel_max_servers=2*60*5*4=2400
Bug 13743987 - A high CPU_COUNT can cause ORA-68 for parallel_max_servers (Doc ID 13743987.8)
目前parallel_max_servers參考統一支撐1庫,設置爲400
將_cursor_obsolete_threshold從1024調整爲200設置需要重啓生效