内存结构
Oracle必须创建自己的内存结构来完成相应的工作。例如,分配一块内存来保存执行程序的代码,可以提高系统的运行效率;分配一块内存,保存几个用户共享的数据 。Oracle 有两个基本的内存结构: 分别是(system global area),包括, redo log buffers, 以及shared pool ;另一个是程序全局区PGA(program global areas)。下面详细地介绍每种内存结构。
SGA
一个A system global area (SGA) 是由内存中若干个shared memory structures 组成,它包含了一个Oracle database instance的数据和控制信息。
如果多个用户同时连接同一个instance, 那么这个instance的SGA中的数据是由所有的用户共享。 这也就是SGA被称为shared global area的原因。
一个SGA 和Oracle processes组成了一个Oracle instance。当用户启动一个instance 时,Oracle自动地为SGA分配内存。而当用户关闭这一个instance时,操作系统又会回收(reclaims)这块内存。
SGA是可以读写的。所有和同一个multiple-process database instance 连接的用户都需要读取这个instance的SGA中的数据,and several processes write to the SGA during execution of Oracle.
SGA 包含下列几个的缓冲器::
data dictionary cache (Also known as the row cache, because it holds data as rows instead of
buffers)
Other miscellaneous information
SGA中有一部分内容包含了database和instance的状态信息,这些信息是background processes需要存取的; 这被称作fixed SGA。这里没有包含用户信息。SGA also includes information communicated between processes, such as locking information.
如果用户采用multi-threaded server architecture, 则请求和响应队列,以及一些PGA中的内容也保存在SGA中。