Oracle is a profound technology. Oracle, which has been playing for two years, still has many unknown knowledge points. Yesterday, my friends in the group mentioned the DEDICATED and SHARE modes. I don't know. I am quietly doing my homework. I searched some knowledge from the Internet and sorted it out as follows:
DEDICATED server (DEDICATED): a client connects to a server process
SHARE server: Multiple Clients connect to a server process, which is managed by a process scheduler. It must use net services. That is, tns must be configured. It is suitable for high concurrency and small transaction volume. If the sharing mode is adopted at this time, it can greatly reduce the resource consumption for the ORACLE server due to high concurrency.
Shared Server System: the customer process is eventually connected to a scheduler. The PMON process registers the scheduler's location and load, enabling the listener to submit to the scheduler with the smallest load. A scheduler can concurrently support multiple customer connections.
Dedicated server system: each customer process is connected to a dedicated server process. The server process is not shared by any other customers.
In addition, the dedicated server architecture does not support HTTP and IIOP customers, and only supports TTC customers.
Generally, we can use the default dedicated server mode of oracle, and there is no need to use the Shared Server mode. One is that we use middleware (such as weblogic) to connect to oracle. Middleware itself has a connection pool mechanism. In addition, this sharing server method of oracle is not good enough and has many shortcomings.
Shared servers have the following Disadvantages:
1) The shared server code path is longer than the dedicated server, so it is inherently slower than the dedicated server.
2) there is a possibility of a human deadlock because it is serial. As long as a connection is blocked, all users on the server process will be blocked and the deadlock is very likely.
3) There is a possibility of exclusive transactions, because if a session's transaction runs for too long, it exclusively shares resources, other users can only wait, while a dedicated server, each client is a session.
4) The Shared Server Mode limits some database features. For example, the instance cannot be started or closed independently, the media cannot be restored, and the Log Miner cannot be used, SQL _TRACE does not make sense (because it is shared rather than the current session ).
The memory reduced by MTS is actually the memory required by each user to connect to the operating system process in dedicated server mode. However, it uses the Large_Pool of SGA to allocate UGA and remove the east wall to complement the west wall, the reduced memory is very small. If user sessions are frequently connected and disconnected, the overhead of database Process Creation and deletion will be very high. In this case, it is best to use the Shared Server mode (otherwise, the connection pool technology should be used ). It is of little significance to use the Shared Server mode if a client is connected for Life (within the session lifecycle. Most of the time, a session is connected to a server process, and server processes cannot be shared.
Some descriptions of the Sharing Service initialization parameters:
Shared_servers: specify the number of shared server processes started when the instance is started. Do not set this parameter too large. Otherwise, it will take more time to start the database instance, after Oracle is started, it dynamically adjusts shared_servers Based on the load. If the value is 0, the shared service mode is not enabled for the database. This parameter is required for shared server configuration, and only this parameter is required.
Modify the parameter: alter system set shared_servers = 1;
Max_shared_servers: The shared server process that ORACLE can use at the same time. do not set this parameter to smaller than shared_servers. If the value of shared_servers is dynamically modified to be greater than that of max_shared_servers, ORACLE overwrites the value of max_shared_servers. In this case, you must modify max_shared_servers. it cannot be greater than processes. This parameter is set for (batch processing) operations that occupy a large amount of resources. In order to reserve some processes for DBA tasks (rman backup ),
Shared_server_sesions: Specifies the total number of shared server sessions allowed. If this parameter is set, do not set this value to exceed sessions. If this value is not set, it can be used as long as there are idle sessions. Set this value to reserve user sessions for the VPC connection.
Dispatchers: configure the dispatcher process. If this parameter is not set, oracle will automatically set a dispatcher Based on tcp as long as shared_servers is set. You also need to check how many connections can be processed by a dispatcher in the operating system.
SQL> select * from v $ dispatcher;
Max_dispatchers: set the number of dispatchers that can run simultaneously at the same time. The value must be greater than or equal to dispatchers and less than processes. This parameter will also be overwritten by dispatchers.
Circuits: Specifies the total number of virtual circuits.