How to correctly configure the tnsname. ora File

Source: Internet
Author: User

To correctly configure the tnsname. ora file, you can use the Oracle Net Configuration Assistant or Oracle Net Manager graphical Configuration tool on the client machine to configure the client. The Configuration tool actually modifies the tnsnames. ora file. Therefore, we can directly modify the tnsnames. ora file. The following example uses directly modifying the tnsnames. ora file :... Networkadmintnsnames. ora (for windows )... /Network/admin/tnsnames. ora (for unix) Here, assuming the server name is testserver, the service name is orcl.testserver.com, and the listening port used is 1521, tnsnams. A test network service name (Database alias) in the ora file is:

    test =         (DESCRIPTION=             (ADDRESS_LIST=                 (ADDRESS=(PROTOCOL=TCP)(HOST=testserver)(PORT=1521))             )             (CONNECT_DATA=(SERVICE_NAME=orcl.testserver.com)             )         ) 

 

PROTOCOL: the PROTOCOL for communications between the client and the server, which is generally TCP. HOST: The name or IP address of the machine on which the database listens. The database listens on the same machine as the database, so when I say that the machine where the database listens is generally the machine where the database is located. In UNIX or WINDOWS, you can use the hostname command at the command prompt of the machine on which the database listens, or use ipconfig (for WINDOWS) or ifconfig (for UNIX) command to obtain the IP address. Note that, whether using the machine name or IP address, you must ping the Host Name of the machine where the database is listening on the client, otherwise, the host name of the machine where the database listening is located must be added to the hosts file. PORT: the PORT on which the database listens. You can view the listener. ora file on the server or run the lnsrctl status [listener name] command at the command prompt on the machine where the database listens. The Port value must be the same as the Port on which the database listens. SERVICE_NAME: on the server side, run the "sqlplus> show parameter service_name" command after logging on to the system.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.