Pages

Tuesday, August 2, 2011

Remote Query (Linked Server) Connection Time-Out Issue & Solution

Today, I faced an issue while running a long MDX query in terms of execution time. I went through so many posts on this issue, but didn't get any answer. Below are the details:

Error Message: 
"OLE DB provider "MSOLAP" for linked server "LINKED_SERVER_SSAS" returned message "XML for Analysis parser: The XML for Analysis request timed out before it was completed.".

Description: My SQL Server DB has a Linked Server connection (i.e. named "LINKED_SERVER_SSAS") to connect to SQL Server Analysis Services 2008 OLAP database. This connection is being used in Stored Procs & T-SQL queries to fetch stats from cube. I executed a MDX using this linked server connection, query ran for 10 mins and threw this error message.

Then I tried to ran MDX directly on Analysis Services which ran successfully & took around 18 mins. I checked multiple options to resolve the issue such as
  1. Linked Server Connection: Query Timeout property under Server Options
  2. SQL Server Analysis Services: Server Properties (including advance server properties)
  3. SQL Sevrer Management Studio: Query Execution Property
None of them were successful attempt in my case. 

Solution:
  1. Open SQL Server Database Instance Property where linked server is created.
  2. Go to Connections.
  3. Check "Remote query timeout" value under "Allow remote connections to this server" property. Update this value as per Query/Business requirement. (In my case this value was set to 600 secs.) 
As this value was 10 mins, my remote MDX query faced timeout issue. After updating value to 1800 secs remote MDX query executed successfully. 

Readers: Kindly share your comments & suggestions.

3 comments:

  1. Thank you for sharing this! It helped me today.

    ReplyDelete
  2. You'r most welcome, I m glad that this post helped you.

    ReplyDelete
  3. Good article and to the point!
    Saved me time and trouble.

    ReplyDelete