Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Wait Events

Wait Events

|Views: 8|Likes:
Published by Sagar Verma

More info:

Published by: Sagar Verma on Feb 12, 2013
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





pdfcrowd.comopen in browserPRO version
Are you a developer? Try out theHTML to PDF API
Interpreting Wait Events to Boost System Performance
by Roger SchragDatabase Specialists, Inc.
About Database Specialists, Inc.
Database Specialists, Inc. provides remote DBA services and onsite database support for your mission critical Oraclesystems. Since 1995, we have been providing Oracle database consulting in Solaris, HP-UX, Linux, AIX, and Windowsenvironments. We are DBAs, speakers, educators, and authors. Our team is continually recognized by Oracle, atnational conferences and by leading trade publications. Learn more about ourremote DBA,database tuning, andconsultingservices. Or, call us at 415-344-0500 or 888-648-0500.
People seem to have an insatiable appetite for speed. No matter how fast an application runs, users always seem to want it to run faster. Since everybody looks to the database administrator when system performance or scalability isin question, it's no wonder DBAs are always looking for ways to estimate, measure, and improve systemperformance.A few years back, cache hit ratios were thought by some to be the ultimate indicator ofdatabase performance. "You cannot survive in an e-commerce environment with a buffer cache hit ratio of less than 99.9%!" exclaimed some.More recently, the wait event interface has come into vogue. Many DBAs have heard about wait events, and manyknow which v$ views to look at, but few resources are available that discuss techniques for using the wait eventinterface and even fewer walk through concrete examples of how to use wait event information in order to boostsystem performance.In this paper we will first define what wait events are and how to collect wait event information. Then we'll move on toexamples of how wait event information paved the way to solving real-world performance problems. The material inthis paper is based on my real-life experience. I've been working with Oracle databases for over twelve years, and
pdfcrowd.comopen in browserPRO version
Are you a developer? Try out theHTML to PDF API
tuning problem systems is what I do for a living (and what I enjoy most about being a DBA).
What are Wait Events?
The wait event interface appeared in the first production release of Oracle 7. For many years it remainedundocumented and few people outside the kernel group at Oracle Corporation knew of its existence. By Oracle 7.3the word was out, and the documentation that comes with Oracle 8.0 and later gives a pretty good explanation of the wait event interface. The basic idea hasn't changed, but Oracle continues to add new wait events as they add newfunctionality to the Oracle kernel.In this section we will explain what wait events are and why the data provided by the wait event interface can behelpful.
"Wait Event" Defined
At any given moment, every Oracle process is either busy servicing a request or waiting for something specific tohappen. By "busy" we mean that the process wishes to use the CPU. For example, a dedicated server processmight be performing an arithmetic operation while executing a PL/SQL block. This process would be said to be busyand not waiting. The LGWR process, meanwhile, might be waiting for the operating system to indicate that the redolog buffer has successfully been written to disk. In this case the LGWR process is waiting.The kernel developers at Oracle have defined a list of every possible event that an Oracle process could be waitingfor. In Oracle 8.0 there were 158 such wait events. In Oracle 8i Release 3 there are 217. At any moment, everyOracle process that is not busy is waiting for one of these events to occur. Suppose a dedicated server process is waiting for an application to submit a SQL statement for execution. This wait event is called "SQL*Net messagefrom client." Another dedicated server process might be waiting for a row-level lock on the INVOICES table to befreed so that an UPDATE statement can continue. That wait event is called "enqueue."It turns out that Oracle is very diligent about tracking wait event information and making it available to DBAs. We callthis the "wait event interface." By querying v$ views, we can see what events processes are waiting on to anamazing level of detail. For example, we might learn that a dedicated server process has been waiting 30
pdfcrowd.comopen in browserPRO version
Are you a developer? Try out theHTML to PDF API
milliseconds for the operating system to read eight blocks from data file 42, starting at block 18042. We can alsosee summary information of how much time each Oracle process has spent waiting on each type of wait event forthe duration of the process, and we can also direct an Oracle process to write detailed wait event data to a trace file.
Why Wait Event Information is Useful
Using the wait event interface, you can get insights into where time is being spent. If a report takes four hours tocomplete, for example, the wait event interface will tell you how much of that four hours was spent waiting for diskreads caused by full table scans, disk reads caused by index lookups, latch contention, and so on.The wait event interface gives you much more information to work with than cache hit ratios do. The wait eventinterface gives both breadth and depth in the information it provides you. You get data that can touch upon so manydifferent areas of your database such as disk I/O, latches, parallel processing, network traffic, checkpoints, and row-level locking. At the same time, you get incredible detail such as the file number and block number of a block beingread from disk, or the name of a latch being waited on along with the number of retries.The wait event interface will not always give you all of the information you need in order to diagnose and solve aproblem, but it will certainly point you in the right direction. You might think the buffer cache is too small because thecache hit ratio is only 70%, but in fact, the application's slow response time could be caused by latch contention inthe shared pool, a bottleneck in the log writer, or any of a number of other things.
Common Wait Event Names and What They Mean
Although there are many different types of wait events, the majority of them come up very infrequently or tend not tobe significant. In practice, only a few dozen wait events tend to be of interest to most DBAs. The rest are ratherobscure, or pertain to Oracle features not in use, or occur so infrequently that you don't need to worry about them.You'll see different wait events surfacing in different environments based on which Oracle features have beenimplemented. For example, the PX wait events won't appear if you aren't using parallel query, and the virtual circuitstatus wait event won't appear if you are not using the multi-threaded server.Here are some of the most common wait events, and what they mean:

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->