I met many people on the Forum and asked how to judge.OracleShare mode or private mode. I was confused about this problem before.GoogleI found a lot of good things. I made a note to make it easier to understand and remember.
Dedicated server: a client connects to a server process
Shared Server: Multiple Clients connect to a server process. The server has a process schedulerManagement.
OracleThe dedicated server mode is used by default,OracleThe Shared Server and dedicated server modes are supported at the same time. You can specify a session to use a dedicated server, and another session to use a Shared Server.
Shared servers have the following Disadvantages:
1)Shared ServerCodeThe path is longer than the dedicated server, so it is inherently slower than the dedicated server.
2)There is a possibility of 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 someDatabaseFeatures, such as: the instance cannot be started or closed separately, and media cannot be performedRestore, Cannot be usedLog minerAndSQL _traceMeaningless(Because it is shared, not the current session).
MTSThe reduced memory is actually the memory required for every user to connect to the operating system process in dedicated server mode, but it usesSGAOfLarge_poolTo allocateUGA, The east wall is removed to make up 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.).
If the client is connected for life(Within the session Lifecycle)It is of little significance to use the Shared Server mode. Most of the time, a session is connected to a server process, and server processes cannot be shared.
JudgmentOracleThe following methods are available for sharing mode or private mode:
1) show parameter shared_server ;(Note:8iShould be:Show parameter mts_servers ;)
If the value> 0,YesEnableShared Server.
2 ).When the server is configured as a shared server,ClientThe Shared Server or dedicated server can be used to connect to the database.Tnsnames. ora. For example:
Aaaa =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = AAAA) (Port = 1521 ))
)
(CONNECT_DATA =
(SID = aa)
(Server=Dedicated)
)
)
UseDedicatedMethod connectionDB.
In addition,Background process,And locally connected, onlyDedicated.For exampleSqlplus user/passForm
IfDBThe shared server is not configured.ClientOnlyDedicatedMethod connectionDB.
3)Determine a connectedSessionConnection Method
A) Select Server from V $ session where...
IfServer = 'dicated'IsDedicatedMethod
Server = 'shared'IsSharedMethod, and there areShared_server_processFor its service
Server = 'none'IsSharedMethod, and noShared_server_processFor its service
B)Used onlyUNIXBelow, it seemsMongownNo
ConnectionV $ session, V $ ProcessViewProcessInProgram
Select P. Program, S. server from V $ session S, V $ PROCESS p where S. paddr = P. ADDR
IfProgramIs... (S0nn)IsSharedMethod, and there areShared_server_processFor its service
IfProgramIs... (D0nn)IsSharedMethod, and noShared_server_processFor its service
IfProgramIsOthers, it is'Dicated'Method