Oracle 块头的事务槽
来源:互联网 发布:linux数据库备份命令 编辑:程序博客网 时间:2024/06/09 15:30
INITRANS 初始个数,默认为2,每个块会预分配2个事务槽。
MAXTRANS 事务槽的最大个数,为255(新版本已经不可设置了)。
事务槽的增加是需要空间的,如果块上空间不足,事务槽的数量将达不到255。
每个事务槽代表一个并发事务。
探索小实验:
SCOTT@ prod> create table t ( x int primary key , y varchar2(4000) ) ;Table created.SCOTT@ prod> insert into t(x,y) select rownum , rpad('*' , 148 , '*') from dual connect by level <= 46 ;46 rows created.SCOTT@ prod> select length(y) , dbms_rowid.rowid_block_number(rowid) blk , count(*) , min(x) , max(x) 2 from t group by length(y) , dbms_rowid.rowid_block_number(rowid) ; LENGTH(Y) BLK COUNT(*) MIN(X) MAX(X)---------- ---------- ---------- ---------- ---------- 148 462572 46 1 46SCOTT@ prod>SCOTT@ prod> commit ;Commit complete.SCOTT@ prod> create or replace procedure do_update(p_n in number) 2 as 3 pragma autonomous_transaction ; 4 l_rec t%rowtype ; 5 resource_busy exception ; 6 pragma exception_init(resource_busy , -54) ; 7 begin 8 select * into l_rec from t 9 where x = p_n 10 for update nowait ; 11 12 do_update(p_n + 1 ) ; 13 commit ; 14 exception 15 when resource_busy 16 then 17 dbms_output.put_line('locked out trying to select row' || p_n ) ; 18 commit ; 19 when no_data_found 20 then 21 dbms_output.put_line('we finished - no problems') ; 22 commit ; 23 end ; 24 /Procedure created.SCOTT@ prod>SCOTT@ prod> exec do_update(1) ;locked out trying to select row38PL/SQL procedure successfully completed.SCOTT@ prod>SCOTT@ prod>SCOTT@ prod>SCOTT@ prod> truncate table t ;Table truncated.SCOTT@ prod> insert into t(x,y) select rownum , rpad('*' , 147 , '*') from dual connect by level <= 46 ;46 rows created.SCOTT@ prod> select length(y) , dbms_rowid.rowid_block_number(rowid) blk , count(*) , min(x) , max(x) 2 from t group by length(y) , dbms_rowid.rowid_block_number(rowid) ; LENGTH(Y) BLK COUNT(*) MIN(X) MAX(X)---------- ---------- ---------- ---------- ---------- 147 462572 46 1 46SCOTT@ prod> exec do_update(1) ;we finished - no problemsPL/SQL procedure successfully completed.
实验表明:
事务槽有不能扩展的可能性。
46个字节就可以增加9个以上的事务槽。
为了防止事务槽不足:
增加PCTFREE。
增加INITRANS。
阅读全文
0 0
- Oracle 块头的事务槽
- oracle ITL(事务槽)的理解
- oracle ITL(事务槽)的理解
- oracle ITL(事务槽)的理解
- 对oracle ITL(事务槽)的理解
- oracle ITL(事务槽)的理解
- oracle ITL(事务槽)的理解
- oracle ITL(事务槽)的理解
- Oracle的自治事务
- oracle事务的隔离
- Oracle的自治事务
- 5 oracle的事务
- Oracle 事务的特征
- Oracle 事务的特征
- Oracle 事务的应用
- oracle 里面的事务
- Oracle的事务
- Oracle事务的总结
- printf内幕----编程内幕(1)
- springboot学习二(springboot相关配置)
- Bigtable: A Distributed Storage System for Structured Data : part6 Refinements
- java 重复请求过滤(并发访问)
- 假如时光倒流,我会这么学习Java
- Oracle 块头的事务槽
- 实数向整数的强制转换
- 位运算
- Linux进程概念
- vue 从零搭建项目
- hibernate(3)
- 1049. 数列的片段和(20)
- RTX OS在NANO130中的实现
- esp32第一篇:试用