Oracle's Shared server model

Source: Internet
Author: User
Tags sessions dedicated server

In a shared server architecture, a dispatcher dispatcher directs multiple session requests for incoming networks to a shared server process pool, eliminating the need to assign a dedicated server process to each connection. As a general guideline, you can use a shared server only if the number of concurrent connections to the database exceeds the processing power of the operating system.

The shared server mode must use NET services. That is, you must configure TNS information (even if the client and server are the same machine, also configure TNS and communicate through the IPC protocol). It is suitable for high concurrency, small transaction volume, and if shared mode is used at this time, it can greatly reduce the resource consumption of Oracle server due to the high concurrency.
 1, sharing server Mode pros   Cons     Benefits:      (1) Reduced number of processes in the instance       (2) Increased number of concurrent users   & nbsp   (3) Achieve dynamic load balancing       (4) Reduce the number of idle server processes       (5) Reduced instance PGA memory        drawbacks:       (1) The code path for a shared server is longer than a dedicated server, so it is inherently slower than a dedicated server;      (2) has the possibility of an artificial deadlock because it is serial, as long as a connection is blocked, All users on the server process are blocked and most likely deadlocked;      (3) has the possibility of exclusive transactions, because if a session's transaction runs for too long, it exclusively shares the resources, other users can only wait, and the dedicated server, each client is a session;       (4) Shared server mode restricts certain database features, such as the inability to start and shut down instances individually and media recovery.  2, processes required in the shared server architecture       (1) Network Listener (PS: Listener is a division of Oracle network Services) that connects client processes to dispatcher or proprietary server processes Not part of the Oracle database).       (2) One or more dispatcher processes (dnnn)       (3) One or more shared server processes (SNNN)  3, request processing process       The dispatcher puts the request in the request queue, then the shared server process checks the public request queue and takes out the processing, and the last server process places the response result in the dispatcher's response queue. (Each dispatcher has a response queue)  4, dispatcher process (dnnn)       Dispatcher process enables client processes to share a limited number of server processes. You can create multiple dispatcher processes for a single DB instance. The optimal number of dispatcher processes depends on the limits of the operating system and the number of connections per process.       When a client process makes a connection request, the listener determines whether the client process should makeWith the shared server process, this has a configuration file with:          0 if the server = shared is explicitly configured and communication is established and dispatcher, the shared server mode is used.      0 If you are configuring Server = Shared but cannot establish communication with any dispatcher, or if you are configuring server = dedicated, use the proprietary server mode.        A typical instance dispatcher setting is as follows (set in parameter file):     dispatchers= "(protocol=tcp) (SERV=ORCL) (list= ORCL) (Poo=on) (disp=5) (conn=33) (sess=224)       protocol=tcp--protocol       list=orcl--listener aliases, is not the name of the listener, it is actually a tnsnames.ora in the network service name       serv=orcl--Network service name       poo=on--Whether the shared pool is enabled       disp=5--Initial scheduling process       sess=224--maximum sessions per schedule       max_dispatchers=19-- Number of maximum scheduling processes        through the V$dispatcher view, you can see how many scheduler processes (dispatchers) The DB instance currently exists in: SELECT * from v$dispatcher;       Modify the number of scheduling processes: Alter system set dispatchers= "(PROTOCOL=TCP) (disp=6)" scope=both;      You can also manually kill a specified scheduler process: ALTER SYSTEM SHUTDOWN IMMEDIATE ' D000 ';  5, shared server process (SNNN)       in totalServer configuration, each shared server process requests services for multiple clients. The shared server process and the dedicated server process provide the same functionality, except that the shared server process is not associated with a particular client process.       (1) The settings of the shared services process are mainly affected by the three parameters:     0 shared_servers      Specifies the number of Share_servers starts when instance is started (can be viewed through Shared server process), do not set this parameter too large, no one will take more time to start the database instance, After Oracle starts, the Shared_servers is dynamically adjusted based on the load. If 0, indicates that the database does not start the shared services mode. This parameter is required for the configuration of shared server, and only this parameter is required.       Modify parameters:  alter system set shared_servers=1;      0 max_shared_servers& nbsp    oracle The maximum number of share_servers that can be used at the same time, do not set this parameter to less than Shared_servers if dynamically modified shared_servers is greater than max_shared_ Servers,oracle overrides the value of Max_shared_servers, at which point you need to modify the max_shared_servers and not be greater than the value of processes. This parameter is intended for use in large resource operations (batch processing), in order to reserve some process for the DBA task (Rman Backup).       0 shared_server_sesions:      Specifies the total number of shared server sessions allowed. If this parameter is set, then do not exceed the value of sessions, if not set this value, then as long as there is idle session, it can be used. Setting this value is reserved for the private connection of the user sessions.        (2) Change the server from shared server mode to dedicated Server mode   &nbsp    alter system Set shared_servers = 0 scope = both;  -a shared process that already exists needs to wait until the end of the session to end         or        alter system set max_share_servers= 0 Scope=both; --immediately force the end of all shared server processes      6 to determine the connection mode of the current session       The database can support both shared server connections and dedicated server connections. Therefore, if the parameter is shared_servers=0, you can determine that all connections are private mode. However, if shared_servers>0, then you need to further determine the current connection mode through the server field of the V$session view.   Supplement: Oracle11gr2 initial setup after installation Shared_servers=1; The database also creates a scheduler process with the following configuration in the parameter file: dispatchers= ' (protocol=tcp) (SERVICE=ORCLXDB) ', service ' orclxdb ' is the XML DB attribute that is included by default when creating a database after oracle9i, providing services such as HTTP, FTP, and so on. The LSNRCTL service allows you to view the network services the listener listens to: (Orclxdb is a service in the Oracle network system, not the operating system level) reprint please specify the Source: Http://www.cnblogs.com/pengineer /p/4516856.html

Oracle's Shared server model

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.