Examining OLEDB waits

On our adventure through the various types of wait statistics we end up at another popular wait type: OLEDB.
In this article we will take a closer look at OLEDB waits to help you understand where they come from.


OLEDB or, Object Linking and Embedding DataBase, is a Microsoft COM interface to access data.
Microsoft describes OLEDB on MSDN as follows:

“OLE DB is a set of COM-based interfaces that expose data from a variety of sources. OLE DB interfaces provide applications with uniform access to data stored in diverse information sources, or data stores.”

Generally we will see OLEDB waits when we make a call to an OLE DB provider and we are waiting on our data.

Generating OLEDB waits

OLEDB waits happen a lot in environments that use linked servers (there are some exceptions, we’ll get into one specific one later in this article).

In this example I created a linked server configuration between 2 instances on my test server.

The first thing to do is to clear the sys.dm_os_wait_stats DMV, directly after that I will execute a query to the linked server, after that we will take a look at our wait statistics for the OLEDB wait:

DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR)

FROM [EVDL-SQL2012-03].[AdventureWorks2012].[Sales].[SalesOrderDetail]

SELECT * FROM sys.dm_os_wait_stats
WHERE wait_type = 'OLEDB'

These where the results on my server:


As you can see querying a linked server will result in OLEDB waits, if you have to option of not using linked servers to access data it is an easy way to lower OLEDB waits.

This is a pretty simple example and there are a lot more sources of OLEDB waits like Excel data sources, BULK IMPORT, applications that use OLEDB, etc.

There is a more surprising one however!


One of the more surprising ways to generate OLEDB waits is by using DBCC commands like DBCC CHECKDB() !

We can also test this pretty easy by running the query below:

DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR)

DBCC CHECKDB('master')>

SELECT * FROM sys.dm_os_wait_stats
WHERE wait_type = 'OLEDB'

We will first clear our wait statistics, run a CHECKDB on the master database and check the wait statistics for OLEDB again.

In my case I got this:


Lowering OLEDB waits

Now that we have seen some ways to generate OLEDB waits let’s discuss how we can lower the wait time for this wait type.

Since a lot of OLEDB waits tend to happen when you are using linked servers, minimizing the use of linked server will make the OLEDB wait time go down.

Netwerk performance problems can also cause higher wait times when using OLEDB with an application or linked server.

Also keep an eye out on your CHECKDB runs, as you have seen in the example above DBCC commands use OLEDB under the hood making OLEDB wait times higher when running a CHECKDB for instance.

37 comments to “Examining OLEDB waits”

You can leave a reply or Trackback this post.
  1. I’m amazed, I have to admit. Rarely do I come across a blog that’s both equally educative
    and interesting, and without a doubt, you’ve hit the nail on the
    head. The issue is an issue that too few folks are speaking intelligently about.

    I am very happy I found this in my search for something concerning this.

  2. Simply wish to say your article is as surprising.
    The clearness in your post is simply cool and i could assume you are an expert on this subject.
    Fine with your permission allow me to grab your RSS feed to keep updated with
    forthcoming post. Thanks a million and please continue the enjoyable work.

  3. It’s not my first time to pay a visit this web page, i am visiting this
    web page dailly and take good information from here everyday.

  4. An outstanding share! I’ve just forwarded this onto a friend who had been doing a little homework on this.
    And he actually ordered me dinner simply because I discovered it
    for him… lol. So allow me to reword this…. Thanks for the meal!!

    But yeah, thanx for spending some time to talk about this subject here on your internet site.

  5. It’s really a cool and useful piece of information. I am happy that you
    just shared this useful information with us.
    Please keep us informed like this. Thank
    you for sharing.

  6. A lot of what you articulate is supprisingly accurate andd
    that makes me poonder why I had not looked at this in this light before.
    Thiss particular piece really did turn the light on for me aas far as this particular
    topic goes. However there is actually just onne point I
    am not too comfortable with so while I make an effort to reconcile
    that with the actual main theme of your point, permit me see what
    the rest of your subscribers have to poibt out.Very well done.

  7. My brother recommended I might like this blog.
    He used to be totally right. This put up actually made my
    day. You can not imagine simply howw a lot time I had spent
    ffor this info! Thanks!

  8. I’m impressed, I have to admit. Rarely do I come across a blog that’s both educative and engaging, and let me tell you,
    you’ve hit the nail on the head. The problem is an issue
    that too few people are speaking intelligently about. Now i’m very happy I came across this during
    my hunt for something relating to this.

  9. If you are thinking about a fresh movie clip and want to reduce a
    little bit bodyweight, blend the two desired goals!
    Start off operating and practicing for a half marathon, or you may start figuring out how to
    go swimming and start skating for those who have a swimming pool all around during the summer.Whatever, physical fitness
    is actually a movie that positive aspects your overall health.

Write a Reply or Comment

Your email address will not be published.