oracle的常规优化?oracle在SUN上的常规有话都需要哪些方面?内存怎么配置?

oracle在SUN上的常规有话都需要哪些方面?内存怎么配置?
---------------------------------------------------------------

ORACLE SGA 的分配

SGA=((db_block_buffers * block size)+(shared_pool_size+large_pool_size+log_buffers)+1MB

ORACLE 8.1.X 版本

SGA=((db_block_buffers * block size)+(shared_pool_size+large_pool_size+java_pool_size+log_buffers)+1MB

理论上SGA可占OS系统物理内存的1/2——1/3,我们可以根据需求调整

我推荐SGA=0.45*(OS RAM)

假设服务器运行ORACLE 8.1.X 版本, OS系统内存为2G MEM, db_block_size 是8192 bytes,
除了运行ORACLE数据库外, 没有其它的应用程序或服务器软件.

这样SGA合计约为921M ( 0.45*2048M ),

设shared_pool_size 300M (30010241024 bytes)

设database buffer cache 570M (72960*8192 bytes)

initorasid.ora文件里具体各参数如下:

shared_pool_size = 314572800

300 M

db_block_buffers = 72960

570 M

log_buffer = 524288

512k (128K*CPU个数)

large_pool_size = 31457280

30 M

java_pool_size = 20971520

20 M

sort_area_size = 524288

512k (65k--2M)

sort_area_retained_size = 524288

MTS 时 sort_area_retained_size = sort_area_size

SUN Solaris里/etc/system文件里的几个参数同样跟内存分配有关

ORACLE安装时缺省的设置: 建议修改的设置:
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=15
set semsys:seminfo_semmns=200
set semsys:seminfo_semmni=70
set ulimit=3000000
set semsys:seminfo_semmni=315
set semsys:seminfo_semmsl=300
set semsys:seminfo_semmns=630
set semsys:seminfo_semopm=315
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmni=315
set shmsys:shminfo_shmseg=10
set shmsys:shminfo_shmmin=1

其中这些参数的含义

shmmax - 共享内存段,建议设大点, 达到最大SGA
shmmin - 最小的共享内存段.
shmmni - 共享内存标志符的数量.
shmseg - 一个进程可分配的最大内存段数.
shmall - 最大可允许的内存数,比SGA还要大.
semmns - 信号灯,跟ORACLE的PROCESS数有关.
semmsl - 一个信号灯中最大的信号灯数.
---------------------------------------------------------------

你用的是9I吧,可以用两中方法使你的参数修改生效
1.alter system
Using ALTER SYSTEM to Change Initialization Parameter Values
The ALTER SYSTEM statement allows you to set, change, or delete (restore to default value) initialization parameter values. When the ALTER SYSTEM statement is used to alter a parameter setting in a traditional initialization parameter file, the change affects only the current instance, since there is no mechanism for automatically updating initialization parameters on disk. They must be manually updated in order to be passed to a future instance. Using a server parameter file overcomes this limitation.

Setting or Changing Initialization Parameter Values
Use the SET clause of the ALTER SYSTEM statement to set or change initialization parameter values. Additionally, the SCOPE clause specifies the scope of a change as described in the following table:

SCOPE Clause Description
SCOPE = SPFILE
The change is applied in the server parameter file only. The effect is as follows:

For dynamic parameters, the change is effective at the next startup and is persistent.
For static parameters, the behavior is the same as for dynamic parameters. This is the only SCOPE specification allowed for static parameters.

SCOPE = MEMORY
The change is applied in memory only. The effect is as follows:

For dynamic parameters, the effect is immediate, but it is not persistent because the server parameter file is not updated.
For static parameters, this specification is not allowed.

SCOPE = BOTH
The change is applied in both the server parameter file and memory. The effect is as follows:

For dynamic parameters, the effect is immediate and persistent.
For static parameters, this specification is not allowed.

2.用create pfile 命令从initoral.ora文件生成新的spfile

CREATE SPFILE='/u01/oracle/dbs/test_spfile.ora'
FROM PFILE='/u01/oracle/dbs/test_init.ora';

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus