Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to programatically/dynamically update tnsnames.ora
There appears to be conflicting info in your post. Database links use
tnsnames.ora information that is stored on the database server where the
database resides that will contain the database link. But, you say
"customers edit the tnsnames.ora" . So, customers are logging into the
database server ?!! Yikes!
Hopefully, your comments were not completely accurate. I would hate to think customers are editing the tnsnames.ora ON THE SERVER!
Anyway, editting or parsing the tnsnames.ora is never needed and should never be done. You are asking for support trouble down the road.
Couple of suggestions , assuming you really need to add databases dynamially:
(1) For a database link, someone has already posted a reasonable solution where you just put the tnsnames.ora info into the using value. This of course will eventually cause problems when the server changes or SID changes or maybe port changes. Then, not only will someone have to update the tnsnames.ora (used by other things?) , but all the database links you create will need to be changed too.
(2) For client/server (not database links which are more like client-to-server1-to-server2), use the centralized methods mentioned above. No client config is ever needed , after the initial setup (sqlnet.ora).
-- "Subrahmanyam Arya" <avsrk_at_mailcity.com> wrote in message news:25c1993e.0307310552.30cbe292_at_posting.google.com...Received on Sat Aug 02 2003 - 18:03:34 CDT
> Dear oracle gurus,
>
> This is exactly my scenario. I have a java application which talks to
> Master oracle DB. From with in this java application, i create
> database links to remote oracle databases and do queries. the database
> links are dynamically created as and when new remote database comes
> up.
> Presently we are distributing this application and are having the
> customers edit the tnsnames.ora either manually or use them netasst
> (SQL Net configurator)
>
> But eventually we do not want them to edit manually.
>
> Has anybody attempted to programatically update the tnsnames.ora
> either using a unix script or from inside java. are there any bad
> consequences to doing this.
>
> Previously i had miserable experience with editing this file manually
> and things did not work until i used netasst (SQL Net program).
>
> Another reason why we donot want customers to edit tnsnames / use SQL
> Net is licensing restrictions and contractual obligations. We got
> oracle licenses for cheap and we cannot expose oracle or expect the
> end user to do any kind of DBA activity
>
> So what i am looking for is some easy custom script / tool that does
> exactly what SQL.Net does to tnsnames.ora
>
> -thx,
> avsrk