Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle Enqueues Wait Events one

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle Enqueue Names

Enquences is a shared memory structure, also called lock, designed to manage continuous access to database resources. They can be associated with a session or transaction. The Enquences name is displayed in the LOCK_TYPE column of the DBA_LOCK and DBA_LOCK_INTERNAL data dictionary views.

A resource is uniquely identified as an object that can be locked by an instance (local resource) or by different sessions between multiple instances (global resource). Each session that tries to lock a resource generates a queue on that resource.

The following is the lock mode of Oracle Enqueues for resource applications and the requested resources

Enqueues are usually represented in the format "TYPE-ID1-ID2" where:

"TYPE" is a 2 character text string "ID1" is a 4 byte hexadecimal number

"ID2" is a 4 byte hexadecimal number Parameters:

P1 = Lock Type & Mode

P2 = Lock ID1

P3 = Lock ID2

Lock Type & Mode

The lock type and requested mode are encoded into P1 thus:

Convert P1 into hexadecimal (or use P1RAW) and extract the lock type and requested mode from this by converting the first 2 bytes of the hexadecimal number to ASCII and the second 2 bytes to a number:

Eg: 54580006

^ ^-Converted to ASCII gives "TX" (0x54 = "T", 0x58 = "X")

^-0006 is 6 in decimal so this is a mode 6 request

Note that on UNIX, the command 'man ascii' will display the Octal, hexadecimal, and decimal ASCII character sets to help with the hex translation.

An alternative way to extract this information is to use SQL thus:

SELECT chr (to_char (bitand (p1mam Lashi 16777216)) / 16777215) | |

Chr (to_char (bitand (p1, 16711680)) / 65535) "Lock"

To_char (bitand (p1, 65535)) "Mode"

FROM v$session_wait

WHERE event = 'enqueue'

Lock ID1

P2 represents ID1 of the enqueue name in decimal.

P2RAW represents ID1 of the enqueue name in hexadecimal.

Lock ID2

P3 represents ID2 of the enqueue name in decimal.

P3RAW represents ID2 of the enqueue name in hexadecimal.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report