Home Database Mysql Tutorial 监听中sqlnet.ora的作用

监听中sqlnet.ora的作用

Jun 07, 2016 pm 04:19 PM
effect monitor

sqlnet.ora最常用的两个功能是: 客户端起作用==连接方式 用于指定客户端的名称解析查询的命名方法的顺序。== NAMES.DIRECTORY_PATH=(tnsnames, onames, hostname) 服务端与客户端同时起作用==认证方式== SQLNET.AUTHENTICATION_SERVICES sqlnet.ora内容作用

  sqlnet.ora最常用的两个功能是:
客户端起作用==连接方式 用于指定客户端的名称解析查询的命名方法的顺序。==>> NAMES.DIRECTORY_PATH=(tnsnames, onames, hostname)
服务端与客户端同时起作用==认证方式==>> SQLNET.AUTHENTICATION_SERVICES

sqlnet.ora内容作用详见官方文档:#NETRF006
配置sqlnet.ora限制IP访问Oracle 
一些重要参数及解释:
1.BEQUEATH_DETACH
控制unix系统中signal handling 的开关,默认是no,即signal handling 打开。
2.DEFAULT_SDU_SIZE
指定session data unit (SDU) 的大小,单位是bytes,建议在client端和server端都设置这个参数,确保链接的时候使用相同的SDU size,如果client端和server端配置的值不匹配会使用较小的。
3.LOG_DIRECTORY_CLIENT/LOG_DIRECTORY_SERVER
指定客户端/server端log日志文件的位置
4.NAMES.DEFAULT_DOMAIN
设定客户端解析名字的域
5.NAMES.DIRECTORY_PATH
指定client name解析方法的次序,,默认是NAMES.DIRECTORY_PATH=(tnsnames, onames, hostname)
取值可以是tnsnames,ldap(dictionary server),hostname/ezconnect,cds (分布式环境下),nis (Network Information Service (NIS)
6.SQLNET_ALLOWED_LOGON_VERSIONS
指定运行链接的oracle的版本SQLNET_ALLOWED_LOGON_VERSIONS=(10,9,8)
7.SQLNET.AUTHENTICATION_SERVICES
指定启动一个或多个认证服务
Authentication Methods Available with Oracle Net Services:
none for no authentication methods. A valid username and password can be used to access the database.
all for all authentication methods
nts for Windows NT native authentication
8.SQLNET.INBOUND_CONNECT_TIMEOUT
指定客户端没有链接成功超时的时间。超时之后oracle会中断链接,同时报错。
9.SSL_VERSION
指定ssl链接的版本
10.TCP.EXCLUDED_NODES
指定不允许访问oracle的节点,可以使用主机名或者IP地址
11.TCP.INVITED_NODES
指定允许访问db的客户端,他的优先级比TCP.EXCLUDED_NODES高。
12.TCP.VALIDNODE_CHECKING
使用这个参数来启用上边的两个参数。
13.TNSPING.TRACE_DIRECTORY
使用这个参数指定tnsping trace文件的目录,默认是$ORACLE_HOME/network/trace目录
更多参数信息参见:Oracle Database Net Services Reference

##################

连接时解析查询的顺序方式实验: ==>> NAMES.DIRECTORY_PATH=(tnsnames, onames, hostname)

官方文档上的说明:Use the parameter NAMES.DIRECTORY_PATH to specify the order of the naming methods used for client name resolution lookups.
NAMES.DIRECTORY_PATH==>>指定用于客户端命名方法的名称解析查询的顺序。不在此参数中的连接方式将不能用。
[oracle@ocm1 admin]$ cat tnsnames.ora
bys3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.211)(PORT =1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = bys3)
)
)

1.配置sqlnet.ora中包含:NAMES.DIRECTORY_PATH=(tnsnames),此时只能使用tnsnames中本地名,简易连接将报错

示例:
[oracle@ocm1 admin]$ vi sqlnet.ora
NAMES.DIRECTORY_PATH=(tnsnames)
~
[oracle@ocm1 admin]$ sqlplus bys/bys@bys3 --使用本地名可以连接
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 17 11:13:16 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exit

[oracle@ocm1 admin]$ sqlplus bys/bys@192.168.1.211:1521/bys3 --使用简易连接的方法,不能连
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 17 11:13:27 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

2.配置sqlnet.ora中包含:NAMES.DIRECTORY_PATH=(tnsnames,ezconnect),此时使用tnsnames中本地名和简易连接都可以

[oracle@ocm1 admin]$ cat sqlnet.ora
NAMES.DIRECTORY_PATH=(tnsnames,ezconnect)
使用tnsnames中本地名和简易连接都可以
[oracle@ocm1 admin]$ sqlplus bys/bys@bys3
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 17 11:18:47 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

[oracle@ocm1 admin]$ sqlplus bys/bys@192.168.1.211:1521/bys3
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 17 11:13:59 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exit
#################################################

服务端与客户端同时起作用==认证方式==>> SQLNET.AUTHENTICATION_SERVICES

有三个参数:
none for no authentication methods. A valid username and password can be used to access the database.
all for all authentication methods
nts for Windows NT native authentication ---这个只对WINDOWS上有用了。

当客户端与服务端SQLNET.AUTHENTICATION_SERVICES=(ALL)无法 用AA/BB用户名密码登陆。有一边是NONE即可连接。

1.服务器端不配置SQLNET.ORA文件,在客户端配置SQLNET.AUTHENTICATION_SERVICES=(ALL),可以正常登陆。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The functions and uses of touch keyboard in win11 The functions and uses of touch keyboard in win11 Jan 03, 2024 pm 04:40 PM

When we browse the win11 settings, we may find that there is a touch keyboard setting, but our screen does not support touch screen, so what is the use of this win11 touch keyboard? In fact, it is an on-screen keyboard. The functions of the win11 touch keyboard: 1. The win11 touch keyboard is actually an "on-screen keyboard" 2. It can simulate a real keyboard and use the keyboard by clicking. 3. When we don’t have a keyboard or the keyboard is broken, we can use it to type. 4. Win11 provides a wealth of personalized options for the touch keyboard. 5. It includes various colors and themes, allowing users to freely switch their favorite styles. 6. Click the "gear" in the upper left corner to modify the keyboard layout, handwriting and other input methods.

Analysis of the function and principle of nohup Analysis of the function and principle of nohup Mar 25, 2024 pm 03:24 PM

Analysis of the role and principle of nohup In Unix and Unix-like operating systems, nohup is a commonly used command that is used to run commands in the background. Even if the user exits the current session or closes the terminal window, the command can still continue to be executed. In this article, we will analyze the function and principle of the nohup command in detail. 1. The role of nohup: Running commands in the background: Through the nohup command, we can let long-running commands continue to execute in the background without being affected by the user exiting the terminal session. This needs to be run

What is a Bluetooth adapter used for? What is a Bluetooth adapter used for? Feb 19, 2024 pm 05:22 PM

What does a Bluetooth adapter do? With the continuous development of science and technology, wireless communication technology has also been rapidly developed and popularized. Among them, Bluetooth technology, as a short-distance wireless communication technology, is widely used in data transmission and connection between various devices. The Bluetooth adapter plays a vital role as an important device that supports Bluetooth communication. A Bluetooth adapter is a device that can turn a non-Bluetooth device into a device that supports Bluetooth communication. It realizes wireless connection and data transmission between devices by converting wireless signals into Bluetooth signals. Bluetooth adapter

Understand the role and usage of Linux DTS Understand the role and usage of Linux DTS Mar 01, 2024 am 10:42 AM

Understand the role and usage of LinuxDTS In the development of embedded Linux systems, Device Tree (DeviceTree, DTS for short) is a data structure that describes hardware devices and their connection relationships and attributes in the system. The device tree enables the Linux kernel to run flexibly on different hardware platforms without modifying the kernel. In this article, the function and usage of LinuxDTS will be introduced, and specific code examples will be provided to help readers better understand. 1. The role of device tree device tree

Explore the importance and role of define function in PHP Explore the importance and role of define function in PHP Mar 19, 2024 pm 12:12 PM

The importance and role of the define function in PHP 1. Basic introduction to the define function In PHP, the define function is a key function used to define constants. Constants will not change their values ​​during the running of the program. Constants defined using the define function can be accessed throughout the script and are global. 2. The syntax of define function The basic syntax of define function is as follows: define("constant name","constant value&qu

Monitor iframe scrolling behavior Monitor iframe scrolling behavior Feb 18, 2024 pm 08:40 PM

How to monitor the scrolling of an iframe requires specific code examples. When we use the iframe tag to embed other web pages in a web page, sometimes we need to perform some specific operations on the content in the iframe. One of the common needs is to listen for the scroll event of the iframe so that the corresponding code can be executed when the scroll occurs. The following will introduce how to use JavaScript to monitor the scrolling of an iframe, and provide specific code examples for reference. Get the iframe element First, we need

Learn more about Gunicorn's fundamentals and features Learn more about Gunicorn's fundamentals and features Jan 03, 2024 am 08:41 AM

Basic concepts and functions of Gunicorn Gunicorn is a tool for running WSGI servers in Python web applications. WSGI (Web Server Gateway Interface) is a specification defined by the Python language and is used to define the communication interface between web servers and web applications. Gunicorn enables Python web applications to be deployed and run in production environments by implementing the WSGI specification. The function of Gunicorn is to

What is PHP used for? Explore the role and functions of PHP What is PHP used for? Explore the role and functions of PHP Mar 24, 2024 am 11:39 AM

PHP is a server-side scripting language widely used in web development. Its main function is to generate dynamic web content. When combined with HTML, it can create rich and colorful web pages. PHP is powerful. It can perform various database operations, file operations, form processing and other tasks, providing powerful interactivity and functionality for websites. In the following articles, we will further explore the role and functions of PHP, with detailed code examples. First, let’s take a look at a common use of PHP: dynamic web page generation: P

See all articles