The output from tnsping (or tnsping80) contains the host name.

C:\TEMP>tnsping db1

TNS Ping Utility for 32-bit Windows: Version 8.1.7.1.0 - Production on
12-JUL-2001 23:43:26

(c) Copyright 1997 Oracle Corporation.  All rights reserved.

Attempting to contact (ADDRESS=(PROTOCOL=TCP)(Host=db3serv)(Port=1521))
OK (100 msec)

Also, in the later version of Oracle:

select HOST_NAME from v$instance;

-----Original Message-----
From: Jeff Holt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 12:30 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; Cary Millsap
Subject: Identifying the server connected to via
DBI->connect("dbi:Oracle:")


I've written some perl that, given a TNS alias, will get the hostname from
the effective tnsnames.ora file. My problem is I don't know how to get the
hostname if the client's using Oracle*Names. For such a configuration there
is no tnsnames.ora file to parse.

Is there something in DBI or DBD::Oracle that reveals components of the TNS
alias description? If not, is there some API that would allow someone to
retrieve the TNS alias description from 'the master' (i.e., an Oracle*Names
server)? If there is such an API and no one has written a perl wrapper for
it, I'd be willing it.

Thanks,
Jeff

Jeff Holt
Chief Scientist, Hotsos LLC
mailto:[EMAIL PROTECTED]
+1.817.821.9553 tel
+1.413.480.7346 fax
http://www.hotsos.com

Join the Oracle Performance Revolution!

Reply via email to