Search code examples
oraclemsbuildoracleclienttnsnames

Commandline to modify tnsnames.ora


Is there a command line utility to modify the tnsnames.ora file for the oracle client?

[EDIT] I'm looking for something similar to odbcconf.exe (for editing ODBC connection on windows) to modify the tnsnames.ora file.

[EDIT2] I'm using MSBUILD from my automated build script. The MSBuild Community Tasks Project has an AddTnsName task that fits exactly what I need. My googling skillz must be weak. I should have been searching for MSBuild and tnsnames.ora instead of command line tnsnames.ora. However, it does surprise me that Oracle does not supply a command line utility like odbcconf for tnsnames.ora.


Solution

  • IMO, this file is best maintained with an editor, but there is a Net Configuration Assistant GUI that will lead you through the steps to create one.

    [Edit] I see from your additional comments now that you're looking for a scriptable way to add entries, and the direct answer to your question is no, there's no Oracle utility to do this. You'll have to come up with some cat|sed|awk solution on your own.