问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

Oracle里面的DB_KEEP_CACHE_SIZE参数是什么意思

发布网友 发布时间:2022-05-02 04:27

我来回答

3个回答

懂视网 时间:2022-05-02 08:48

ocm考试新题中。须要创建keep存储的表,但在该參数是否应该改动上,有一些分歧。有人说asmm会自己主动给keep分配内存的,该參数就不用设置了。

看文档和asktom。也是云山雾罩,说什么的都有,还是来实际的測试吧:

SQL> col COMPONENT for a30
SQL> select COMPONENT,CURRENT_SIZE/1024/1024||'MB' MB from V_$SGA_DYNAMIC_COMPONENTS where COMPONENT in ('DEFAULT buffer cache','KEEP buffer cache');

COMPONENT   MB      
------------------------------ ------------------------------------------ 
DEFAULT buffer cache  352MB      
KEEP buffer cache  0MB      

SQL> conn hr/hr
Connected.
SQL> drop table t1 purge;

Table dropped.

SQL> create table t1 as select * from employees;

Table created.

SQL> insert into t1 select * from t1;

107 rows created.

SQL> /

214 rows created.

SQL> /

428 rows created.

SQL> /

856 rows created.

SQL> /

1712 rows created.

SQL> /

3424 rows created.

SQL> /

6848 rows created.

SQL> /

13696 rows created.

SQL> commit;

Commit complete.

SQL> col SEGMENT_NAME for a10
SQL> select SEGMENT_NAME,BYTES/1024/1024||'mb' MB from user_segments where SEGMENT_NAME='T1';

SEGMENT_NA MB         
---------- ------------------------------------------    
T1  3mb         

SQL> alter table t1 storage( buffer_pool keep);

Table altered.

--造了一张3m的keep表
SQL> set autot on
SQL> select count(*) from t1;

 COUNT(*)         
----------         
 27392         


Execution Plan
----------------------------------------------------------   
Plan hash value: 3724264953       
          
-------------------------------------------------------------------  
| Id | Operation  | Name | Rows | Cost (%CPU)| Time |  
-------------------------------------------------------------------  
| 0 | SELECT STATEMENT | | 1 | 85 (0)| 00:00:02 |  
| 1 | SORT AGGREGATE | | 1 |  |  |  
| 2 | TABLE ACCESS FULL| T1 | 26589 | 85 (0)| 00:00:02 |  
-------------------------------------------------------------------  
          
Note          
-----          
 - dynamic sampling used for this statement     

--做全表扫描,没有物理读,说明是从之前的插入语句读取的数据,并做了240次递归
Statistics
----------------------------------------------------------   
 240 recursive calls       
  1 db block gets       
 421 consistent gets       
  0 physical reads       
 176 redo size        
 413 bytes sent via SQL*Net to client     
 385 bytes received via SQL*Net from client    
  2 SQL*Net roundtrips to/from client     
  4 sorts (memory)       
  0 sorts (disk)       
  1 rows processed       

SQL> select count(*) from t1;

 COUNT(*)         
----------         
 27392         


Execution Plan
----------------------------------------------------------   
Plan hash value: 3724264953       
          
-------------------------------------------------------------------  
| Id | Operation  | Name | Rows | Cost (%CPU)| Time |  
-------------------------------------------------------------------  
| 0 | SELECT STATEMENT | | 1 | 85 (0)| 00:00:02 |  
| 1 | SORT AGGREGATE | | 1 |  |  |  
| 2 | TABLE ACCESS FULL| T1 | 26589 | 85 (0)| 00:00:02 |  
-------------------------------------------------------------------  
          
Note          
-----          
 - dynamic sampling used for this statement     

--第二次全表扫描已经没有递归了,说明数据已经存入内存,并整齐摆放了
Statistics
----------------------------------------------------------   
  0 recursive calls       
  0 db block gets       
 310 consistent gets       
  0 physical reads       
  0 redo size        
 413 bytes sent via SQL*Net to client     
 385 bytes received via SQL*Net from client    
  2 SQL*Net roundtrips to/from client     
  0 sorts (memory)       
  0 sorts (disk)       
  1 rows processed       

SQL> set autot off
SQL> conn / as sysdba
Connected.
SQL> select COMPONENT,CURRENT_SIZE/1024/1024||'MB' MB from V_$SGA_DYNAMIC_COMPONENTS
 2 where COMPONENT in ('DEFAULT buffer cache','KEEP buffer cache');

COMPONENT   MB      
------------------------------ ------------------------------------------ 
DEFAULT buffer cache  352MB      
KEEP buffer cache  0MB      
--查看内存。整齐摆放的数据并未在keep内存里,说明在default里
SQL> alter system set db_keep_cache_size=12m;

System altered.

SQL> select COMPONENT,CURRENT_SIZE/1024/1024||'MB' MB from V_$SGA_DYNAMIC_COMPONENTS
 2 where COMPONENT in ('DEFAULT buffer cache','KEEP buffer cache');

COMPONENT   MB      
------------------------------ ------------------------------------------ 
DEFAULT buffer cache  340MB      
KEEP buffer cache  12MB      
--开辟keep内存
SQL> conn hr/hr
Connected.
SQL> set autot on
SQL> select count(*) from t1;

 COUNT(*)         
----------         
 27392         


Execution Plan
----------------------------------------------------------   
Plan hash value: 3724264953       
          
-------------------------------------------------------------------  
| Id | Operation  | Name | Rows | Cost (%CPU)| Time |  
-------------------------------------------------------------------  
| 0 | SELECT STATEMENT | | 1 | 85 (0)| 00:00:02 |  
| 1 | SORT AGGREGATE | | 1 |  |  |  
| 2 | TABLE ACCESS FULL| T1 | 26589 | 85 (0)| 00:00:02 |  
-------------------------------------------------------------------  
          
Note          
-----          
 - dynamic sampling used for this statement     

--又一次做全表扫描,优化器尽管已经发现内存default里有数据,可是keep内存开辟了,表又是keep的,但keep里没找到数据
--所以在此强制做了物理读
--说明keep參数为0的时候,表尽管是keep的,但数据还是在default里的,keep的大小并未被asmm自己主动分配
Statistics
----------------------------------------------------------   
  0 recursive calls       
  0 db block gets       
 310 consistent gets       
 307 physical reads       
  0 redo size        
 413 bytes sent via SQL*Net to client     
 385 bytes received via SQL*Net from client    
  2 SQL*Net roundtrips to/from client     
  0 sorts (memory)       
  0 sorts (disk)       
  1 rows processed       

SQL> select count(*) from t1;

 COUNT(*)         
----------         
 27392         


Execution Plan
----------------------------------------------------------   
Plan hash value: 3724264953       
          
-------------------------------------------------------------------  
| Id | Operation  | Name | Rows | Cost (%CPU)| Time |  
-------------------------------------------------------------------  
| 0 | SELECT STATEMENT | | 1 | 85 (0)| 00:00:02 |  
| 1 | SORT AGGREGATE | | 1 |  |  |  
| 2 | TABLE ACCESS FULL| T1 | 26589 | 85 (0)| 00:00:02 |  
-------------------------------------------------------------------  
          
Note          
-----          
 - dynamic sampling used for this statement     


Statistics
----------------------------------------------------------   
  0 recursive calls       
  0 db block gets       
 310 consistent gets       
  0 physical reads       
  0 redo size        
 413 bytes sent via SQL*Net to client     
 385 bytes received via SQL*Net from client    
  2 SQL*Net roundtrips to/from client     
  0 sorts (memory)       
  0 sorts (disk)       
  1 rows processed       

SQL> spool off
假设考keep。该參数,还是打开了吧。recycle同理


db_keep_cache_size參数的控制范围測试

标签:default   cte   time   文档   call   amp   count   应该   ons   

热心网友 时间:2022-05-02 05:56

b_keep_cache_size :是否将表保存在内存中。
文档内容:
DB_KEEP_CACHE_SIZE specifies the size of the KEEP buffer pool. The size of the buffers in the KEEP buffer pool is the primary block size (the block size defined by the DB_BLOCK_SIZE initialization parameter)。
中文意思:
DB_KEEP_CACHE_SIZE指定保持缓冲池的大小。保持缓冲的缓冲池的大小是主要的块大小(定义的块大小DB_BLOCK_SIZE初始化参数)。

热心网友 时间:2022-05-02 07:14

DB_KEEP_CACHE_SIZE specifies the size of the KEEP buffer pool. The size of the buffers in the KEEP buffer pool is the primary block size (the block size defined by the DB_BLOCK_SIZE initialization parameter).
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
火狐浏览器如何将网页保存为PDF文件 【亲测好用】网页下载保存为pdf u盘坏芯片坏能修吗-(u盘芯片坏了能修吗) 快捷糖水目录 微信上如何和男人撒娇? 去日本旅游要带什么好? 年月日电脑怎么设置表格excel表格出生日期列如何设置为年月日格式 ...一定要对女主好,宠她。要打包下载,谢谢亲。 空气净化器滤芯有酸味的原因 不同种类的蛋糕分别代表什么含义呢? OEM硬盘好吗 柳州哪里有好吃的麻辣烫? 有朋友知道哪里有楚剧MP3音乐,如荞麦馍赶寿,百日缘,送友,访友,葛麻,四下河南等资源的吗 有哪些你一辈子也忘不掉的食堂菜呢? 请知道楚剧:四下河南,荞麦馍赶寿,梁山伯与祝英台等优秀曲目的MP3发到我的信箱32917459@qq.com,谢谢! 大家都吃过美食,你吃啥美食,有什么感受? 高分求助 四下河南 楚剧 汤火功夫麻辣烫好吃么??? 楚剧的《楚剧大全》简介 什么楚剧是夸妈妈好的? 你在吃麻辣烫的时候,有哪些菜是必须放的? 谁有免费的楚剧全集的MP3下载? 原神端游内存为什么会进到c盘 求楚剧 四下河南 给物品爷爷听的 大量楚剧MP3格式的 发我邮箱 麻辣烫和火锅食材差不多一样,为什么口感却千差万别? 那里有楚剧的下载 请问,在哪可以下载楚剧(比如:四下河南、葛麻、送友访友等)的mp3的格式? 薯片等高热量美食停不下口,哪些食物是绝对不能多食的? 求一个横批.关于麻辣烫的 上联:一锅汤出人间美味下联:一签串尽天下美食. 哪位老师给提个横批谢谢 请问哪里可以免费下载老楚剧mp3,如四下河南,秦香莲等。谢谢! oem版硬盘是正规货吗还是假的 工包的oem固态硬盘如何鉴别是否全新 出售OEM硬盘会有什么后果 OEM版的硬盘,可靠性比零售版的更好吗 什么是oem硬盘 好烦啊!买了一个OEM货的硬盘。现在怎么办 HP服务器硬盘拆机件与OEM盘区别 在闲鱼280买了一个新的英特尔s3610固态硬盘(应该是oem版),请问可能是清零盘么?怎么确认? 硬盘OEM版是什么意思啊?可买吗? 怎样区分硬盘是否OEM的? 买到OEM硬盘,如何维权? 希捷OEM硬盘 我想起诉即有分期 跪求韩剧未删减版,【在线观看】免费百度云资源 非常逼真,好像活的一样的成语 哪些词语的意思是“极像真的”? 当oracleamm,哪些内存模块可以更改大小 用和密码能在电脑上登陆微信吗? 梦到以旧换新送子观音和财神爷求解 梦见送子观音,我已经在寺庙中,右边就是送子观音,因为我本身也想要孩子,我还想是不是要去拜拜,