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參数的控制范围測试的更多相关文章

  1. Qt 3D教程(三)实现对模型材质參数的控制

    Qt 3D教程(三)实现对模型材质參数的控制 蒋彩阳原创文章,首发地址:http://blog.csdn.net/gamesdev/article/details/47131841.欢迎同行前来探讨. ...

  2. Android Monkey自己主动化測试

    前言 假设你做Android开发,还没有使用过Monkey进行測试,那么今天看到这篇文章,希望能解决你Android測试中的一些问题.起码能帮你省点測试的时间而且发现很多其它的问题. Monkey简单 ...

  3. android 性能測试iozone篇

    一:简单介绍 iozone是一个文件系统的benchmark工具, 用于測试不同的操作系统中文件系统的读写性能, 能够測试下面13种模式 0=write/rewrite 1=read/re-read ...

  4. LINPACK測试

    1简单介绍 LINPACK是线性系统软件包(Linear system package) 的缩写. Linpack如今在国际上已经成为最流行的用于測试高性能计算机系统浮点性能的benchmark.通过 ...

  5. CodeIgniter RestServer中put请求获取不到參数的问题解决

    近期用restserver遇到个蛋疼的问题,发现$this->put得到的參数都是null.查了一下发现.这貌似这个普遍问题,參见链接:https://github.com/chriskacer ...

  6. web压力測试-Web Bench

    1.web bench下载.地址:http://home.tiscali.cz/~cz210552/webbench.html 2.wen bench安装: [root@web111 tmp]#tar ...

  7. Android—— ubuntu下【CTS】測试TV真机

    近期接触到CTS,据传不懂CTS就不算一个合格的android开发者,我之前一直没见周边谁用过.作为一个产品开发的android人员,我还是太年轻- 撰写不易,转载请注明出处:http://blog. ...

  8. Android单元測试之JUnit

    随着近期几年測试方面的工作慢慢火热起来.常常看见有招聘測试project师的招聘信息.在Java中有单元測试这么一个JUnit 方式,Android眼下主要编写的语言是Java,所以在Android开 ...

  9. Hadoop作业性能指标及參数调优实例 (二)Hadoop作业性能调优7个建议

    作者:Shu, Alison Hadoop作业性能调优的两种场景: 一.用户观察到作业性能差,主动寻求帮助. (一)eBayEagle作业性能分析器 1. Hadoop作业性能异常指标 2. Hado ...

随机推荐

  1. Junit测试Spring应用Dubbo测试框架之-Excel 工具类

    package com.tree.autotest.demo; import com.alibaba.fastjson.JSON;import org.apache.poi.hssf.usermode ...

  2. wifi简单笔记

    什么是wifi: Wi-Fi是一种可以将个人电脑.手持设备(如PDA.手机)等终端以无线方式互相连接的技术.Wi-Fi是一个无线网路通信技术的品牌,由Wi-Fi联盟(Wi-Fi Alliance)所持 ...

  3. 从客户端的角度来谈谈移动端IM的消息可靠性和送达机制

    1.前言 IM App 是我做过 App 类型里复杂度最高的一类,里面可供深究探讨的技术难点非常之多.这篇文章和大家聊下从移动端客户端的角度所关注的IM消息可靠性和送达机制(因为我个人对移动客户端的经 ...

  4. H5 Canvas | 基本操作

    <canvas> - 定义使用 JavaScript 的图像绘制. p.s. ×150. getContext是DOM对象的方法,也就是原生js方法,不能用jQuery对象直接获取 ——— ...

  5. Some Principles

    立刻做 1.2分钟原则 凡是2分钟内就可以完成的事,立刻去做不要犹豫.人的大脑擅长分析处理,不擅长记忆. 应用举例: a.加微信加QQ顺手添加备注名,或许下次联系已经是三个月后了. b.吃完饭立刻洗碗 ...

  6. Backbone.js 1.0.0源码架构分析(一)

    Backbone.js 是javascript 语言中 首个实现MVC设计模式的类库,API接口方法重度依赖于underscore.js,DOM选择器则依赖于jQuery.js或者zepto.js. ...

  7. CI框架下nginx重写规则

    因为: server { listen ; server_name 222.73.130.124; location / { index index.html index.htm index.php; ...

  8. xcode9.2 objective-c install (mac 10.12.6)

    1. xcode下载: https://download.developer.apple.com/Developer_Tools/Xcode_9.2/Xcode_9.2.xip 2. 点击默认安装即可 ...

  9. node.js零基础详细教程(6):mongodb数据库操作 以及导入导出

    第六章 建议学习时间4小时  课程共10章 学习方式:详细阅读,并手动实现相关代码 学习目标:此教程将教会大家 安装Node.搭建服务器.express.mysql.mongodb.编写后台业务逻辑. ...

  10. js+css简单效果(幕布,跑马灯)

    2.js普通的盒子,css的优先级 css的优先级 !important >>>>>  style 行内样式  >>>>> #id选择器 # ...