Oracle9i Heterogeneous Connectivity Administrator's Guide Release 1 (9.0.1) Part Number A88789_01 |
|
This chapter explains what multithreaded agents are, how they contribute to the overall efficiency of a distributed database system, and how to administer multithreaded agents.
This chapter contains the following sections:
This section explains how multithreaded agents contribute to the overall efficiency of Heterogeneous Services and Oracle Transparent Gateways.
This section contains the following topics:
In the architecture of past releases of Heterogeneous Service, agents are started up on a per user-session and per database link basis. When a user session attempts to access a non-Oracle system by means of a particular database link, an agent process is started up that is exclusively dedicated to that user session and that database link. The agent process terminates only when the user-session ends or when the database link is closed. Separate agent processes are started under the following conditions:
This architecture is simple and straightforward. However, it has the disadvantage of potentially consuming an unnecessarily large amount of system resources.
For example, suppose that there are several thousand user sessions simultaneously accessing the same non-Oracle system. Because an agent process is started up for each one of them, there are also several thousand agent processes running concurrently as well as several thousand connections open to these agent processes. The agent processes are all running regardless of whether each individual agent process is actually active at the moment or not. Because of this, agent processes and open connections can consume an disproportionate amount of system resources without any discernible benefit.
Usually, only a small percentage of these agent processes are actually active at a given moment. This makes it possible to more efficiently use system resources by using the multithreaded agent feature of Oracle Transparent Gateways. The multithreaded agent uses a pool of shared agent processes. (The number of these shared agent processes is usually considerably less than the number of user sessions.) The tasks requested by the user sessions are put on a queue and are picked up by the first available multithreaded agent.
This section describes the architecture of multithreaded agents.
This section contains the following topics:
In the architecture for multithreaded agents, there are three kinds of threads:
Typically there are many more task threads than dispatcher threads. The architecture is shown in Figure 5-1.
Each request issued by a user session is represented in Figure 5-1 by a separate type of arrow.
Each request is processed by means of the three different kinds of threads
These three thread types roughly correspond to the Oracle multithreaded server's PMON, dispatcher and shared server processes respectively.
Multi-threaded agents are started on a per system-identifier(SID) basis. Each TNS listener that is running on a system listens for incoming connection requests for a set of SIDs. To connect to a process by means of a listener, the SID in the SQL*Net connect string should be one of the SIDs that the listener is listening for. For each SID, a separate agent process is started and incoming connections for that SID are handed over by the listener to that process.
The agent process is pre-started. A separate agent control utility stops and starts the multithreaded agent itself.
See Also:
Multithreaded Agent Administration for more information on how to start and stop multithreaded agents using the agent control utility. |
The monitor thread is the first thread to be started with an multithreaded agent process. The monitor thread does the following:
Dispatcher threads do the following:
Task threads do the following:
This section explains how you can administer multithreaded agents.
This section contains the following topics.
The multithreaded agent is started and stopped by an agent control utility called agtctl,
which works much like lsnrctl
. The main differences are that lsnrctl
reads a configuration file whereas aftctl
takes information form the command line and writes it to a control file. There is no equivalent for listener.ora as far as agtctl
is concerned.
You can run agtctl
in one of two ways:
This mode is called single command mode
agtct
' and you will get an AGTCTL>
prompt and you can type commands from within the agtctl
shell.
This mode is called shell mode
The commands (in single command mode are) are as follows:
There are three variants of the shutdown command
If you issue the first variant, agtctl
will talk to the agent and ask it to terminate itself gracefully. In other words, all sessions will complete the operations they are currently doing and then shutdown.
If you issue the second variant, agtctl
will talk to the agent and tell it terminate immediately. In other words, the agent process will exit immediately regardless of the state of current sessions.
If you issue the third variant, agtctl
will not talk to the agent at all. It will just issue a system call to kill the agent process.
agtctl set parameter_value agent_sid
agtctl unset parameter agent_sid
In shell mode, you can start agtctl
by typing 'agtctl
' whereupon you will get an 'AGTCTL>
' prompt.
First, set the name of the agent sid that you are working with by typing
set agent_sid agent sid
All commands issued after this are assumed to be for this particular sid until the agent_sid value is changed.
The commands are all the same as those for the single command mode commands with the exception that you can drop the 'agtctl
' and agent_sid.
To set an initialization parameter value, type:
set parameter value
Use the following table to set your initialization parameters.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|