Oracle 학습 의 길 [3] 캐 시 테이블

4907 단어 Oaclesqlcache
=========================================================================
oracle    BUFFER CACHE        。
  buffer cache   :default,keep ,recycle 。          default 。

Oracle db_buffer_pool      
1. buffer_pool_default
2. buffer_pool_keep
3. buffer_pool_recycle
--   
alter table ..... storage(buffer_pool keep);  
--                         
select table_name from dba_tables where buffer_pool='keep';
--            
select table_name,cache,buffer_pool from user_TABLES where cache like '%Y';
--     KEEP         ,  
alter table table_name nocache;
--    ORACLE    insert all into ... insert into ...select 1 from dual;
--           
select table_name,cache,buffer_pool from user_TABLES;
--    LOB   segment cache  
alter table t2 modify lob(c2) (storage (buffer_pool keep) cache);
--    
alter table test modify lob(address) (storage (buffer_pool keep) nocache);
--   
select segment_name,segment_type,buffer_pool from user_segments;
--   CLOB      cache    
alter table lob1 modify lob(c1.xmldata) (storage (buffer_pool keep) cache); 
 
--                
select column_name,segment_name from user_lobs;


SELECT  name,value   FROM   V$sysstat
    WHERE   name   in   ('dbblock gets','consistent gets','physical reads');
          =1-physical   reads/(dbblock   gets+consistent   gets)        <0.6~0.7,    Db_block_buffers。


Oracle 10g ,              : 

     SGA  :  DB_CACHE_SIZE、SHARED_POOL_SIZE、LARGE_POOL_SIZE JAVA_POOL_SIZE。 

  SGA  :  LOG_BUFFER、STREAMS_POOL、DB_NK_CACHE_SIZE、DB_KEEP_CACHE_SIZE DB_RECYCLE_CACHE_SIZE。


     、  、       

select segment_name, sum(bytes)/1024/1024 Mbytese from user_segments group by segment_name;

1、     
--     
SELECT SUM(BYTES)/1024/1024 M FROM USER_SEGMENTS WHERE SEGMENT_NAME = 'WORKINFO';

--         
select segment_name, sum(bytes)/1024/1024 Mbytese from user_segments where segment_type='TABLE' group by segment_name;

2、      select segment_name ,sum(bytes)/1024/1024 from user_segments where segment_type ='INDEX' group by segment_name;

3、   TABLE PARTITION    

select segment_name,sum(bytes)/1024/1024 Mbytes from user_segments where segment_type='TABLE PARTITION' group by segment_name;


v$db_object_cache       shared_pool,
        V$BH V$CACHE       .


      :
          keep pool
          recycle pool
          default pool
      keep pool  default pool       ,      LRU    。          ,       。             ,              。   keep pool                  ;    (recycle pool) ,     KEEP     。 KEEP  ,      , RECYCLE       ,      。

 
ORACLE    
DB_KEEP_CACHE_SIZE = integer [K | M | G]
DB_RECYCLE_CACHE_SIZE = integer [K | M | G]
           init.ora 


oracle         


================
db_16k_cache_size big integer 0
db_2k_cache_size big integer 0
db_32k_cache_size big integer 0
db_4k_cache_size big integer 0
db_8k_cache_size big integer 0
db_cache_size big integer 956301312
db_keep_cache_size big integer 0
db_recycle_cache_size big integer 0
SQL> SELECT 128*1024*1024 FROM DUAL;

128*1024*1024
-------------
134217728

ALTER SYSTEM SET DB_CACHE_SIZE = 822083584;

ALTER SYSTEM SET DB_KEEP_CACHE_SIZE = 134217728;

========================
 Oracle          :
db block gets:Number of times a CURRENT block was requested.
consistent gets:Number of times a consistent read was requested for a block.
physical reads:Total number of data blocks read from disk. This number equals the value of "physical reads direct" plus all reads into buffer cache.
---------------------------------------------
    3               :
1、DB Block Gets(        )
                     ,                  。      ,                           ,               ,                     。

2、Consistent Gets(          Buffer               )
                                 ,                       ,              ,            ,                    ,                     ,         。          。

3、Physical Reads(   )
              ,         :
1、                
2、     
3、     

               :
      Oracle           。     'consistent gets' + 'db block gets'。                         ,      'phsical reads'。
=======================

 
=========================================================================

좋은 웹페이지 즐겨찾기