5 Replies Latest reply: Nov 6, 2009 1:46 PM by Fahd.Mirza RSS

    what is TNS name?

    732618
      Hi, I installed oracle 11g..and downloaded ojdbc5.jar driver..
      when using this jar in netbeans to add the driver to connect to data base it is asking TNS name..
      may i know what th eTNS name is?
      my db domain is xwss@sureshdomain.com/1521..
      thanks
      suresh
        • 1. Re: what is TNS name?
          asifkabirdba
          Go to this link. It will be helpful.


          http://download.oracle.com/docs/cd/B19306_01/network.102/b14213/tnsnames.htm


          http://www.orafaq.com/wiki/Tnsnames.ora


          Regards
          Asif Kabir
          • 2. Re: what is TNS name?
            Robert Geier
            Tns name is the name of the entry in tnsnames.ora file which is kept in $ORACLE_HOME/network/admin

            Some JDBC drivers connect with a connection string, some can use a TNS name.

            E.g

            mydb =
            (DESCRIPTION =
            (ADDRESS = (PROTOCOL = TCP)(HOST = myserver )(PORT = 1521))
            (CONNECT_DATA =
            (SERVER = DEDICATED)
            (SERVICE_NAME = mydb)
            )
            )
            • 3. Re: what is TNS name?
              LaurentLeturgez
              a tns name is a name which is resolved to access a database :
              For example:

              myname =
              (DESCRIPTION=
              (ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=linux1)(PORT=1521)))
              (CONNECT_DATA=(SERVICE_NAME=mySID))
              )

              myname is resolved on
              - a host: linux1
              - a TCP port: 1521 (where the listener is listening on)
              - a database service which is know by the listener : mySID

              It's a simple way to resolve a name to an oracle database instance on the network.

              Laurent
              • 4. Re: what is TNS name?
                Billy~Verreynne
                What is a TNS? It is an alias.

                Like a hostname is an alias for an IP address, a TNS is an alias for an OCI (Oracle Call Interface) connection string. This string identifies the database server and database instance to connect to. It also can include load balancing parameters, request a specific type of connection, connection to a specific database service, etc.

                The file +/etc/hosts+ (on Unix) or c:\windows\system32\drivers\etc\hosts (on Windows) is used to store the list of hostname (aliases) for IP addresses.

                Similarly, Oracle has a file called tnsnames.ora that contains TNS aliases with the corresponding connection strings. This is usually in the +%ORACLE_HOME%\network\admin+ directory. You can also set the environment variable called TNS_ADMIN and point it to any user directory you want to use that contains your tnsnames.ora file.
                • 5. Re: what is TNS name?
                  Fahd.Mirza
                  and in addition to above answers, TNS stands for Transparent Network Substrate.

                  regards