Retreiving domain name from SID? [message #188811] |
Mon, 21 August 2006 15:57 |
savar
Messages: 2 Registered: August 2006
|
Junior Member |
|
|
Hey,
What is the best way (if any) to retrieve the domain name (hostname) of a server given the SID of an instance running on it?
For example, I want to FTP files to the database server to use as source data for an external table. I want to be able to dynamically determine the name of the host to FTP to so that this same code works in multiple environments.
I can parse tnsnames.ora, but I'm hoping there's a more elegant approach -- something like a reverse DNS lookup, except for Oracle SIDs.
Any ideas?
Thanks,
|
|
|
|
Re: Retreiving domain name from SID? [message #188817 is a reply to message #188816] |
Mon, 21 August 2006 16:52 |
savar
Messages: 2 Registered: August 2006
|
Junior Member |
|
|
anacedent wrote on Mon, 21 August 2006 16:34 | >I can parse tnsnames.ora
At least for Unix, you can (easily) have multiple tnsnames.ora files; $ORACLE_HOME/network/admin, TNS_ADMIN, $HOME/.tnsnames.ora, etc.
The same alias can resolve to different SID on different hosts in different files.
|
Excellent point. So maybe its safer to parse the output of tnsping?
|
|
|