Oracle Net Services are the elements that provides connection for distributed services. This article covers the methods of: Oracle Net; Local Naming Method; Easy Connect Naming Method; Directory Naming Method; and External Naming Methods
Oracle Net Method:
Oracle Net acts as the data courier, it establishes and maintains the connection between client and server. In Oracle Net configuration a client is setup to connect to a listener process on the server via an alias name in the configuration file. The Listener process on the server performs connection to database and client. Oracle Net Services can handle non Oracle data source connections such as SQL Server, DB2 and external code libraries through EXTPROC. Database server receives initial connection through the Listener and then hands off connection from client to a server process, once handoff has occurred the client communicates directly with database server. Listener failure will not stop currently connected sessions, only new ones. Client must configure a descriptor to give the database location, service name and port. In order to connect, the tnsnames.ora file descriptor must have a matching entry in listener.ora of the listener process on server.
There are several other types of network connections besides Oracle Net:
- Java Application Connections
- Web Client connections by Application Web Server.
Client TNSNAMES.ORA file:
(ADDRESS = (PROTOCOL = TCP)
(HOST = mylinux.localdomain.com)
(PORT = 1521))
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
(SID = ORCL)
Protocol – defines protocal being used by listener device, TCP is for TCP/IP
Host – can use name or IP, identifies IP of Listener
Port – Defines port listener is listening on, default is 1521
Connect data Section:
SID – Name of SID for database you wish to connect to.
SERVICE_NAME – Name given in the SERVICE_NAMES initialization parameter is the global database name.
INSTANCE_NAME – Id the database instance, it is optional and default is the SID.
DEDICATED SERVER – listener will start a dedicated server process for each incoming connection. Each client will have its own server process which will terminate upon exit of the session.
Steps for listener connection:
- Listener receives client request.
- Listener starts dedicated server process and passes connection request to process.
- Client now connected directly to server process.
- Server process checks client’s credentials for authentication.
- If credentials are good, session is created for client.
Local Naming Method:
Local naming method uses TNSNAMES.ORA file to provide client with connection address, file is normally located in $ORACLE_HOME/network/admin
Easy Connect Naming Method:
Bypasses lookup in TNSNAMES.ORA file and uses simple string to connect to database server. You can use Easy Connect if the following conditions are met:
- Oracle Net Services software installed
- TCP/IP supported on server and client.
- No add-ons like external procedure calls or heterogeneous services exist.
- EZCONNECT is listed in NAMES.DIRECTORY_PATH of SQLNET.ORA file.
Directory Naming Method:
Uses LDAP compliant technology such as Oracle Internet Directory, connection are mapped to connection descriptors in directory server. LDAP server provides central management of network connection services. Directory service is created during database creation and use EM Cloud or Oracle Net Manager to configure client for directory method.
External Naming Methods:
Third part method such as Network Information Services (NIS), allows client to resolve service to network service name and prevents local configuration of database connections.