暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 的 enq: TT - contention 等待事件

原创 eygle 2015-05-07
1730

在遇到 TT 锁等待时,你可能会被Oracle的文档所困扰。即便是在Oracle Database 12c的文档中,关于TT锁的描述也是:Temporary table enqueue。


这其实已经不准确了,从数据库中可以得到更详细和准确的描述,V$LOCK_TYPE中有着准确记录:


SQL> set serveroutput on
SQL> exec print_table('select * from v$lock_type where type=''TT''');
TYPE : TT
NAME : Tablespace
ID1_TAG : tablespace ID
ID2_TAG : operation
IS_USER : NO
DESCRIPTION : Serializes DDL operations on tablespaces
-----------------
PL/SQL procedure successfully completed.

在Oracle 8i之后,这个事件代表的是表空间事务,用于防范死锁,TT - Tablespace Transaction。其两个核心参数: ID1 代表表空间号,ID2 代表操作类型。


操作类型代码的主要解释为:



0- is used to avoid the deadlock occurred between drop tablespace and create rollback segment
1- using in a given tablespace create data files In a serialized
2- is used to avoid TSPITR tablespace point in in time recovery during other types of operation
4- is used to create tablespace to block the tablespace ID
8- is used to avoid deadlock in ALTER during TABLESPACE
16- is the 16 hexadecimal 0 × 10, used to synchronize the allocation and recovery disc area, allocation and deallocation of extents.
32+ With the increase in 32+ data file add datafile and create a table space, where ID2 is 32 (decimal) + relative file number relative file number



参考链接:http://www.programering.com/a/MTMxMjNwATc.html


「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论