Click here to Skip to main content
15,881,204 members
Articles / Database Development / SQL Server / SQL Server 2012
Tip/Trick

SQL Server - Linked Server Query - Unexpected Catastorphic Failure

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
19 Jun 2014CPOL1 min read 17.9K   5   1
This briefly goes over an issue experienced when executing a query against a linked server to Oracle from SQL Server.
I was experiencing this issue and sometimes the database would go into recovery - and rarely would take the server offline.  Error returned from SQL Server:
 
The OLE DB provider "OraOLEDB.Oracle" for linked server "SQXYZ" reported an error. The provider reported an unexpected catastrophic failure.  An error occurred while submitting the query text to OLE DB provider "OraOLEDB.Oracle" for linked server "SQXYZ".
 
Here are my suggestions if you experience the error above.
  1. First - Test the connection for the linked server.  You can do this using sp_testlinkedserver [ @servername ] or by right clicking on the linked server in Server Object > Linked Servers and choosing Test Connection.  If this fails then ensure the remote sever is online and that the credentials supplied are correct.
     
  2. See if you are able to execute a very simple query to a small table that you should be able to access using the same linked server reporting the problem.
    Example:

    SELECT * FROM OPENQUERY
    (
    YOURLINKEDSERVER,
    N'
    SELECT *
    FROM SOMETABLE
    '
    );

If you don't experience an issue with this query then I suggest reviewing the syntax inside your OPENQUERY command text.  See if you have any comments in the code, uncommon commands, or special formatting.  The OLE DB prodvider doesn't always handle these items very well.

My issue was the comments in the OPENQUERY command text.  Once I removed the comments I was able to execute without errors.

I hope this provides some assitance.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
Lydia Gabriella16-Jul-14 10:54
Lydia Gabriella16-Jul-14 10:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.