操作系统版本:CentOS-5.6 X86-64
cpu:2*12
内存:16M
数据库版本:10.2.0.4
节点数:2
1、恢复上面的两个值到默认状态
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
2、是新的内核生效
[root@10-208 cron]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
[root@10-208 cron]#
3、修改sga
修改之前先说一下针对不同类型(oltp、dss)数据库sga和pga分配的不同点
oltp:sga=总内存*80%*80%
pga=总内存*80%*20%
dss:sga=总内存*80%*50%
sga=总内存*80%*50%
个人理解:对于oltp数据库来说,数据量不大,并发较多,希望数据最好大部分在内存里,所以sga分配较大。而oltp数据库一般来说数据库排序不是非常的大,所以没有必要分配太大的内存。
对于dss系统来说数据量一般非常的大,把数据库全部放到内存里面不现实,而大数据量的排序一般来说会很多,所以要安装如上分配。
我这里是oltp系统,所有内存分配如下
sga=16G*80%*80%=10.24G,我这里给了10G
pga=16G*80%*20%=2.56G,我这里给了2G
1)修改第一个节点:
alter system set sga_max_size=10G scope=spfile sid='jscn1'; alter system set sga_target=10G scope=spfile sid='jscn1'; shutdown immediate startup
alter system set sga_max_size=10G scope=spfile sid='jscn2'; alter system set sga_target=10G scope=spfile sid='jscn2'; shutdown immediate startup
4、确定所有的服务都已经启动
[root@testrac1 ~]# crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.jscn.db application ONLINE ONLINE testrac1 ora....n1.inst application ONLINE ONLINE testrac1 ora....n2.inst application ONLINE ONLINE testrac2 ora....SM1.asm application ONLINE ONLINE testrac1 ora....C1.lsnr application ONLINE ONLINE testrac1 ora....ac1.gsd application ONLINE ONLINE testrac1 ora....ac1.ons application ONLINE ONLINE testrac1 ora....ac1.vip application ONLINE ONLINE testrac1 ora....SM2.asm application ONLINE ONLINE testrac2 ora....C2.lsnr application ONLINE ONLINE testrac2 ora....ac2.gsd application ONLINE ONLINE testrac2 ora....ac2.ons application ONLINE ONLINE testrac2 ora....ac2.vip application ONLINE ONLINE testrac2