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

Home -> Community -> Usenet -> c.d.o.server -> Re: tnsnames.ora posted to web page(use TNS_ADMIN?)

Re: tnsnames.ora posted to web page(use TNS_ADMIN?)

From: Howard J. Rogers <hjr_at_dizwell.com>
Date: Wed, 19 May 2004 11:04:31 +1000
Message-ID: <40aab290$0$3033$afc38c87@news.optusnet.com.au>


Chuck B wrote:
> Hello All,
>
> My new company posts their common tnsnames.ora file to a web page on
> the intranet that everyone has access to. The idea is that when they
> update it, you just go get the copy and overwrite your local tns file.
> What I would like to do is to set the registry entry(TNS_ADMIN) to
> point to that web page if possible. I know how to tweak the entry to
> point it to a non-standard location and I can accomplish this fine.
> However, I don't think it's possible to have the registry entry
> resolve an http address. Nothing I'm trying is working.
>
> Has anyone tried this?
>
> Thanks,
> Chuck

A rather "unusual" request, Chuck. What's the real issue here: you want to be able to modify a centrally-stored tnsnames.ora file, and have uses automatically pick the new version up without users having to manually click anything.

Right?

Well, a couple of things spring to mind if that's the case. First off, Oracle has a whole raft of solutions for such centralised management. Things like Names Server, or the more-complex-but-with-a-future Oracle Internet Directory.

But if you're trying to do centralised tnsnames administration on the cheap, then just stick the tnsnames.ora on a file server to which all clients have access and set each client's TNS_ADMIN variable to that location.

For example, from my laptop, I can do this using a local tnsnames:

H:\>sqlplus "/@win92 as sysdba"

SQL*Plus: Release 9.2.0.1.0 - Production on Wed May 19 10:51:39 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production

But if I do this:

H:\>copy C:\oracle92\network\admin\tnsnames.ora \\mozart\files

         1 file(s) copied.

And this:

H:\>copy C:\oracle92\network\admin\sqlnet.ora \\mozart\files

         1 file(s) copied.

Followed by (just so I know the local files really aren't still working in the background):

H:\>rename c:\oracle92\network\admin\tnsnames.ora tnsnames.old H:\>rename c:\oracle92\network\admin\sqlnet.ora sqlnet.old

Then I can do this:

H:\>set TNS_ADMIN=\\mozart\files

H:\>sqlplus "/@win92 as sysdba"

SQL*Plus: Release 9.2.0.1.0 - Production on Wed May 19 10:56:52 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production

In other words, I am connected to my database by relying on a tnsnames file which is no longer stored on my laptop but which is stored on a file server to which my laptop has network access.

It is, of course, an absolutely hopeless way of attempting to save yourself time and effort, because if that file server goes down, not one of your clients will be able to resolve connection requests, and thus not one of them will be able to connect to the database.

This 'on-the-cheap' meachanism is cheap precisely because it lacks the redundancy and resilience that the "proper" centralised names resolution solutions provide out of the box.

But if you really want to go this route, then it's do-able. Now, given that the website you refer to in your post allows users to download a fresh copy of a tnsnames.ora, then it stands to reason that you already have a centralised copy of the file, and instead of trying to set TNS_ADMIN to a web page (which is never going to work), just set it to whatever location the "new tnsnames" hyperlink on that web page currently points to.

Regards
HJR Received on Tue May 18 2004 - 20:04:31 CDT

Original text of this message

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