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: How to programatically/dynamically update tnsnames.ora

Re: How to programatically/dynamically update tnsnames.ora

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 31 Jul 2003 10:28:28 -0700
Message-ID: <92eeeff0.0307310928.76cebe18@posting.google.com>


avsrk_at_mailcity.com (Subrahmanyam Arya) wrote in message news:<25c1993e.0307310552.30cbe292_at_posting.google.com>...
> 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

I personally don't think it's a good idea to modify tnsnames.ora programatically. Look for a better solution.

Having said that, if you can parse the entries in tnsnames file then theoretically you can update them. A while back I had written a tnsnames parser in java. It can parse all entries plus also has some other usefull functions. If you are interested, email me and I can send you the .java source code which you maybe able to use in your env.

Adding new entries should be trivial as you can just append them at the end of the file. Just make sure to format the connect url properly.

Regards
/Rauf Sarwar Received on Thu Jul 31 2003 - 12:28:28 CDT

Original text of this message

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