db_keep_cache_size參数的控制范围測试
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參数的控制范围測试的更多相关文章
- Qt 3D教程(三)实现对模型材质參数的控制
Qt 3D教程(三)实现对模型材质參数的控制 蒋彩阳原创文章,首发地址:http://blog.csdn.net/gamesdev/article/details/47131841.欢迎同行前来探讨. ...
- Android Monkey自己主动化測试
前言 假设你做Android开发,还没有使用过Monkey进行測试,那么今天看到这篇文章,希望能解决你Android測试中的一些问题.起码能帮你省点測试的时间而且发现很多其它的问题. Monkey简单 ...
- android 性能測试iozone篇
一:简单介绍 iozone是一个文件系统的benchmark工具, 用于測试不同的操作系统中文件系统的读写性能, 能够測试下面13种模式 0=write/rewrite 1=read/re-read ...
- LINPACK測试
1简单介绍 LINPACK是线性系统软件包(Linear system package) 的缩写. Linpack如今在国际上已经成为最流行的用于測试高性能计算机系统浮点性能的benchmark.通过 ...
- CodeIgniter RestServer中put请求获取不到參数的问题解决
近期用restserver遇到个蛋疼的问题,发现$this->put得到的參数都是null.查了一下发现.这貌似这个普遍问题,參见链接:https://github.com/chriskacer ...
- web压力測试-Web Bench
1.web bench下载.地址:http://home.tiscali.cz/~cz210552/webbench.html 2.wen bench安装: [root@web111 tmp]#tar ...
- Android—— ubuntu下【CTS】測试TV真机
近期接触到CTS,据传不懂CTS就不算一个合格的android开发者,我之前一直没见周边谁用过.作为一个产品开发的android人员,我还是太年轻- 撰写不易,转载请注明出处:http://blog. ...
- Android单元測试之JUnit
随着近期几年測试方面的工作慢慢火热起来.常常看见有招聘測试project师的招聘信息.在Java中有单元測试这么一个JUnit 方式,Android眼下主要编写的语言是Java,所以在Android开 ...
- Hadoop作业性能指标及參数调优实例 (二)Hadoop作业性能调优7个建议
作者:Shu, Alison Hadoop作业性能调优的两种场景: 一.用户观察到作业性能差,主动寻求帮助. (一)eBayEagle作业性能分析器 1. Hadoop作业性能异常指标 2. Hado ...
随机推荐
- 往aws中的s3上传数据
在官网下载对应的sdk http://aws.amazon.com/cn/sdk-for-net/ 然后再aws上为s3上的bucket生成密钥对 access_key和secret_key 调用对应 ...
- Hadoop 添加删除Slave
Hadoop 添加删除Slave @(Hadoop) 在hdfs-site.xml文件中添加如下配置: <property> <name>dfs.hosts</name& ...
- 【笔记】js 关于定时器的理解
总所周知 js 里面的 setTimeout() 方法是用来设定某些功能在某段时间间隔之后执行的.但是今天看了高程对定时器的描述发现并不是这样. setTimeout(function(){ //.c ...
- 解决python pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during query')
解决python pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during query') 学习了:ht ...
- POJ 3122-Pie(二分+精度)
题目地址:id=3122">POJ 3122 题意:给出n个pie的直径.有F+1个人,假设给每人分的大小同样(形状能够不同),每一个人能够分多少.要求是分出来的每一份必须出自同一个p ...
- 在表单里面检查用户名是否存javascript
function CheckUser(fn) { $.get("/Pages/Handler/CheckExistHander.ashx", { "txt_UserNo& ...
- 如何取得jvm实例的cpu占用(转)
时间 2014-08-29 17:11:34 田加国的博客 原文 http://www.tianjiaguo.com/programming-language/java-language/如何取得j ...
- Drupal显示白屏或500?
Drupal有时会显示白屏,或者500内部错误,这多半是由于PHP脚本什么地方有问题造成的.这个时候,可以先看看php.log里面有没有提示: [10-Oct-2013 15:55:26 Asia/S ...
- Codeigniter MongoDB扩展之使用Aggregate实现Sum方法
本篇文章由:http://xinpure.com/codeigniter-mongodb-extension-using-aggregate-sum-method/ Codeigniter Mongo ...
- form表单中的id 与name的区别
以前经常写form表单时,不写id和name,总觉得没有什么用.后来一看后台套完的页面发现,他们都补上name,不知道所以然,就查了一下资料,吓我一跳,要是照我那样写根本不会有数据传到服务器.原来表单 ...