Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Is the database server on the local machine?
the_bitbucket_at_canada.com (Lenny Palozzi) wrote in message news:<2151c418.0412020954.4a0fd0ae_at_posting.google.com>...
> That's good news. At least the information is readily available, but
> the suggestions so far are for after the connection is made the
> server. I'd really like to be able to obtain the Oracle server's
> hostname and/or ip address before making the connection. Is there a
> way to reliably do this?
>
> ~Lenny
If you have the service name handy then, a) you can locate and parse the tnsnames.ora file.... Messy. b) You can parse the returned string from call to tnsping <service name>. It lists (HOST=<Host Name>) if protocol is TCP.... a bit simpler and easier.
Don't know how else you can get it.
Regards
/Rauf
Received on Thu Dec 02 2004 - 17:25:05 CST