OLEDB Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: ASYNC_NETWORK_IORelated pillar: Performance & Troubleshooting
⚡OLEDB is the time SQL Server spends in calls to its OLE DB provider, for linked servers and also for internal work. High totals are often not linked servers at all: DBCC CHECKDB and monitoring tools that poll DMVs create lots of small OLEDB waits. Run the check and read the average per wait before deciding which story it is.

Microsoft’s definition: it occurs when SQL Server calls the SNAC OLE DB Provider (SQLNCLI) or the Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL), and it measures the duration of those calls rather than any synchronisation. The provider is used internally, for DBCC CHECK* commands and DMVs, as well as externally for linked servers and some SSIS packages, and it is recorded in preemptive mode.


Is It a Problem?

Check the shape before anything else. As a guide, an average of a few milliseconds or less over millions of waits is likely a monitoring tool polling DMVs, and part of your baseline; lots of small waits can also be DBCC CHECK*. Averages of tens or hundreds of milliseconds point at genuine linked server waits, which users feel directly when a remote source is slow. It was zero on our SQL Server 2025 lab. Get Wait Statistics does not filter it out, so if it ranks, you will see it.

Judge it over an interval rather than the cumulative totals: the baseline to monitor is the average wait per call, alongside your integrity check schedule.


Common Causes

  • DBCC CHECKDB and related commands.
  • Monitoring tools querying DMVs frequently.
  • Linked server queries to slow or overloaded remote servers.
  • Large result sets pulled across the link, or remote queries that cannot push their filters to the source.

The Check To Run

Rank it against everything else with Get Wait Statistics, then read the count and average:

SELECT
    wait_type,
    waiting_tasks_count,
    wait_time_ms,
    CAST(wait_time_ms * 1.0 / NULLIF(waiting_tasks_count, 0) AS DECIMAL(12, 2)) AS avg_wait_ms,
    max_wait_time_ms
FROM sys.dm_os_wait_stats
WHERE wait_type IN (
    N'OLEDB',
    N'MSQL_DQ',
    N'PREEMPTIVE_OLEDBOPS')
ORDER BY wait_time_ms DESC;

While it is happening, see who is in the call and what program they are:

SELECT
    r.session_id,
    r.wait_type,
    r.wait_time AS wait_ms,
    s.login_name,
    s.program_name,
    t.text AS running_sql
FROM sys.dm_exec_requests AS r
JOIN sys.dm_exec_sessions AS s ON s.session_id = r.session_id
OUTER APPLY sys.dm_exec_sql_text(r.sql_handle) AS t
WHERE r.wait_type LIKE N'OLEDB'
ORDER BY r.wait_time DESC;

A monitoring product’s program name, or a DBCC command, settles it quickly. Both queries need VIEW SERVER STATE.


What To Do

  1. If it lines up with integrity checks or a monitoring tool, it is part of your baseline. Check the tool’s polling interval if it seems excessive.
  2. For linked server time, push filters and aggregation to the remote side, for example with OPENQUERY and the full filtered query, so less data crosses the link.
  3. Stage remote data locally for recurring reports, and take slowness on the remote side to the team that owns that server.

The EXTERNAL Family

These waits are SQL Server waiting on code or servers outside itself: OLE DB providers, distributed queries and extended stored procedures. The time is spent in the external code. If one is near the top of your waits, read it next to the waits that usually matter.

  • OLEDBOLE DB calls. The duration of calls to the SQL Server OLE DB provider, for linked servers and some DBCC work.Worth a look when it climbs. This page.
  • MSQL_DQDistributed queries. Waiting for a distributed query operation to finish.Worth investigating
  • MSQL_XPExtended procedures. Waiting for an extended stored procedure to end.Worth a look when it climbs

Where To Go Next

If OLEDB is sitting near the top of your wait stats, these are the next places to look.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *