[oracle][The most complete in history] Detailed alias tnsnames.ora file

effect

A file required by the oracle client. Through this file, the connection address of the database can be configured. After configuration, there is no need to enter the complete oracle address, and a simple string can be used instead.

For example, the local database address is: 127.0.1.1:1521/orcl, by setting tnsnames.ora, give it an alias name: cuei7, you can use cuei7 instead.

configuration

Oracle official website-tnsnames.ora

The specific configuration method is as follows:

Find the installation directory of baioracle. General path such as: C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN

Open it in text mode and add the following content. The Chinese part is the part that needs to be modified. Except for the first "local instance name", you need to consult with the remote database administrator. The local instance name is a name that is convenient for you to identify the database. Can be customized.

#别名# =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = #ip#)(PORT = #端口#))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = #实例#)
    )
  )

Open pl/sql and you can see the link you created, as shown in the figure:

Extended information

1. tnsnames.ora is a network service configuration file used on the oracle client side to configure the alias parameters of the user to connect to the database. This file records the local configuration of the client accessing the database, in fact, it defines the network service.

2. The three files of Listener.ora, tnsnames.ora and sqlnet.ora are the three main files related to orale network configuration, among which listener.ora is related to the database server side, and the two files of tnsnames.ora and slqnet.ora Files are not only related to the server side, but also closely related to the client side.

Source: work&personal opinion&invasion

Guess you like

Origin blog.csdn.net/qq_39194322/article/details/127189004