Dear all,
I would like to use my own connect box, using a username/password that do not correspond to a oracle user.
Is there a way to get the list of the available aliases in tnsnames.ora?
Regards,
Alain
get tnsnames alias list?
You can use the following code:
Code: Select all
uses
OraServices;
...
var
Enum: TOraServerEnumerator;
List: TStringList;
begin
List := TStringList.Create;
Enum := TOraServerEnumerator.Create;
try
Enum.GetServerList(List);
finally
Enum.Free;
end;
end;
BUG on TOraServerEnumerator.GetServerList method

I have found a connection definition like the example below :
Code: Select all
: TNSNAMES.ORA
SRV1, SRV2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.10.10)(PORT = 1521))
)
(CONNECT_DATA =
(SID = MYORA)
(SERVER = DEDICATED)
)
)
I would like a solution for that issue once this way of setting up connections is documented by Oracle.
Even though the GetServerList method does not return the correct tnsnames server list, the TSession. Connect method works perfectly with any of the two names defined on this way.
Thanks a lot.
Eng. Jayme Jeffman Filho ( Mr )
DBA
Re: get tnsnames alias list?
How I can get information in form "IP:port\sid" (example: 127.0.0.1:1521\orcl)?
Can I get IP:port information from tnanames using ODAC?
Can I get IP:port information from tnanames using ODAC?
Re: get tnsnames alias list?
Hello,
Using ODAC, you won't be able to retrieve parameters specified in the tnsnames.ora file, connection string parsing is performed in the OCI.dll library. If you need to retrieve this information, you should implement your own parser for the tnsnames.ora file
Using ODAC, you won't be able to retrieve parameters specified in the tnsnames.ora file, connection string parsing is performed in the OCI.dll library. If you need to retrieve this information, you should implement your own parser for the tnsnames.ora file