1

Does Managed ODP.NET x64 12.1.0.2 tnsname.ora support using IFILE?? I cannot get it to work.

For example, with the normal "thick client" unmanaged Oracle client that I have had installed for years, I used to have my tnsnames.ora file with one line in it:

IFILE=C:\OracleDataSources\tnsnames.MAIN

And then the C:\OracleDataSources\tnsnames.MAIN file contains IFILE references to config files that contain the actual data source definitions for each of the other Oracle instances within our organization. This helps to keep our config files centralized and separate from install files, and works with no errors when using the full Oracle client install.

Now I am working on upgrading some code that used the older/deprecated System.Data.OracleClient references to use ODP.NET managed client. If I try to use IFILE references with the managed ODP.NET libraries, I get the following error:

ORA-12154: TNS:could not resolve the connect identifier specified

During troubleshooting, I confirmed that no data sources are being retrieved from tnsnames.ora by using the Oracle.ManagedDataAccess.Client.OracleDataSourceEnumerator.GetDataSources() method (http://docs.oracle.com/html/B28089_01/OracleDataSourceEnumeratorClass.htm#CBAHABEH ), which will return a list of all data sources enumerated from tnsnames.ora.

When only IFILE references are used in tnsnames.ora, I get 0 results from GetDataSources. If I manually add the data source aliases directly to the tnsnames.ora file in the folder specified in web.config TNS_ADMIN settings (instead of using IFILE references), then the data sources are returned from GetDataSources correctly, and I can connect to the data source successfully using ODP.NET.

Is there any way to use IFILE tns names references with ODP.NET?

BateTech
  • 5,780
  • 3
  • 20
  • 31

1 Answers1

4

Sorry, IFILE is neither supported in the config file nor in TNSNAMES.ORA when using ODP.NET, Managed Driver.

Perhaps the TNS_ADMIN config file entry will achieve the same thing for you.

Christian Shay
  • 2,570
  • 14
  • 24
  • This definitely appears to be the case. Is there any official documentation that you found that says this that you could point me to? Also do you know if the unmanaged ODP.NET supports IFILE? Thanks – BateTech Oct 31 '14 at 12:10
  • I just noticed that you are on the Oracle ODP.NET product team. I think that is official enough for me! Thanks for the help. I can consolidate all of my tnsnames entries into one tnsnames.ora file and that'll work for me. The TNS_ADMIN is another good option as well. From initial testing I really like the managed ODP.NET libraries! – BateTech Oct 31 '14 at 12:31
  • 1
    Yes, unmanaged ODP.NET supports IFILE along with all the other TNSNAMES parameters (we don't have to implement a managed version of it in that case - it is already handled by the unmanaged networking libraries). – Christian Shay Nov 01 '14 at 09:00