Network Topology   «Prev  Next»

Lesson 3 Oracle Network Services and Net components
Objective Define the components of Oracle network tools.

Oracle Net Services and Components

As we discussed earlier, Oracle Net Services require different parameter files depending upon whether the computer is defined as a client, a server, or both.
  1. A Net client requires a tnsnames.ora file for outgoing connections.
  2. A Net server requires a listener.ora file that listens for incoming connections.
  3. In addition, sometimes a sqlnet.ora file and a protocol.ora file are created for the Net environment.

However, creating the files and establishing initial connectivity is only the beginning. Once you have created the Net infrastructure, you must create a mechanism to reference the remote database from within SQL statements. This is done by creating database links that will store three items:
  1. The TNS service name
  2. The remote USER ID
  3. The remote password
Let us take a look at how the pieces fit together.
  1. Suppose you issue the query select * from customer@raleigh. Oracle begins by looking up "raleigh" in the database link table to get the TNS service name (RAL in this example). The database link would have been previously created using the following syntax:

CREATE DATABASE LINK RALEIGH
  CONNECT TO RALEIGH_USER 
  IDENTIFIED BY SECRET_PASSWORD 
  USING `RAL'

Purpose of 1) sqlnet.ora and 2) protocol.ora files in the Oracle Network Services Environment

In the Oracle Network Services environment, the sqlnet.ora and protocol.ora files play important roles in configuring and managing the network settings for Oracle database connectivity. Here's an explanation of their purposes:
1. sqlnet.ora
The sqlnet.ora file is a configuration file used by Oracle Net to specify network settings and control the behavior of Oracle client and server interactions. It is primarily concerned with:
Purpose:
  • Connection Settings: Configures settings for establishing and maintaining database connections.
  • Security Parameters: Enables encryption, data integrity, and secure authentication mechanisms.
  • Timeouts and Logging: Defines connection timeouts, tracing, and logging options.
  • Network Naming: Specifies the naming resolution methods to be used for resolving database service names (e.g., TNSNAMES, LDAP).
  • Advanced Network Features: Allows settings such as load balancing, failover, and centralized service configuration.

Key Parameters in sqlnet.ora:
  • SQLNET.AUTHENTICATION_SERVICES: Configures authentication methods (e.g., NTS, NONE).
  • SQLNET.ENCRYPTION_SERVER and SQLNET.ENCRYPTION_CLIENT: Enable or disable data encryption.
  • NAMES.DIRECTORY_PATH: Defines the order of naming resolution methods (e.g., TNSNAMES, LDAP).
  • LOG_DIRECTORY_CLIENT: Specifies the directory for client-side logging.
  • TRACE_LEVEL_CLIENT: Configures the trace level for debugging.

Typical Use Case: When a database client connects to a server, the sqlnet.ora file ensures that the connection adheres to the security, authentication, and naming standards configured in the Oracle network environment.
2. protocol.ora
The protocol.ora file is less commonly used but plays a specialized role in configuring low-level network protocol parameters. It is primarily focused on fine-tuning the underlying communication protocols (like TCP/IP) used by Oracle Net.
Purpose:
  • Protocol-Level Customization: Configures advanced settings for specific network protocols (e.g., TCP/IP, IPC, etc.).
  • Performance Tuning: Allows adjustments to network buffers, timeouts, and other low-level settings for optimized performance.
  • Security and Compliance: Provides protocol-specific options for compliance with security requirements.
  • Debugging Protocol Issues: Helps in troubleshooting network protocol-related problems.

Key Parameters in protocol.ora:
  • TCP.NODELAY:[1] Controls the use of the Nagle algorithm for packet optimization.
  • TCP.CONNECT_TIMEOUT: Sets the timeout for establishing a TCP connection.
  • TCP.INBOUND_CONNECT_TIMEOUT: Configures the timeout for inbound client connection requests.
  • TCP.SEND_BUF_SIZE and TCP.RECV_BUF_SIZE: Specify the send and receive buffer sizes for TCP/IP connections.

Oracle Cloud Integration Services

Typical Use Case: When dealing with custom network configurations or specific protocol optimizations (e.g., disabling the Nagle algorithm for low-latency applications), the protocol.ora file is used. Summary of Roles:
File Primary Role Example Use Case
sqlnet.ora Configures client-server communication and security settings Enabling SSL/TLS encryption or defining naming resolution methods like TNSNAMES
protocol.ora Configures low-level network protocol parameters Adjusting TCP buffer sizes or timeout values for fine-tuning network performance

global_names

If the global_names parameter has been set to TRUE in the initsid.ora file, the name entered in a database link must be the global database name.
  1. Next, Oracle looks up RAL in the tnsnames.ora file to get the host name for the remote computer. At this point it may also need to go to the "hosts" file to look up the IP address for the host name.
  2. Once it has the IP address, Oracle gets the protocol from tnsnames.ora and issues the request to the remote server.
  3. The listener on the remote server intercepts the request and creates a process on the server. This process connects to Oracle using the User ID and password from the database link.
  4. Only at this point are the customer rows fetched from the remote server and passed to the requesting client.
Note that almost all of the processing work is done on the remote database. For example, if we had requested the customer rows to be sorted (that is, select * from customer@raleigh order by customer_name;), the sorting would have taken place on the remote server before the rows were passed to the client. It is important to understand this concept, since remote requests may make heavy use of the TEMP tablespace on the remote server for sorting purposes. Now that we have seen the overall flow, let us take a close look at the tnsnames.ora file.
[1] TCP.NODELAY: TCP.NODELAY disables Nagle's algorithm for TCP connections. Nagle's algorithm is designed to reduce network traffic by buffering small packets together into larger ones. However, in some cases, this can introduce delays, especially for applications that require frequent small data exchanges. Setting TCP.NODELAY to YES forces data to be sent immediately, which can improve latency.  
Note: While TCP.NODELAY can improve performance in some situations, it can also increase network traffic. It's generally recommended to use it only when necessary and after careful testing.

SEMrush Software 3 SEMrush Banner 3