Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Have host (Tnsname), need Machine:Port:Sid in PL/SQL ?

Re: Have host (Tnsname), need Machine:Port:Sid in PL/SQL ?

From: Christof Kaiser <kaiser_at_logiball.de_no_spam>
Date: Thu, 25 Mar 2004 15:48:00 +0100
Message-ID: <4062f110$0$274$4d4ebb8e@read.news.de.uu.net>


Douglas,

thanks for your input!

Yes I know there can be many tsnnames. I am intrested in the one which is used if I start sqlplus on the local machine eg sqlplus scott/tiger_at_orcl

The reason why I am after this is a migration of our application form OCI8 to JDBC connections:

Till now, it was pretty much script based, and one "administration schema" was holding the available data schemas. including username and host. This was done to allow our application (GUI) to present a list of available schemas holding data.

But now, we migrated the application to something java based, using jdbc rather then oci8 to access oracle. hence, in the "admin schema", we need these machine:1521:sid strings stored rather then the host (and of course a proper tnsnames).

This replacemnet (host replaced by machine:port:sid should be done only once during the migration.

Another way would be defining and filling a table with all hosts and corresponding jdbc information. However, it would be cooler to do it automatically.

Regards
Christof

>>Christof
>>

>
> Christof,
>
> From your post, I assume you are running a stand alone system with the
> server and clients on the same box. If not, there can be many TNSNAMES.ORA
> lurking on the network and you would need to specify which one you want to
> look at.
>
> I think I will have to ask why you want to know these details. What problem
> are you trying to solve? Once the group has an idea of the problem, we can
> offer some solutions.
>
> Douglas Hawthorne
Received on Thu Mar 25 2004 - 08:48:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US