The Oracle dedicated server and the Shared Server connect to the Oracle server to process requests. These two methods are dedicated server connection and shared server connection. Dedicated server www.2cto.com: Oracle will always create a new thread for me when I log on. This is usually called a dedicated server configuration, because this server process will specifically serve me during my session lifetime. For each session, a new dedicated server is displayed, and there is a one-to-one ing between the session and the dedicated server. As defined, this dedicated server is not part of the instance. My client processes (that is, programs that want to connect to the database) will communicate directly with this dedicated server through some network channel (such as TCP/IP socket, the server process receives and executes My SQL statements. If necessary, it will read the data file and search for the data I want in the database cache. Maybe it will complete my update statement, or it may run my PL/SQL code. As long as the target of this server process is to respond to the SQL call I submitted: the specific process is as follows: ① The client uses the SET protocol to send a CONNECT packet to the Listener to establish a connection with the Listener. ② Listener checks whether the SID has been defined. If it has been defined, Listener will fork a new process to process the connection. A Bequeath connection is established between the Listener and the new server process to transmit process initialization information. Then, the Bequeath connection will be closed. Note that TCP sockets is inherited by the new server process.
③ The server process sends a RESEND package to the client. ④ A new CONNECT packet is sent from the client to the server process generated by fork. ⑤ the dedicated server process receives a new connection packet, and an ACCEPT packet is returned to the client. The request process of the dedicated server is as follows: www.2cto.com
Shared Server: In a Shared Server, Oracle uses a "shared process" pool to provide services for a large number of users. A Shared Server is actually a connection pool mechanism. With the Shared Server, you do not need to create a dedicated server for each database session, but only need to create a few processes/Threads. These processes/threads will share all sessions. In this way, Oracle can connect more users to the database, otherwise it is difficult to connect more users. The customer process cannot directly talk to the sharing server because the server process is shared. In order to share these processes, another mechanism is required to "talk" with the server process ". Therefore, Oracle uses one or more processes called dispatcher. The customer process communicates with a scheduler process through the network. This scheduling process puts customer requests into the request queue in SGA (also one of the purposes of SGA ). The first idle shared server receives the request and processes it. After the command is completed, the Shared Server places the response in the response queue of the original scheduler (that is, the scheduler that receives the request. The scheduler process keeps listening to this queue and sends the result to the customer after the result is found. The specific process is as follows: ① the customer connects to send a request to the scheduler. The scheduler first places the request in the Request queue in SGA. ② The first available Shared Server retrieves and processes this request from the request queue. ③ After processing the Shared Server, place the response (return code, data, etc.) in the response queue. ④ the scheduler then obtains the response and sends it back to the customer. The process of sharing server requests at www.2cto.com shows the interaction between customers connected by the sharing server and those connected by the dedicated server. It also shows that an Oracle instance can use these two types of connections at the same time (in fact, even if it is configured to use a shared server connection, Oracle Database always supports dedicated server connections ).