Understanding Oracle's network architecture to resolve connectivity issues

Source: Internet
Author: User
Tags ldap sqlplus

Recently saw a lot of people talk about TNS or database can not log in and so on, simply summed up the following dongdong.

First of all, Oracle's network structure, to complex to say can add encryption, LDAP and so on. There is no discussion here, and the focus is on the basic network structure, which is what we use most often.

Three configuration files

Listener.ora, Sqlnet.ora, Tnsnames.ora, are placed in the $oracle_home\network\admin directory.

Focus: Role and use of three documents

#-----------------------

Sqlnet.ora-----function is similar to Linux or other Unix nsswitch.conf files, which determines how to find a connection string that appears in a connection.

such as our client input

Sqlplus SYS/ORACLE@ORCL

If my sqlnet.ora is like this

Sqlnet. Authentication_services= (NTS)

NAMES. Directory_path= (Tnsnames,hostname)

Then the client will first find the ORCL record in the Tnsnames.ora file. If there is no corresponding record, try to use ORCL as a host name, through the network to resolve its IP address and then to connect the IP GLOBAL_DBNAME=ORCL this instance, Of course I'm here ORCL is not a host name

If I were this way

NAMES. Directory_path= (TNSNAMES)

Then the client will only find ORCL records from Tnsnames.ora.

There are other options in parentheses, such as LDAP, which are not commonly used.

#------------------------

Tnsnames.ora------This file is similar to the Hosts file for UNIX, providing tnsname to host name or IP correspondence, only if Sqlnet.ora is similar

NAMES. Directory_path= (TNSNAMES) This means that the client resolves the connection string in the order in which it is TNSNAMES to try to use the file.

Examples of two, ORCL corresponding to the local, sales corresponding to another IP address, which also defines the use of the main server or shared server mode to connect, one sentence said

#你所要连接的时候输入得TNSNAME

ORCL =

(DESCRIPTION =

(Address_list =

#下面是这个TNSNAME对应的主机, Port, protocol

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

)

(Connect_data =

#使用专用服务器模式去连接需要跟服务器的模式匹配, if not, based on the server's mode

#自动调节

(SERVER = dedicated)

#对应service_name, sqlplus>show parameter service_name;

#进行查看

(service_name = ORCL)

)

)

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.