この項の計算式はあくまで開始値を設定するためのものです。自動チューニングと手動チューニングのどちらを使用するにしても、実行時の使用状況を監視して、メモリーのサイズが大きすぎないか、小さすぎないかを確認する必要があります。正しいメモリー・サイズを確認するため、次の問合せを使用して共有プールをチューニングします。
SELECT POOL, NAME, SUM(BYTES) FROM V$SGASTAT WHERE POOL LIKE '%pool%' GROUP BY ROLLUP (POOL, NAME);
出力は次のようになります。
POOL NAME SUM(BYTES)
----------- -------------------------- ----------
shared pool Checkpoint queue 38496
shared pool KGFF heap 1964
shared pool KGK heap 4372
shared pool KQLS heap 1134432
shared pool LRMPD SGA Table 23856
shared pool PLS non-lib hp 2096
shared pool PX subheap 186828
shared pool SYSTEM PARAMETERS 55756
shared pool State objects 3907808
shared pool character set memory 30260
shared pool db_block_buffers 200000
shared pool db_block_hash_buckets 33132
shared pool db_files 122984
shared pool db_handles 52416
shared pool dictionary cache 198216
shared pool dlm shared memory 5387924
shared pool event statistics per sess 264768
shared pool fixed allocation callback 1376
shared pool free memory 26329104
shared pool gc_* 64000
shared pool latch nowait fails or sle 34944
shared pool library cache 2176808
shared pool log_buffer 24576
shared pool log_checkpoint_timeout 24700
shared pool long op statistics array 30240
shared pool message pool freequeue 116232
shared pool miscellaneous 267624
shared pool processes 76896
shared pool session param values 41424
shared pool sessions 170016
shared pool sql area 9549116
shared pool table columns 148104
shared pool trace_buffers_per_process 1476320
shared pool transactions 18480
shared pool trigger inform 24684
shared pool 52248968
90641768
出力に表示されたメモリー使用量を評価し、処理ニーズに基づいてSHARED_POOL_SIZEの設定を変更します。
メモリー使用量の統計をさらに取得するには、次の問合せを実行します。
SELECT * FROM V$PX_PROCESS_SYSSTAT WHERE STATISTIC LIKE 'Buffers%';
出力は次のようになります。
STATISTIC VALUE ------------------- ----- Buffers Allocated 23225 Buffers Freed 23225 Buffers Current 0 Buffers HWM 3620
使用されたメモリー容量は、Buffers CurrentとBuffers HWMの統計に表示されます。バッファ数にPARALLEL_EXECUTION_MESSAGE_SIZEの値を掛けた値(バイト数)を計算します。この最高水位標をパラレル実行メッセージ・プール・サイズと比較して、割当てメモリーが多すぎないかを判別します。たとえば、最初の出力で、px msg poolに示されるラージ・プールの値は38,092,812すなわち38MBです。2番目の出力のBuffers HWMは3,620です。これにパラレル実行メッセージ・サイズの4,096を掛けると、14,827,520すなわち約15MBになります。この場合、最高水位標は容量の約40パーセントに達しています。