- Connection Operations
- Connecting to Servers (open): Users initiate a connect request by passing information such as username and password along with a short name for the database service that they wish to connect(this is in tnsnames.ora) . This short name, called a service name , is mapped to a network address contained in a connect descriptor . Depending on the network configuration this descriptor may be stored in:
- A local configuration file named TNSNAMES.ORA
- A Name server for use by Oracle Names
- A native naming server such as NIS or DCE CDS
Net8 coordinates its sessions with the help of network listener
- Bequeath the session to a new dedicated server process
If the listener and server exist on the same node, the listener may create or 'spawn' dedicated server processes as connect requests are receive. Dedicated server processes are commited to one session only and exist for the duration of that session. The sequence of events is
- The listener is started and listenes on an address specified in a listener configuration file (LISTENER.ORA)
- A client connects to the listener with the network address
- The listener receives the session request, and determines if the client's request may be serviced. If not, the listener refuses the session.The listener continues listening for incoming connections
- The listener spawns a new dedicated server process to serve the incoming session, and bequeaths the session to that server proces. Once the session is established, data flows directly between the client and dedicated server process.
- The listener continues listening for incoming connections
When a client disconnects, the dedicated server processes associated with the client closes.
- Redirect to an existing server process ( such as a dispatcher or prestarted dedicated server process)
It does this by sending the address of an exisiting server process back to the client. The client will then
resend its connect request to the server address provided,there are two options:
- Prespawned Dedicated Server Process: This option automatically creates a dedicated server processes before the request is received. These processes last for the life of the listener, and can be reused by subsequent connection requests. The use of prespawned dedicated server processes requires specification in a listener configuration files. The events that take place are:
- The listener is started and listens on an address specified in a listener configuration file.
- The listener then spawns a series of dedicated server processes until it reaches the specified pool size for each SID defined in its config file.
- Each spawned server process performs a partial address listen and provides the listener with a partial address that it is listening on. The listener initially marks all prespawned servers as idle.NOTE: A partial address listener is where the server process listenes, but informs the underlying protocol stack that it has no preference as to the specific address it will listen on. As a result, many protocol stacks will choose a free listening address and automatically assing this to the requesting server process.
- The client send a connect request to the listener.
- The listener receives the session request, and determines if the clients request may be serviced. If not, the listener refuses the session.
- The listener issues a redirect message to the client containing one of the network addresses of the prespawned servers. The listener logs that server as active.
- The client dissolves the session to the listener and establishes a session to the prespawned server using the address provided in the redirect message.
- The listener spawns another server process to replace the active prespawned server (provided a value called PRESPAWN_MAX in the listener config. file is grater than the number of prespawned server processes active and idle)
- The listner continues listening for incoming sessions.
- Dispatcher Server Processes :A dispatcher server processes enables many clients to connect to the same server without the need for a dedicated server processes for each client. It does this with the help of a dispatcher which handles
and directs multiple incoming session request to the shared server.
When an Oracle server has been configured as multi-thereaded server, incoming sessions are always routed to the dispatcher unless either the session specifically requests a dedicated server or no dispatchers are available. The sequence of events is as follows:
- The listener is started and listens on either a default address or the addresses specified in its configuration file
- A database instance starts. Dispatchers start according to the configuration parameters in the initialization file. Each dispatcher then performs a listen on the address assigned to it.
- Each dispatchers address is registered. When the listener is not listening on its default address, the listener netowork name may be specified in the database init.ora file. The name may resolve to more than one such address if multiple listeners are used.
Once the dispatchers addresses are registered, the listener can redirect incoming connect request to them.
If step 2 is performed before step 1, the dispatchers will not be able to contact the listener in step 3. If this occurs, there may be a delay as the dispatcher attempts to contact the listener. If a connect request comes in a timeframe where no dispatchers are registered, these requests may be handled through prespawned dedicated or newly spawned dedicated server processes or be rejected.
- The listener and the Oracle dispatcher server are now ready to receive incoming sessions.
- Once the listener and the dispatcher server have been started, the session activity continues as follows:
- The client connects to the listener with the network address
- The listener receives the connect request, and ddetermines if the clients request may be serviced. If
not, the listener refueses the session.
- The listener issues a redirect message to the client containing the network address of the least-used
dispatcher for the shared server.
- The client dissolves the session to the listener and establishes a sesion to the shared server using
the network address provided in the redirect message.
- The dispatcher updates the listener with the new load value because of the presence of the new session.
This allows the listener to balance the incoming session requests between dispatchers on the same protocol
- The listener resumes listening for incoming sessions.
- Refuse the session: The network listener will refuse a session in the event that it does not know about the server being requested, or if the server is unavailable. It refuses the session by generating and sending a refuse response packet back to the client.
- Data Operations: Net8 supports four sets of client-server data operations:
- Send data synchronously
- Receive data synchronously
- Send data asynchronously
- Receive data asynchronously
Basic send and receive requests are synchornous. When a client initiates a request, it waits for the server to respond with the answer. It can then issue an additional request. The asynchronous capability to send and receive data requests asynchronously, was added to support Oracle shared server(Multithreaded-Server), which requires asynchronous calls to service incoming request from multiple clients.
- Exception Operations:Net8 supports three type of exception operations:
- Initiate a break over the connection
- Reset a connection for synchronization
- Test the condition of the connection for incoming break
The user control only one of these operations, that is, the initiation of a break, with de CTRL-C command. Additionaly the database can initiate a break to the client if an abnormal operation occurs, such as during an attempt to load a row of invalid data using SQL*Loader.
The other two excptions operations are internal to products that use Net8 to resolve network timing issues. Net8 can initiate a test of the communication channel, for example, to see if new data has arrived. The reset function is used to resolve abnormal states, such as getting the connection back in synchronization after a break operation has occurred.