Page 1 of 1
TNS-Alias / actual content
Posted: Thu 28 Mar 2019 06:45
by Yahia
Hi,
I can get the list of TNS aliases (GetServerList)... BUT:
is there a way to get the content from TNSNAMES.ORA which is associated with a specific TNS-Alias?
Best Regards
Yahia
Re: TNS-Alias / actual content
Posted: Mon 01 Apr 2019 16:51
by Pinturiccio
dotConnect for Oracle does not have a feature to get TNS-Alias content. You can get the tnsnames.ora content of desired home and parse it yourself. You can get the content in the following way:
Code: Select all
OracleHome home = OracleConnection.Homes["Home_name"];
var path = home.Path + @"\network\admin\tnsnames.ora";
String content = File.ReadAllText(path);
Where you need to replace "Home_name" with the actual name of the desired home. Please also note that OracleConnection.Homes returns only homes of the same bitness as your application.