Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use TNSNAMES.ora files

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains how to use TNSNAMES.ora file. Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "how to use TNSNAMES.ora file"!

This file is similar to the unix hosts file, providing a tnsname to hostname or ip mapping, and will only be attempted if sqlnet.ora has something like NAMES.DIRECTORY_PATH= (TNSNAMES), i.e. TNSNAMES is in the order in which the client parses the connection string.

I. Examples

ORCL =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

II. Description of TNS parameters

1. PROTOCOL: The protocol for communication between the client and the server, generally TCP, which generally does not need to be changed.

HOST: The machine name or IP address of the machine where the database is listening. Database listening is generally on the same machine as the database, so when I say the machine where the database is listening, it generally refers to the machine where the database is located. Under UNIX or WINDOWS, the machine name can be obtained by using the hostname command from the command prompt of the machine on which the database is listening, or the IP address can be obtained by using the ipconfig(for WINDOWS) or ifconfig (for UNIX) commands. It should be noted that regardless of the machine name or IP address, the client must use the ping command to ping the machine name of the machine where the database is listening, otherwise it is necessary to add the resolution of the machine name of the machine where the database is listening to the hosts file.

PORT: The port on which the database listens can be viewed in the server-side listener.ora file or at the command prompt of the machine on which the database listens through the lnsrctl status [listener name] command. The Port value here must be the same as the port on which database listening is listening.

SERVICE_NAME: On the server side, after logging in with the system user, sqlplus> show parameter service_name command is used to view it.

5. Optional parameters

a) FAILOVER

b) LOAD_BALANCE

c) RECV_BUF_SIZE

d) SDU

e) SEND_BUF_SIZE

f) SOURCE_ROUTE

g) TYPE_OF_SERVICE (e.g. rdb)

At this point, I believe everyone has a deeper understanding of "how to use TNSNAMES.ora file," so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report