Truncate table对x$bh的影响
来源:互联网 发布:qq运动不同步数据 编辑:程序博客网 时间:2024/04/27 18:26
导读:
今天在做实验的时候发现:truncate table后x$bh不会再记录对此table块的访问,具体实验如下:
SQL>create table t3 ( a number);
Table created.
SQL>select object_id from dba_objects where object_name='T3';
OBJECT_ID
----------
51560
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51560;
OBJ TCH DBARFIL DBABLK
---------- ---------- ---------- ----------
51560 2 1 60465
SQL>insert into t3 select level from dual connect by level<=1000;
1000 rows created.
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51560;
OBJ TCH DBARFIL DBABLK
---------- ---------- ---------- ----------
51560 1 1 60467
51560 1 1 60466
51560 3 1 60465
SQL>truncate table t3;
Table truncated.
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51560;
no rows selected
SQL>insert into t3 select level from dual connect by level<=1000;
1000 rows created.
SQL>commit;
Commit complete.
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51560;
no rows selected
但是如果table中没有任何数据(只有一个块记录段头)时,x$bh就不会受truncate影响
SQL>create table t4 (a number);
Table created.
SQL>select object_id from dba_objects where object_name='T4';
OBJECT_ID
----------
51566
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51566;
OBJ TCH DBARFIL DBABLK
---------- ---------- ---------- ----------
51566 1 1 60473
SQL>truncate table t4;
Table truncated.
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51566;
OBJ TCH DBARFIL DBABLK
---------- ---------- ---------- ----------
51566 2 1 60473
本文转自
http://woodnan.itpub.net/post/37055/457768
今天在做实验的时候发现:truncate table后x$bh不会再记录对此table块的访问,具体实验如下:
SQL>create table t3 ( a number);
Table created.
SQL>select object_id from dba_objects where object_name='T3';
OBJECT_ID
----------
51560
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51560;
OBJ TCH DBARFIL DBABLK
---------- ---------- ---------- ----------
51560 2 1 60465
SQL>insert into t3 select level from dual connect by level<=1000;
1000 rows created.
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51560;
OBJ TCH DBARFIL DBABLK
---------- ---------- ---------- ----------
51560 1 1 60467
51560 1 1 60466
51560 3 1 60465
SQL>truncate table t3;
Table truncated.
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51560;
no rows selected
SQL>insert into t3 select level from dual connect by level<=1000;
1000 rows created.
SQL>commit;
Commit complete.
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51560;
no rows selected
但是如果table中没有任何数据(只有一个块记录段头)时,x$bh就不会受truncate影响
SQL>create table t4 (a number);
Table created.
SQL>select object_id from dba_objects where object_name='T4';
OBJECT_ID
----------
51566
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51566;
OBJ TCH DBARFIL DBABLK
---------- ---------- ---------- ----------
51566 1 1 60473
SQL>truncate table t4;
Table truncated.
SQL>select obj,tch,dbarfil,dbablk from x$bh where obj=51566;
OBJ TCH DBARFIL DBABLK
---------- ---------- ---------- ----------
51566 2 1 60473
本文转自
http://woodnan.itpub.net/post/37055/457768
- Truncate table对x$bh的影响
- Oracle drop table 和 truncate table对grant授权的影响
- 利用硬链接和truncate降低drop table对线上环境的影响
- 利用硬链接和truncate降低drop table对线上环境的影响
- 非sysdba用户对x$bh的查询
- x$bh
- display属性对table的影响
- mysql flush table 对查询的影响
- Log explorer 对drop/truncate table的数据恢复
- Buffer Cache ---- BH&X$BH
- TRUNCATE TABLE 的用法
- SQL TRUNCATE TABLE的用法
- SQL TRUNCATE TABLE的用法
- SQL TRUNCATE TABLE的用法
- x$bh详解
- x$bh详解
- oracle x$bh 说明
- 分区truncate操作的介绍及对全局索引和空间释放影响的案例解析
- 递归实现itoa函数
- 树状链表的ASP程序实现
- List of X$ Tables and how the names are derived
- 打造世界一流的软件和服务外包产业基地
- 浪漫一生又何妨
- Truncate table对x$bh的影响
- 有关QueryInterface函数
- 工作流
- 点石互动--古心神之:网站关键词标题和网页描述撰写技巧
- Oracle回滚段表空间文件丢损的处理
- 广州是南方沿海最垃圾的城市
- GCC主要参数
- Oracle回滚表空间数据文件误删除处理
- Oracle全文索引设置步骤