ora_rowscn
===============
10g之后开始使用
用了标志row版本变化情况
默认是对块生效
通过设置rowdependencies可以对行生效
要对行生效需要重新建表
只需要建表时添加关键字rowdependencies即可
其实就是在表中添加一个隐含字段
表的空间开销会有所增加
create table attt(id int) rowdependencies;
--------------
测试
不适用rowdependence
对于同一个块中两行数据只修改一行
rowscn全部发生变化
表已删除。
an@DB10> create table attt (id int);
表已创建。
已创建 1 行。
an@DB10> insert into attt select 2 from dual;
已创建 1 行。
提交完成。
an@DB10>
an@DB10>
an@DB10> select dbms_rowid.rowid_block_number(rowid) blockno,to_char(ora_rowscn) from attt;
BLOCKNO TO_CHAR(ORA_ROWSCN)
---------- ----------------------------------------
23524 41250033602
23524 41250033602
已更新 1 行。
提交完成。
an@DB10>
an@DB10> select dbms_rowid.rowid_block_number(rowid) blockno,to_char(ora_rowscn) from attt;
BLOCKNO TO_CHAR(ORA_ROWSCN)
---------- ----------------------------------------
23524 41250033605
23524 41250033605
=====================
开启rowdependencies后同一块中数据只有发生修改行的rowscn发生变化
表已删除。
an@DB10> create table attt (id int) rowdependencies;
表已创建。
已创建 1 行。
an@DB10> insert into attt select 2 from dual;
已创建 1 行。
提交完成。
an@DB10>
an@DB10>
an@DB10> select dbms_rowid.rowid_block_number(rowid) blockno,to_char(ora_rowscn) from attt;
BLOCKNO TO_CHAR(ORA_ROWSCN)
---------- ----------------------------------------
23532 41250034034
23532 41250034034
已更新 1 行。
提交完成。
an@DB10>
an@DB10> select dbms_rowid.rowid_block_number(rowid) blockno,to_char(ora_rowscn) from attt;
BLOCKNO TO_CHAR(ORA_ROWSCN)
---------- ----------------------------------------
23532 41250034034
23532 41250034037
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/13177610/viewspace-709239/
,如需转载,请注明出处,否则将追究法律责任。