Oracle 等待事件 latch free 官方解释,作用,如何使用及优化方法

本站中文解释

Oracle事件latch free定义为:当多个进程竞争一只latch 2次,而第2次的竞争者失败时,在 Statspack 或ASH报告中可以看到的Oracle事件名称。当数据库发生IO瓶颈,并且出现这类事件时,就可以查看latch free对Oracle性能的影响。

latch free 是一种 Oracle 的内部技术,是用于提升性能的一种需要得到保护的数据结构。通俗讲,在有多个几秒之间,用来竞争访问相同的资源的多个进程中,如果短时间内无法访问此特定资源,则会发生latch free事件。

由于Oracle数据库中大量组件都是由不同的进程驱动的,每一个进程都可以同时访问资源,并产生latch free的。而我们的目的是保护共有的资源,因此在资源访问时,可能会出现竞争的情况。 在竞争时,如果第二个进程竞争失败,则表示该进程无法获取资源,这就引发了latch free事件。

当第二个进程失败后,Oracle会记录此事件。在 Statspack 报表或 Ash 报表中,可以查看到这类活动数据,以研究当前活动与未来计划之间的关系。

当我们出现latch free事件时,可以明显感觉性能是不够理想的,我们需要找出问题的源头,可以通过观察Latch Free事件的跟踪文件,分析做更进一步的检查。

总之,Latch Free是一个用来检测Oracle数据库中针对不同进程之间对资源的竞争的事件,可以检测数据库的性能瓶颈,并可以用来优化性能。

官方英文解释

The process waits for a latch that is currently busy (held by another process).

Wait Time: The wait time increases exponentially and does not include spinning on the latch (active waiting). The maximum wait time also depends on the number of latches that the process is holding. There is an incremental wait of up to 2 seconds.

Parameter Description

address

The address of the latch for which the process is waiting

number

The latch number that indexes in the V$LATCHNAME view.To find more information on the latch, use the following SQL statement:

select * from v$latchname where latch# = number;

tries

A count of the number of times the process tried to get the latch (slow with spinning) and the process has to sleep

See Also:

Oracle Database
Performance Tuning Guide
for more information about latch wait events


数据运维技术 » Oracle 等待事件 latch free 官方解释,作用,如何使用及优化方法