Three network configuration files in oracle

Source: Internet
Author: User

In the most recent project implementation, Oracle network problems were encountered, which were found during the redflag HA switchover test. Although I found the oracle network configuration file in my personal exploration, I don't know how they run.

Three configuration files
  
Listener. ora, sqlnet. ora, and tnsnames. ora are all stored in the $ ORACLE_HOME \ network \ admin directory.
  
Key points: Functions and usage of the three files
  
#-----------------------
  
Sqlnet. ora ----- functions similar to linux or other unix nsswitch. conf files. This file determines how to find a connection string that appears in the connection,
  
For example, we enter
  
Sqlplus sys/oracle @ orcl
  
Assume that my sqlnet. ora is like the following:
  
SQLNET. AUTHENTICATION_SERVICES = (CNT)
  
NAMES. DIRECTORY_PATH = (TNSNAMES, HOSTNAME)
  
Then, the client will first be in tnsnames. orcl records in the ora file. if there is no corresponding record, try to use orcl as a host name, resolve its ip address through the network, and then connect to the instance GLOBAL_DBNAME = orcl on this ip address, of course, here, orcl is not a host name.
  
If I look like this
  
NAMES. DIRECTORY_PATH = (TNSNAMES)
  
Then the client will only search for orcl records from tnsnames. ora
  
There are other options in brackets, such as LDAP, which are not commonly used.
  
#------------------------
  
Tnsnames. ora ------ this file is similar to the unix hosts file. It provides the corresponding tnsname to the host name or ip address, only when the file is similar
  
NAMES. DIRECTORY_PATH = (TNSNAMES), that is, the client will try to use this file only when TNSNAMES is in the order in which the client parses the connection string.
  
In this example, there are two local IP addresses corresponding to ORCL and another IP address corresponding to SALES, which also defines whether to use the master server or the Shared Server Mode for connection.
  
# Enter TNSNAME when you want to connect
  
ORCL =
  
(DESCRIPTION =
  
(ADDRESS_LIST =
  
# The host, port, and Protocol corresponding to this TNSNAME
  
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521 ))
  
)
  
(CONNECT_DATA =
  
# Use the dedicated server mode to connect to the server. The connection mode must match the server mode. If not, the connection is based on the server mode.
  
# Automatic Adjustment
  
(SERVER = DEDICATED)
  
# Corresponding service_name, SQLPLUS> show parameter service_name;
  
# View
  
(SERVICE_NAME = orcl)
  
)
  
)
  
# The following is similar
  
SALES =
  
(DESCRIPTION =
  
(ADDRESS_LIST =
  
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.188.219) (PORT = 1521 ))
  
)
  
(CONNECT_DATA =
  
(SERVER = DEDICATED)
  
(SERVICE_NAME = sales)
  
)
  
)
  
#----------------------
  
When the client is finished, let's look at the server.
  
Listener. ora ------ listener process configuration file
  
The listener process is not much said. The listener process accepts remote database access requests and transfers them to the oracle server process. Therefore, if you do not use a remote connection, the listener process is not required. Similarly, disabling the listener process does not affect the existing database connection.
  
Example of Listener. ora File
  
# Listener. ora Network Configuration File: # E: \ oracle \ product \ 10.1.0 \ Db_2 \ NETWORK \ ADMIN \ listener. ora
  
# Generated by Oracle configuration tools.
  
# The following defines the instance for which the LISTENER process provides services
  
# Here Is ORCL, And it corresponds to ORACLE_HOME and GLOBAL_DBNAME
  
# GLOBAL_DBNAME is not required unless you use HOSTNAME for database connection
  
SID_LIST_LISTENER =
  
(SID_LIST =
  
(SID_DESC =
  
(GLOBAL_DBNAME = boway)
  
(ORACLE_HOME = E: \ oracle \ product \ 10.1.0 \ Db_2)
  
(SID_NAME = ORCL)
  
)
  
)
  
# Listener name. A database can have more than one listener.
  
# Next we will talk to the listener about the protocol, ip address, port, etc. Here we use the tcp1521 port and use the # Host Name
  
LISTENER =
  
(DESCRIPTION =
  
(ADDRESS = (PROTOCOL = TCP) (HOST = boway) (PORT = 1521 ))
  
)
  
The above example is the simplest, but also the most common. A listener process provides services for an instance (SID.
  
Listener Operation Command
  
$ ORACLE_HOME/bin/lsnrctl start, others such as stop and status. After you have typed an lsnrctl, you can view the help information.
  
The three files mentioned above can be configured through the graphical Configuration tool.
  
$ ORACLE_HOME/netca wizard
  
$ ORACLE_HOME/netmgr
  
I am used to netmgr,
  
The profile is configured with sqlnet. ora, that is, the name resolution method.
  
The service name is configured with the tnsnames. ora file.
  
Listeners configures the listener. ora file, that is, the listener process.
  
For more information about the configuration, see the configuration file.

  • 1
  • 2
  • 3
  • Next Page
[Content navigation]
Page 1st: three network configuration files in oracle Page 2nd: three network configuration files in oracle
Page 3rd: three network configuration files in oracle

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.