您的位置:首页 > 其它

性能诊断与调优之OWI--Components

2012-06-07 17:36 155 查看
学习目标:

At the completion of this chapter you will knowwhere, when, and how to find wait event information that will help diagnose performance problems。

很有诱惑啊,从哪儿找,什么时候找,怎么找这些帮助我们进行性能诊断用到的数据。

What Is a Wait Event?

An event can be defined as a particular function, or task, that the Oracle kernel performs on behalf of the user session or its own background process. Tasks such as reading and writing data blocks to and

from data files, waiting for latch acquisitions before accessing or manipulating data in the memory,

interprocess postings and communications, and so on are known as database events, and they have

specific names.

事件就是数据库的一系列活动,如写数据块,读数据文件,在内存中操纵数据。。。。。

But why are these events called wait events?

Every session that is connected to an Oracle instance needs resources to perform its tasks. A resource

may be a data buffer, a latch, an enqueue (lock), a pin, or a database object.
Whenever a session has

to wait for something, the wait time is tracked and charged to the event that is associated with that

wait. For example, a session that needs an index block that is not in the SGA makes a read call to the

operating system and waits for the delivery of the block. The wait time is charged to the db file

sequential read event. Another session may have completed the last instruction and is now idle,

waiting for user input. In this case, the wait time is charged to the SQL*Net message from client

event. In short, when a session is not using the CPU, it may be waiting for a resource, an action to

complete, or simply more work. Hence, events that are associated with all such waits are known as

wait events.

当需要完成某个活动而等待其他资源,这个等待过程发生的相关事件就是等待事件。

OWI Components

Oracle Wait Interface is a collection of a few dynamic performance views and an extended SQL trace file.

OWI组件就是包括一些动态性能视图和一类SQL跟踪文件。

Oracle Wait Interface provides statistics for wait events to tell you how many times and how long the session waited for an event to complete. To get the “how long” part, however, you must set the initialization parameter, TIMED_STATISTICS, to TRUE. Old documentation
associated high

overhead with this parameter and scared a lot of DBAs away. But take comfort: these days, setting

this parameter to TRUE does not add any appreciable overhead to the database performance on most

要获取这些统计信息,要将参数TIMED_STATISTICS的值设置成TRUE

从Oracle Release 7.0.12开始, Oracle Wait Interface 引入 了如下动态性能视图:

V$EVENT_NAME 请参考链接/article/9903790.html
V$SESSION_WAIT 请参考链接
V$SESSION_EVENT 请参考链接
V$SYSTEM_EVENT 请参考链接/article/9903791.html

在上面动态性能视图的基础上Oracle Database 10g Release 又引入了几个新视图

V$SYSTEM_WAIT_CLASS
V$SESSION_WAIT_CLASS 请参考/article/9903792.html
V$SESSION_WAIT_HISTORY
V$EVENT_HISTOGRAM
V$ACTIVE_SESSION_HISTORY

However, V$SYSTEM_EVENT, V$SESSION_EVENT, and V$SESSION_WAIT remain the three

prominent dynamic performance views that provide wait event statistics and timing information at

various levels of granularity. The lowest level of granularity is provided by the V$SESSION_WAIT

view. Information from this view is summarized to the V$SESSION_EVENT and then to the

V$SYSTEM_EVENT view. You can represent this relationship as follows:

V$SYSTEM_EVENT, V$SESSION_EVENT, and V$SESSION_WAIT,这三个视图分别在性能诊断中提供了不同粒度的重要的统计信息,提供最细粒度的V$SESSION_WAIT

视图是另外两个视图的汇总。

You may find yourself repeatedly querying these wait event views in short successions when

investigating performance bottlenecks. However, there will be times when this is not feasible or

practical. In that case, the wait event information can be captured into a trace file using the extended

SQL trace facility and analyzed using the tkprof (Transient Kernel Profiler) utility.

这些等待事件可以被捕获到跟踪文件中,通过tkprof工具进行格式化 后进行分析。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: