I have used a tool called binsub.exe to edit/update .INI files on the fly.  Is there a utility out there to edit/update/replace text within a TNSNAMES.ORA file?  I need something that can be run form the command line that will run in Silent Mode.

Thanks.

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
0

Hi there, i've got quite a similar issue, i have a package which installs files to c:\filepath, some of these files have got TEXT entries in them which points to a server , my task now is to edit those server entries and change them to point to "c:\my desired file path".

Whats the best way of achieving this task without using a "REPLACE ALL" approach. Thx

Answered 03/06/2007 by: noodles187
Orange Belt

Please log in to comment
0

Maintaining tnsnames.ora can be a beastly task. [Edit] Um, the direct answer to your question is that I am not immediately aware of a utility that will do what you want to do in a perfectly ideal way, however, there are a variety of text manipulation tools available to you, including the Read/Update Text File and Insert Line of Text commands in WiseScript. There may even be some spiffy scripts out there to help you out. The problems with dynamically updating a text file, especially one as complex as tnsnames.ora, are avoiding duplicate entries and intelligently updating existing records. With that said, I usually avoid manipulating users' tnsnames.ora files. [/Edit]

In the environments in which I have worked, the solutions used included one or more of the following:

1) Establish an Oracle LDAP directory (similar in concept to a DNS server and much better than ONS (Oracle Names)) and point all users to this central directory.
Pros: You don't have to touch the desktops anymore. Just update the directory and everybody can instantly access the new instances. Users don't have to be logged into the network.
Cons: Requires Oracle 8i or better and requires the LDAP module to be installed on all desktops. But you currently have to touch all the desktops anyway. Users must be connected to the network, but they should be anyway if they're accessing Oracle databases.

2) Maintain a master tnsnames.ora file on one or more central file servers and include it in each user's sqlnet.ora file. As far as I know, you can include as many tnsnames.ora files in sqlnet.ora as you need, but you should check Oracle's documentation. Make sure the network copy is listed first so users can't override it.
Pros: Users can still add their own custom entries to their local tnsnames.ora without affecting the network copy.
Cons: Users have to be connected to the network and be logged in in order to access the central file server(s).

3) Maintain a master tnsnames.ora file and push it to each user's desktop. Name the master tnsnames file something like mastertnsnames.ora to avoid confusion with the user's tnsnames.ora and include it in the sqlnet.ora file.
Pros: Users can still add their own custom entries to tnsnames.ora. Users do not need to be logged in.
Cons: Keeping everyone up to date presents its own set of challenges, especially if updates are frequent. Users could accidentally edit the local mastertnsnames.ora file, but you can probably take precautions to prevent this.

In all these cases, everyone gets access to everything in the central directory or master TNS file, but I assume that this is not an issue since the users still need login credentials to access the databases.

--Josh

Answered 02/18/2007 by: mazessj
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity