日期:2014-05-16  浏览次数:20476 次

使用lock_sga和pre_page_sga参数保证SGA常驻物理内存 .

Lock_sga

LOCK_SGA locks the entire SGA into physical memory. It is usually advisable to lock

the SGA into real (physical) memory, especially if the use of virtual memory would

include storing some of the SGA using disk space. This parameter is ignored on

platforms that do not support it.

Property

Description

Parameter type

Boolean

Default value

false

Modifiable

No

Range of values

true | false

Basic

No

PRE_PAGE_SGA

PRE_PAGE_SGA determines whether Oracle reads the entire SGA into memory at

instance startup. Operating system page table entries are then prebuilt for each page of the SGA. This setting can increase the amount of time necessary for instance startup,

but it is likely to decrease the amount of time necessary for Oracle to reach its full

performance capacity after startup.

PRE_PAGE_SGA can increase the process startup duration, because every process that

starts must access every page in the SGA. The cost of this strategy is fixed; however,

you might simply determine that 20,000 pages must be touched every time a process

starts. This approach can be useful with some applications, but not with all

applications. Overhead can be significant if your system frequently creates and

destroys processes by, for example, continually logging on and logging off.

The advantage that PRE_PAGE_SGA can afford depends on page size. For example, if

the SGA is 80 MB in size and the page size is 4 KB, then 20,000 pages must be touched

to refresh the SGA (80,000/4 = 20,000).

If the system permits you to set a 4 MB page size, then only 20 pages must be touched

to refresh the SGA (80,000/4,000 = 20). The page size is operating system-specific and

generally cannot be changed. Some operating systems, however, have a special

implementation for shared memory whereby you can change the page size.

 

通过修改lock_sga和pre_page_sga参数可以保证SGA不被换出到虚拟内存,进而可以提高SGA的使用效率。

当lock_sga参数设置为TRUE时(默认值是FALSE),可以保证整个SGA被锁定在物理内存中,这样可以防止SGA被换出到虚拟内存。只要设置lock_sga为“TRUE”便可保证SGA被锁定在物理内存中,这里之所以顺便将pre_page_sga参数也设置为“TRUE”,是因为这样可以保证在启动数据库时把整个SGA读入到物理内存中,以便提高系统的效率(虽然会增加系统的启动时间)。

AIX 5L