第八讲--buffer cache大小的设置及依据

查看oracle相关进程:

[oracle@redhat4 ~]$ ps -ef|grep ora
root     8450  7935  0 10:40 pts/1    00:00:00 su - oracle
oracle   8451  8450  0 10:40 pts/1    00:00:00 -bash
oracle   8480     1  0 10:41 ?        00:00:00 ora_pmon_jiagulun
oracle   8482     1  0 10:41 ?        00:00:00 ora_psp0_jiagulun
oracle   8484     1  0 10:41 ?        00:00:00 ora_mman_jiagulun
oracle    8486    1  0 10:41 ?        00:00:00 ora_dbw0_jiagulun
oracle   8488     1  0 10:41 ?        00:00:00 ora_lgwr_jiagulun
oracle   8490     1  0 10:41 ?        00:00:00 ora_ckpt_jiagulun
oracle   8492     1  0 10:41 ?        00:00:00 ora_smon_jiagulun
oracle   8494     1  0 10:41 ?        00:00:00 ora_reco_jiagulun
oracle   8496     1  0 10:41 ?        00:00:00 ora_cjq0_jiagulun
oracle   8498     1  0 10:41 ?        00:00:00 ora_mmon_jiagulun
oracle   8500     1  0 10:41 ?        00:00:00 ora_mmnl_jiagulun
oracle   8502     1  0 10:41 ?        00:00:00 ora_d000_jiagulun
oracle   8504     1  0 10:41 ?        00:00:00 ora_s000_jiagulun
oracle   8540     1  0 10:41 ?        00:00:00 ora_qmnc_jiagulun
oracle   8542     1  0 10:41 ?        00:00:00 ora_j000_jiagulun
oracle   8560     1  0 10:41 ?        00:00:00 ora_q000_jiagulun
oracle   8562     1  0 10:41 ?        00:00:00 ora_q001_jiagulun
oracle   8681  8451  0 10:42 pts/1    00:00:00 ps -ef
oracle   8682  8451  0 10:42 pts/1    00:00:00 grep ora
SQL> show parameter writer

发现有一个进程叫做dbw0,有0就有1,在oracle中DBWR进程不止一个,一般是CPU数量除以8。

 

查看SGA各个组件大小:

SQL>select component,current_size,min_size from v$sga_dynamic_components;
 
COMPONENT                                                       CURRENT_SIZE
MIN_SIZE
---------------------------------------------------sharedpool 150994944 146800640 largepool 4194304 4194304 javapool 4194304 4194304 COMPONENT CURRENT_SIZE---------------------------------------------------------------------------- MIN_SIZE----------streamspool 0 0 DEFAULTbuffer cache 117440512 117440512 KEEPbuffer cache 0 0 COMPONENT CURRENT_SIZE---------------------------------------------------------------------------- MIN_SIZE----------RECYCLEbuffer cache 0 0 DEFAULT2K buffer cache 0 0 DEFAULT4K buffer cache 0 0 COMPONENT CURRENT_SIZE---------------------------------------------------------------------------- MIN_SIZE----------DEFAULT8K buffer cache 0 0 DEFAULT16K buffer cache 0 0 DEFAULT32K buffer cache 0 0 COMPONENT CURRENT_SIZE---------------------------------------------------------------------------- MIN_SIZE----------ASMBuffer Cache 0 0 13 rowsselected.
 
  
SQL>select component,current_size,min_size from v$sga_dynamic_components;
 
COMPONENT                                                       CURRENT_SIZE
----------------------------------------------------------------------------
  MIN_SIZE
----------
sharedpool                                                        150994944
 146800640
 
largepool                                                           4194304
   4194304
 
javapool                                                            4194304
   4194304
 
 
COMPONENT                                                       CURRENT_SIZE
----------------------------------------------------------------------------
  MIN_SIZE
----------
streamspool                                                               0
         0
 
DEFAULTbuffer cache                                               117440512
 117440512
 
KEEPbuffer cache                                                          0
         0
 
 
COMPONENT                                                       CURRENT_SIZE
----------------------------------------------------------------------------
  MIN_SIZE
----------
RECYCLEbuffer cache                                                       0
         0
 
DEFAULT2K buffer cache                                                    0
         0
 
DEFAULT4K buffer cache                                                    0
         0
 
 
COMPONENT                                                       CURRENT_SIZE
----------------------------------------------------------------------------
  MIN_SIZE
----------
DEFAULT8K buffer cache                                                    0
         0
 
DEFAULT16K buffer cache                                                   0
         0
 
DEFAULT32K buffer cache                                                   0
         0
 
 
COMPONENT                                                       CURRENT_SIZE
----------------------------------------------------------------------------
  MIN_SIZE
----------
ASMBuffer Cache                                                           0
         0
 
 
13 rowsselected.

设置buffer cache大小:

         Buffer cache的大小在SQL语句里叫做db_cache_size,推荐的配置是:db_cache_size=sga_max_size/2~sga_max_size*(2/3)。

先增加sga_max_size的大小(需要重启数据库);再增加sga_target的大小;最后增加db_cache_size的大小;

1.      Altersystem set sga_max_size scope=both;

2.      Altersystem set sga_target=200m scope=both;

3.      Shutdownimmediate;

4.      Startup;

5.      Altersystem set db_cache_size=100m scope=both;

你可能感兴趣的:(Oracle体系结构)