Re: getting the tns entry for a connection?

From: Malcolm Dew-Jones <>
Date: 28 May 2009 10:52:33 -0700
Message-ID: <4a1ecf61$> wrote:
: If I connect to scott/tiger_at_FOO, is it possible to get
: a copy of the FOO TNS definition?

: I'm doing some connection testing, and I want to print
: out TNS of the current connection so I can verify I'm
: testing the right options.

Do you mean from within the database while connected?

In sqlplus I use

	   '&_O_RELEASE' Release,
	   USER          Username,
	from global_name;

I forget which version you need to be able to use &_CONNECT_IDENTIFIER.

Global name does not depend on sqlplus, but the & vars do (and can also be easily viewed by just typing DEF with no parameters in sqlplus.

Also look at SYS_CONTEXT('USERENV',xx), it has some things that are useful, in this case you might be interested in DB_DOMAIN DB_NAME DB_UNIQUE_NAME HOST, and maybe others.

$0.10 Received on Thu May 28 2009 - 12:52:33 CDT

Original text of this message