Oracle's shared, dedicated mode parsing

Source: Internet
Author: User

Main Reference Document:http://www.itpub.net/thread-1714191-1-1.html

OraclehThere are two types of server modesShared modeand theDedicated mode.

Dedicated mode, the client sends a connection request, and the database has to create a service process for the request to complete the response. And inShared modeDown,OracleA certain number of service processes are established first, and requests from clients are sent first toDispatcherthat is, the scheduler, and then by theDispatcheraccording to the busy situation of the service process, the selective delivery of the request to the specific service process to respond, the shared service process to respond, the results of the response toDispatcher, byDispatcherdelivered to the client again. In this process, two queues are involved , that is, the request queue and the response queue, both of which are located in theSGA, the session information for the shared connection is placed in theLarge Pool, so theSGAto use more.

UseShared modeand theDedicated modethe pros and cons.

Use dedicated mode Because a dedicated process is created for each connection request, it responds more quickly than shared mode quick, but dedicate mode To create a dedicated PGA dedicated mode dedicated mode Also oracle default mode.

Using shared mode can effectively reduce the number of system processes and can be used in environments where memory limitations are high. However , shared mode has to go dispatcher this program because of the client request and the server response , it is more likely to cause congestion or deadlock, It is also possible for long waits for other requests due to a request taking up the service time for a long time, in addition, the shared mode is not easy to implement trace. In a production environment, shared mode is mostly not available , and middleware software is used to achieve similar requirements.

View the server mode of the current system

Show parameter Gkfx

First shared_servers the number of shared services processes that are enabled when the system starts, this parameter is greater than 0 to enable sharing mode, this parameter is not set too large, the assembly increases the start time, Oracle automatically adjusts the number of shared service processes based on the load, which is only the initial value at startup.

Max_shared_servers This parameter sets the maximum number of shared services processes.

Show parameter Dispatcher

Starting shared_server only does not really enable sharing mode, and you need to set up dispatchers. The content of the Dispatchers is shaped like ' (protocol=tcp) (service=jf01) (dispatchers=3). where protocol represents the protocol type, and Service indicates the name of the server to enable sharing mode,dispatchers Represents the number of initial dispatch processes.

Max_dispatchers is the maximum number of scheduling processes.

The corresponding background process in sharing mode is the beginning of "s" and "D", the service processbegins with S, andD is the scheduling process, as s000,s001,d000,d001 this class. 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 parameter to greater than 0

Alter system set dispatcher= ' (protocol=tcp) (service=jf01) (dispatchers=3)';

Set up a service to enable sharing mode.

In addition, you need to re-use the client's tnsnames.ora file To change the instance resolution under the shared mode connection

One of the connect_data (server=shared) .

Only then will the client initiate a request to establish a shared connection. If sharing mode is not enabled on the service side at this time, an error message appears:

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= ';

That's all you can do.

View information for the current session

Select server from V$session;

Related views

V$shaed_server

V$dispatcher

V$circuit

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.