'Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server

I am trying to query data from linked server. It is giving me the following error:

TNS:listener does not currently know of service requested in connect descriptor". Msg 7303, Level 16, State 1, Line 4 Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server



Solution 1:[1]

Chances are very high that your service name doesn't match a name in your tnsnames.ora file. It's either not registered or registered with a different name.

The following blog post has a really good set of steps to walk you through what to check for it, and for other common causes:

https://logic.edchen.org/how-to-resolve-ora-12514-tns-listener-does-not-currently-know-of-service-requested-in-connect-descriptor/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Greg Low