PGA
OracleÀÇ Memory±¸¼º
SGA´Â °ø¿ë ¸Þ¸ð¸®À̰í
PGA´Â °³ÀÎ ¸Þ¸ð¸®ÀÌ´Ù. PGA´Â sort°ø°£, sessionÁ¤º¸, cursor»óÅÂ, º¯¼ö(stack)°ø°£À¸·Î ±¸¼ºµÇ°í disk IO¸¦ ÁÙÀ̱â À§ÇØ sort °ø°£ÀÇ °ü¸®°¡ ÇÊ¿äÇÏ´Ù.
AMM(Automatic
Shared memory Management)
Oracle
11g ºÎÅÍ
SGA¿Í PGAÀÇ ¸Þ¸ð¸®ÀÇ Å©±â¸¦ Oracle
DBMS°¡ ÀüÀûÀ¸·Î °ü¸®ÇÏ´Â ±â´ÉÀ¸·Î »ç¿ëÀÚ´Â total ¸Þ¸ð¸® »çÀÌÁ ÁöÁ¤Çϸé DBMS°¡ DynamicÇϰÔÀ¸·Î SGA ¿ÍPGAÀÇ Å©±â¸¦ Á¶Á¤ÇÏ°Ô µÈ´Ù. ÀÌ ±â´É¿¡¼ ¿À¶óŬÀº SGA ¿Í PGA ÀÇ °³º° ±¸¼º ¿µ¿ªÀÇ »çÀÌÁîµµ µ¿ÀûÀ¸·Î °ü¸®ÇÏ°Ô µÈ´Ù.
°ü·ÃµÈ Parameter´Â
-
MEMORY_MAX_TAGER :
memoryÀÇ ÃÖ´ësizeÁ¤ÀÇ
- MEMORY_TARGET : SGA+PGA size ÁöÁ¤ (ÀÌ ¹üÀ§ ³»¿¡¼ ÀÚµ¿À¸·Î Á¶ÀýµÈ´Ù), ¡°0¡±À¸·Î ÇÏ¸é »ç¿ëÇÏÁö ¾Ê´Â °ÍÀ¸·Î °£ÁÖ
±×¸®°í SGA_TARGET, PGA_AGGREGATE_TARGET´Â ¡°0¡±À¸·Î ÇÏ´Â °ÍÀÌ ÁÁ´Ù.
SQL> ALTER SYSTEM SET memory_max_target=32g
SCOPE=SPFILE;
SQL> ALTER SYSTEM SET memory_target=32g SCOPE=SPFILE;
SQL> ALTER SYSTEM SET sga_target=0 SCOPE=SPFILE;
SQL> ALTER SYSTEM SET pga_aggregate_target=0 SCOPE=SPFILE;
PGA
Parameter
1. WORKAREA_SIZE_POLICY : ÀÚµ¿À¸·Î°ü¸® ¼³Á¤ AUTO/MENUAL
2. SORT_AREA_SIZE : sort°ø°£ size - Menual ¼³Á¤½Ã »ç¿ë
3. PGA_AGGREGATE_TARGET : WORKAREA_SIZE_POLICY¸¦ AUTO¼³Á¤½Ã »ç¿ëÀÚ Àüü°¡ ¼³Á¤µÈ size³»¿¡¼ ÀÚµ¿À¸·Î °ü¸®
- »ç¿ëÀÚ°¡ ¸¹°í sort°¡ ¸¹´Ù¸é À̰ÍÀ» ´Ã·ÁÁÖ¾î¾ß ÇÔ
- default·Î 10M ¶Ç´Â SGAÀÇ 20%Áß Å«°ÍÀ¸·Î ¼³Á¤µÊ
PGA_AGGREGATE_TARGET ¿¡
Å©±â¸¦ ÁÖ°í WORKAREA_SIZE_POLICY=auto·Î Çϸé
SORT_AREA_SIZE ´Â ¹«ÀǹÌÇØÁö°í PGA_AGGREGATE_TARGET ¿¡
¼³Á¤µÈ size ³»¿¡¼ ¿©·¯ session¿¡°Ô ¸Þ¸ð¸®¸¦ ³ª´©¾î
ÁÖ¾î sortÇϴµ¥ »ç¿ëÅä·Ï ÇÕ´Ï´Ù.
Oracle
memoryÁß pga_aggregate_target´Â shared pool¿¡¼ °¡Á®¿À´Â °ÍÀÌ ¾Æ´Ï°í OSÀÇ memory¿¡¼ °¡Á® ¿É´Ï´Ù. µû¶ó¼ OracleÀÇ memory size´Â SGA + PGA ÀÔ´Ï´Ù.
ÇöÀç »ç¿ëÁßÀÎ PGAÈ®ÀÎ
SQL> select pga_used_mem, pga_alloc_mem, pga_max_mem from v$process;
1. pga_used_mem : ÇöÀç »ç¿ëÁßÀÎ pga
2. pga_alloc_mem : Ȱ´çµÈ pga
3. pga_max_mem : »ç¿ëÇÑ ÃÖ´ë pga
PGA size º¯°æ
SQL> alter system set pga_aggregate_target = 1000M;
New Oracle views for automatic PGA
RAM memory management
Oracle has introduced several new views and new columns in existing views to aid in viewing the internal allocation of RAM memory in Oracle. The following new v$ views can be used to monitor RAM memory usage of dedicated Oracle connections.
v$process |
Three new columns are added in Oracle for monitoring PGA memory usage. The new columns are called pga_used_mem, pga_alloc_mem and pga_max_mem. |
v$sysstat |
There are many new statistics rows, including work area statistics for optimal, one-pass and multi-pass. |
v$pgastat |
This new view shows internals of PGA memory usage for all background processes and dedicated connections. |
v$sql_plan |
This exciting new view contains execution plan information for all currently executing SQL. This is a tremendous tool for the performance tuning processional who must locate sub-optimal |
v$workarea |
This new view provides detailed cumulative statistics on Ram memory usage for Oracle connections. |
v$workarea_active |
This new view show internal RAM memory usage information for all currently executing SQL statements. |