The meaning of the ORACLE v$lock view Type,id1,id2 value

Source: Internet
Author: User

In the Oracle V$lock view, below is a description of the specific meanings of the Type,id1,id2 three columns:

Type has tm,tx two types, TX is row-level lock, Thing lock, TM Lock is table-level lock

TYPE

ID1

ID2

Tm

identifier of the modified table (object_id)

0

TX

A decimal value indicates the number of the rollback segment that is occupied by the transaction and the slot number that is used in the transaction table (Transactiontable) of the rollback segment (slotnumbers, which can be understood as record numbers). Its constituent form is: 0xRRRRSSSS (RRRR = RBS number, SSSS = slot).

Represents the number of surround (wrap) occurrences in decimal values, the number of times that the slot (slot) is reused;

When type is TM, 6718 is the object ID number

Sql> Select Type,id1,id2 from V$lock where Sid in (16,17);

TYPE ID1 ID2
---- ---------- ----------
TX 65572 56
TM 6718 0
TM 6718 0
TX 65572 56

Sql> Select object_id from dba_objects WHERE wner= ' SYS ' and object_name= ' TEST ';

object_id
----------
6718

Sql>

When type is TX, 65572 uses the following conversion method to get the thing slot number of the rollback segment number and the rollback segment

Sql> select Xidusn,xidslot from V$transaction;

Xidusn Xidslot
---------- ----------
1 36

Sql> Select Trunc (65572/65536), mod (65572,65536) from dual;

TRUNC (65572/65536) MOD (65572,65536)
------------------ ----------------
1 36

http://blog.itpub.net/7199859/viewspace-544923/

The meaning of the ORACLE v$lock view Type,id1,id2 value

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.