Oracle 10g 库启动的SGA大小由sga_target与sga_max_size决定,分下面三种情况讨论
sga_target=sga_max_size
参数文件指定值
*.sga_target=599785472
启动
SQL> startupORACLE instance started.Total System Global Area 599785472 bytesFixed SizeSize171967256 bytesDatabase Buffers423624704 bytesRedo Buffers2170880 bytesDatabase mounted.Database opened.
sga_target < sga_max_size 参数文件指定值
*.sga_max_size=800m*.sga_target=700m
启动数据库
SQL> startupORACLE instance started.Total System Global Area 838860800 bytesFixed SizeSize297798608 bytesDatabase Buffers536870912 bytesRedo Buffers2166784 bytesDatabase mounted.Database opened.SQL> select 838860800/1024/1024 from dual;838860800/1024/1024——————-800SQL> show parameter sga_NAMETYPEVALUE——————- ———– ———————–sga_max_sizebig integer 800Msga_targetbig integer 700M
sga_target>sga_max_size
参数文件指定值
*.sga_max_size=600m*.sga_target=700m
而数据库实际启动的大小
SQL> startupORACLE instance started.Total System Global Area 734003200 bytesFixed SizeSize192941848 bytesDatabase Buffers536870912 bytesRedo Buffers2166784 bytesDatabase mounted.Database opened.SQL> select 734003200/1024/1024 from dual;734003200/1024/1024——————-700SQL> show parameter sga_NAMETYPE VALUE———————————— ———– ——————————sga_max_sizebig integer 700Msga_targetbig integer 700M
实验结论 由以上三个实验可以看到,数据库启动时SGA的大小由SGA_TARGET和SGA_MAX_SIZE中的较大值决定
当SGA_TARGET <= SGA_MAX_SIZE时,,以SGA_MAX_SIZE为准 当SGA_TARGET > SGA_MAX_SIZE时,将SGA_TARGET的值赋予SGA_MAX_SIZE,然后以SGA_MAX_SIZE为准
每一个成功者都有一个开始。勇于开始,才能找到成功的路。