5 Replies Latest reply on Nov 6, 2009 7:46 PM by Fahd.Mirza

    what is TNS name?

      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..
        • 1. Re: what is TNS name?
          Go to this link. It will be helpful.



          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.


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

              myname =

              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.

              • 4. Re: what is TNS name?
                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?
                  and in addition to above answers, TNS stands for Transparent Network Substrate.