Main documents:http://www.itpub.net/thread-1714191-1-1.html
OraclehThere are two types of server modesShared modeand theDedicated mode.
Dedicated modethe next. Each client sends a connection request. The database is required to create a service process for this request to complete the response. And inShared modethe next. Oraclewill first establish a certain number of service processes, the client sends the request will be sent to the firstDispatcherthat is, the scheduler, and then by theDispatcherdepending on the free busy situation of the service process. Selectively deliver requests to a detailed service process to respond. After the shared services process responds, the results of the response are handed back toDispatcher, byDispatcherdelivered to the client again. In this process, two queues are involved. That is, the request queue and the response queue. Both queues are located in theSGA, the session information for the shared connection is placed in theLarge Pool, so theSGAuse a lot of other.
UseShared modeand theDedicated modethe pros and cons.
Using dedicated mode, the response is based on the creation of a dedicated process for each connection request. So it responds faster than shared mode , but dedicate mode has to create a dedicated PGA for each request , So the need for memory is higher. But in the production environment, most of them are using dedicated mode. At the same time , dedicated mode is the default for Oracle.
Using shared mode can effectively reduce the number of system processes and can be used in environments where memory limitations are greater.
However, shared mode is required to go dispatcher this program because between the client request and the server response . It is also easier to create congestion or deadlock, or it may be due to a request for a long time to occupy the service time and other requests to wait for a long time, in addition, sharing mode is not easy to implement trace. In a production environment. Most do not apply to shared mode, and middleware software is used to achieve similar requirements.
View the server mode of the current system
Show parameter Gkfx
First shared_servers shows the number of shared services processes that are enabled at the time the system starts. This number is greater than 0 means that sharing mode is enabled, this parameter does not have to be set too large, after the assembly to add the start time,Oracle will voluntarily adjust the number of shared services processes based on the load, This value is only the initial value at startup time.
Max_shared_servers This parameter sets the maximum number of shared services processes.
Show parameter Dispatcher
Just starting shared_server does not really enable sharing mode, and you need to set up dispatchers.
Dispatchers the content is shaped like ' ( protocol=tcp) (SERVICE=JF01) (dispatchers=3) '.
where protocol represents the protocol type, The service represents the name of the services to enable sharing mode, anddispatchers represents the number of initial dispatch processes.
Max_dispatchers is the maximum number of scheduling processes.
In the shared mode, the corresponding background processes start with "s" and "D", respectively, the service processbegins withs , andD begins with the scheduling process. s000,s001,d000,d001 such as the form. Can be viewed through select PName from v$process .
Enable disable sharing mode
Dedicated mode is the default mode for Oracle, andOracle does not recommend the use of shared mode.
Enable sharing
Alter system set shared_servers=2;
Set this number to be greater than 0
Alter system set dispatcher= ' (protocol=tcp) (service=jf01) (dispatchers=3)';
Set up a service to enable sharing mode.
In addition Also need to be in the client's tnsnames.ora file, in the instance to use shared mode connection to resolve the change
One of the connect_data (server=shared) .
Only then will the client initiate a request to establish a shared connection. Assume that sharing mode is not enabled on the server at this time. The error message will appear:
ORA-12520 Tns:listener Count not the find available handler for requested type of server.
Disable sharing mode
Alter system set shared_server=0;
Alter system set dispatcher= ';
So that's it.
View information for the current session
Select server from V$session;
Related views
V$shaed_server
V$dispatcher
V$circuit
Oracle's shared, dedicated mode parsing