关于 V$SEGMENT_STATISTICS 视图的 db block changes 统计
测试如下SQL> create table myusers as select * from dba_users;
Table created.
SQL> select object_id from dba_objects where object_name='MYUSERS';
OBJECT_ID
----------
270471
SQL> select count(*) from myusers;
COUNT(*)
----------
37
select obj#,STATISTIC_NAME,value from V$SEGMENT_STATISTICS where obj#=270471 and STATISTIC_NAME='db block changes';
OBJ# STATISTIC_NAME VALUE
---------- ------------------------------ ----------
270471 db block changes 0
SQL> update myusers set user_id=1;
37 rows updated.
SQL> commit;
Commit complete.
SQL> select obj#,STATISTIC_NAME,value from V$SEGMENT_STATISTICS where obj#=270471 and STATISTIC_NAME='db block changes';
OBJ# STATISTIC_NAME VALUE
---------- ------------------------------ ----------
270471 db block changes 32
创建的测试表比较小,简单的更新30+记录,但是 db block changes 统计值却增加了 32,请问 db block changes 的
具体统计是否 和 修改的记录数有关,
请问 db block changes 的
具体统计是否 和 修改的记录数有关,
==>无关
db block changes代表此对象 数据块变化的次数 用来计量 描绘数据变化频率
并不是说 表较小就会导致 db block changes 达不到32次,具体你可以做10200相关的trace证明 刘老大,是这样做trace吗?
SQL> alter session set events '10200 trace name context forever, level 10';
Session altered.
SQL> update myusers set user_id=1;
37 rows updated.
SQL> commit;
Commit complete.
不过测试的时候还有一个情况
会话1
select obj#,STATISTIC_NAME,value from V$SEGMENT_STATISTICS where obj#=270471 and STATISTIC_NAME='db block changes';
OBJ# STATISTIC_NAME VALUE
---------- ------------------------------ ----------
270471 db block changes 224
SQL> update myusers set user_id=1;
37 rows updated.
会话2
select * from myusers;
会话1
SQL> commit;
Commit complete.
SQL> select obj#,STATISTIC_NAME,value from V$SEGMENT_STATISTICS where obj#=270471 and STATISTIC_NAME='db block changes';
OBJ# STATISTIC_NAME VALUE
---------- ------------------------------ ----------
270471 db block changes 288
增加了64,
页:
[1]