oracle_memory_management
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| oracle_memory_management [2018/12/08 12:49] – created 0.0.0.0 | oracle_memory_management [2020/10/22 10:13] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Oracle_Memory_Management ====== | ||
| - | |||
| Options are: | Options are: | ||
| - | * Leave it completely up to the database | + | * Leave it completely up to the database |
| - | then just set memory_max_size and memory_target | + | then just set memory_max_size and memory_target |
| - | * Set minimum values for some components | + | This allows the database to manipulate both sga and pga as it feels necessary. Latest recommendation is to use this only if the total amount of memory available for the database is less than 4G. |
| - | then set values for pga_aggregate_target | + | * Set maximum values for SGA and PGA (ASMM) |
| - | * Set maximum values for some components | + | then just set sga_max_size |
| - | then set values for things like sga_max_size | + | |
| - | ====Handy views to look at==== | + | |
| - | < | + | |
| - | < | + | Set pga_aggregate_target and eventually ringfence it with pga_aggregate_limit. |
| + | |||
| + | Setting any of the pool sizes means this value become a minimum. | ||
| + | |||
| + | ==== Queries for the sga ==== | ||
| + | < | ||
| + | select * from v$sga; | ||
| + | |||
| + | select sum(value) from v$sga; | ||
| + | |||
| + | select sum(bytes) from v$sgastat; | ||
| + | |||
| + | select sum(current_size) from v$sga_dynamic_components; | ||
| + | |||
| + | select * from v$sga_dynamic_free_memory; | ||
| + | |||
| + | select component, current_size from v$sga_dynamic_components; | ||
| + | |||
| + | select pool, sum(bytes)/ | ||
| + | |||
| + | alter system flush buffer_cache; | ||
| + | |||
| + | alter system flush shared_pool; | ||
| + | |||
| + | select | ||
| + | component, | ||
| + | oper_type, | ||
| + | oper_mode, | ||
| + | initial_size/ | ||
| + | TARGET_SIZE/ | ||
| + | FINAL_SIZE/ | ||
| + | status | ||
| + | from | ||
| + | v$sga_resize_ops order by component; | ||
| + | |||
| + | select | ||
| + | component, | ||
| + | current_size/ | ||
| + | min_size/ | ||
| + | user_specified_size/ | ||
| + | last_oper_type " | ||
| + | from | ||
| + | v$sga_dynamic_components order by component; | ||
| + | |||
| + | select * from v$sgainfo where name = ' | ||
| + | </ | ||
| + | ==== Show PGA Memory Allocation/ | ||
| + | < | ||
| + | SET PAGESIZE 60 | ||
| + | SET LINESIZE 300 | ||
| + | |||
| + | COLUMN username FORMAT A20 | ||
| + | COLUMN module FORMAT A50 | ||
| + | COLUMN program FORMAT A50 | ||
| + | |||
| + | SELECT NVL(a.username,' | ||
| + | | ||
| + | | ||
| + | | ||
| + | FROM | ||
| + | | ||
| + | | ||
| + | WHERE a.sid = b.sid | ||
| + | AND b.statistic# | ||
| + | AND c.name = ' | ||
| + | AND a.program IS NOT NULL | ||
| + | ORDER BY b.value DESC | ||
| + | / | ||
| + | </ | ||
| + | === Handy views to look at === | ||
| + | < | ||
| + | V$SGAINFO | ||
| + | V$SGASTAT | ||
| + | V$SGA_DYNAMIC_COMPONENTS | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | col name for a40 | ||
| + | select * from v$sgainfo | ||
| + | </ | ||
| produces something like this... | produces something like this... | ||
| - | < | + | < |
| + | NAME BYTES RESIZEABLE | ||
| + | ---------------------------------------- ---------- ------------ | ||
| + | Fixed SGA Size 2163592 No | ||
| + | Redo Buffers | ||
| + | Buffer Cache Size 1493172224 Yes | ||
| + | Shared Pool Size | ||
| + | Large Pool Size 16777216 Yes | ||
| + | Java Pool Size | ||
| + | Streams Pool Size 16777216 Yes | ||
| + | Shared IO Pool Size 0 Yes | ||
| + | Granule Size | ||
| + | Maximum SGA Size | ||
| + | Startup overhead in Shared Pool | ||
| + | Free SGA Memory Available | ||
| + | |||
| + | 12 rows selected. | ||
| + | </ | ||
| or | or | ||
| - | < | + | < |
| + | select name, (bytes/1024/1024) megs, | ||
| - | ====How memory is used (assuming conventional path reads - not direct path and dedicated server)==== | + | NAME MEGS RESIZEABLE |
| - | A user runs a query which either finds the blocks it needs already in the SGA or fetches the blocks< | + | ----------------------------------- ---------- ------------ |
| - | needed from disk into the SGA.<br /> | + | Fixed SGA Size |
| - | The desired rows/data is taken from those blocks in the SGA and pulled over to the PGA for sorting and/or grouping.<br /> | + | Redo Buffers |
| - | If more than a " | + | Buffer Cache Size 4608 Yes |
| + | Shared Pool Size 18432 Yes | ||
| + | Large Pool Size 512 Yes | ||
| + | Java Pool Size 512 Yes | ||
| + | Streams Pool Size 1024 Yes | ||
| + | Shared IO Pool Size 0 Yes | ||
| + | Granule Size 512 No | ||
| + | Maximum | ||
| + | Startup overhead in Shared Pool 4617.96307 No | ||
| + | Free SGA Memory Available | ||
| - | ====References==== | + | 12 rows selected. |
| + | </ | ||
| + | |||
| + | === How memory is used (assuming conventional path reads - not direct path and dedicated server) | ||
| + | A user runs a query which either finds the blocks it needs already in the SGA or fetches the blocks\\ | ||
| + | needed from disk into the SGA.\\ | ||
| + | The desired rows/data is taken from those blocks in the SGA and pulled over to the PGA for sorting and/or grouping.\\ | ||
| + | If more than a " | ||
| + | |||
| + | === References | ||
| [[http:// | [[http:// | ||
| + | |||
| + | |||
oracle_memory_management.1544273361.txt.gz · Last modified: 2018/12/08 12:49 by 0.0.0.0
