The SGA_MAX_SIZE Initialization Parameter (72)

tsinglee發表於2007-10-23

The SGA comprises a number of memory components, which are pools of memory
used to satisfy a particular class of memory allocation requests. Examples of memory
components include the shared pool (used to allocate memory for SQL and PL/SQL
execution), the java pool (used for java objects and other java execution memory), and
the buffer cache (used for caching disk blocks). All SGA components allocate and
deallocate space in units of granules. Oracle Database tracks SGA memory use in
internal numbers of granules for each SGA component.
Granule size is determined by total SGA size. On most platforms, the size of a granule
is 4 MB if the total SGA size is less than 1 GB, and granule size is 16MB for larger
SGAs. Some platform dependencies arise. For example, on 32-bit Windows, the
granule size is 8M for SGAs larger than 1 GB.
Oracle Database can set limits on how much virtual memory the database uses for the
SGA. It can start instances with minimal memory and allow the instance to use more
memory by expanding the memory allocated for SGA components, up to a maximum
determined by the SGA_MAX_SIZE initialization parameter. If the value for SGA_MAX_
SIZE in the initialization parameter file or server parameter file (SPFILE) is less than
the sum the memory allocated for all components, either explicitly in the parameter
file or by default, at the time the instance is initialized, then the database ignores the
setting for SGA_MAX_SIZE.
For optimal performance in most systems, the entire SGA should fit in real memory. If
it does not, and if virtual memory is used to store parts of it, then overall database
system performance can decrease dramatically. The reason for this is that portions of
the SGA are paged (written to and read from disk) by the operating system. The
amount of memory dedicated to all shared areas in the SGA also has performance impact.
The size of the SGA is determined by several initialization parameters. The following
parameters have the greatest effect on SGA size:
DB_CACHE_SIZE :The size of the cache of standard blocks.
LOG_BUFFER :The number of bytes allocated for the redo log buffer.
SHARED_POOL_SIZE :The size in bytes of the area devoted to shared SQL and
PL/SQL statements.
LARGE_POOL_SIZE :The size of the large pool; the default is 0.
JAVA_POOL_SIZE :The size of the Java pool.

1. 所有的sga元件都是以細粒度來作為單位分配和回收的 。
2. 細粒度的大小是有總的sga大小決定的 , 在大多數平臺下 ,如果sga小於1G , 則細粒度大小為4M ,
對於更大的sga , 細粒度大小為16M , 有些平臺是有依賴關係的 ,在32位windows平臺下 , 如果
sga大於1G , 細粒度大小為8M.
3. Oracle資料庫可設定使用的虛擬記憶體的限制 , 在例項啟動時 , 使用最小的記憶體 , 並且允許例項
為sga元件分配更多的記憶體直到達到SGA_MAX_SIZE引數設定的值 .
理想的情況是 , sga應該適合實存 , 否則會發生頁交換影響效能 。
4. 對sga有很大影響的引數
DB_CACHE_SIZE : 標準塊的快取記憶體大小
LOG_BUFFER : 重做日誌快取大小

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-978123/,如需轉載,請註明出處,否則將追究法律責任。

相關文章