Msg 7399, Level 16, State 1 Linked Server. Access Denied

I setup a linked server on a new database server and was trying to run a query that runs against an Oracle database and I got the following error:

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider “OraOLEDB.Oracle” for linked server “ccbtst” reported an error. Access denied.
Msg 7350, Level 16, State 2, Line 1
Cannot get the column information from OLE DB provider “OraOLEDB.Oracle” for linked server “ccbtst”.

I have set this up on other servers, what did I forget to do?

To troubleshoot, first I open up the provider. In this case, it was the OraOLEDB.Oracle provider.

I forgot to enable Allow inprocess.

Here it is correctly enabled.

What does Allow inprocess do? From the documentation:

"allows the provider to be instantiated as an in-process server. When this option is not set, the default behavior is to instantiate the provider outside the SQL Server process. Instantiating the provider outside the SQL Server process protects the SQL Server process from errors in the provider. When the provider is instantiated outside the SQL Server process, updates or inserts referencing long columns (textntext, or image) are not allowed."

To read more about the settings available for linked servers, the documentation is a good read: https://docs.microsoft.com/en-us/sql/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine?view=sql-server-ver15

Now I attempt to run my query, and it succeeds.

Happy querying!

Advertisement

7 thoughts on “Msg 7399, Level 16, State 1 Linked Server. Access Denied”

    1. I have exactly the same error, on a sql server 15.0.2095.3, but enabling Allow inprocess doesn’t fix the error. Would I need to reboot the server after setting this?

      Like

  1. I found that using square brackets around the linked server fixed my problem:
    select * from openquery([Linked_server_name]), …
    instead of
    select * from openquery(Linked_server_name), …

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s