Command line to change tnsnames.ora

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

[EDIT] I was looking for something similar to odbcconf.exe (for editing an ODBC connection in Windows) to modify the tnsnames.ora file.

[EDIT2] I am using MSBUILD from my auto build script. The MSBuild Community Tasks Project has an AddTnsName task that exactly matches me. My googling skill should be weak. I should have looked for MSBuild and tnsnames.ora instead of the tnsnames.ora command line. However, it surprises me that Oracle does not provide a command line utility like odbcconf for tnsnames.ora.

+5
source share
4 answers

IMO, this file is best supported with an editor, but there is a GUI for the network configuration adapter that guides you through the steps to create it.

[Change] Now I see from your additional comments that you are looking for the possibility of adding entries to the script, and there is no direct answer to your question, there is no Oracle utility for this. You will have to come up with some solution cat | sed | awk yourself.

+2
source

As the connection parameter, you can specify the whole line TNS:

sqlplus "scott/tiger@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYSERVICE)))"

Alternatively, if your client supports syntax EasyConnect, you can only choose this:

sqlplus scott/tiger@//127.0.0.1/MYSERVICE
+4
source

VI? ? um...

+2

tnsnames.ora ( ) . $ ORACLE_HOME/network/admin.

: , , .

How it works The tnsnames.ora file contains information about connecting to the remote database to which you want to connect. First, the request is sent to the listener working in the target database, and then the connection is established.

Both the listener and the database must be running on the target server (to which you want to connect). Otherwise, the connection will not be established.

0
source

All Articles