Published by : Obay Salah , November 19, 2024

 When the database is configured to work in Shared Server mode, two types of Process are created (Shared Servers & Dispatchers),

Also, a number of rows are created on the SGA memory, and the behavior of the Listener is modified to work with the Shared Server.

The Dispatcher is a Process that works on a TCP PORT and is registered with the Listener.


Note with me the steps of the Shared Server Process. When the Process User requests to connect to the Instance, the listener does not create a Server Process as is the case in the Dedicate Server, but the listener keeps a list of available Dispatchers, one of which receives that request and passes it to the Request Queue, knowing that this queue contains all the requests received by all Dispatchers, knowing that this The class is automatically created when configuring the Instance in Shared Server mode and the number of Dispatchers that are created is also specified.

After the requests reach the Request Queue, all Shared Servers keep monitoring this queue that contains a group of requests.

The moment one of the Shared Servers finishes serving one of the requests, another request is nominated from the Request Queue to that Shared Server Process.

After the Shared Server Process finishes processing the request, it passes it to the Response Queue. The truth is that There is a set of Response Queues

at a rate of one for each Dispatcher. The Shared Server passes the result to the Response Queue of the Dispatcher that received the request first.

After that, the response or result is passed from the Response Queue to the Dispatcher, which in turn sends the response to the User Process.

The SGA and PGA:


Note with me the difference in the memory configuration for each of the Dedicated Server and the Shared Server, since each User Process connects to the database has its own Process Server

As is the case in the Dedicated Server where the User Session Data is stored, which is the information source used in the PGA, which is the memory specific to each Server Process

And also the Cursor state, but since the matter was different in the Shared Server, this information was stored in the SGA, which is Public memory

Where the sharing takes place, but note that the Stack Space information in both cases is stored in the PGA because it contains the local variables of the Process.


Configure Oracle Shared Server:

To configure the Instance to work on the Shared Server mode only, we need to configure some changes to the Parameter File,


As for the Listener, it is configured automatically through Dynamic Instance Registration.


There is only one variable that must be initialized, which is the DISPATCHERS variable, while the rest of the variables are optional:


1- SHARED_SERVERS:


This variable is to determine the number of SHARED SERVERs that are created at the moment the Instance is started in the Shared Server mode. It is an automatic variable, meaning that you can change its value without closing the database. This variable originally holds the value 0 as long as Dispatcher equals NULL.


2- DISPATCHERS:

This variable is used to determine the number of Dispatchers that are created when the instance is started in Shared Server mode according to the given protocol.


It originally takes the value NULL and this variable must be initialized for the database to operate in Shared Server mode.


3- MAX_SHARED_SERVERS:

This variable is to determine the maximum number of Shared Servers that can be operated, and it is an automatic variable that allows the Shared Server to increase the number of Shared Servers when needed.


4- SHARED_SERVER_SESSION:

This variable is to determine the number of Sessions that can be opened at the same time on the Shared Server.


Now let's assume that we want to change the database operation from Dedicated Server to Shared Server:


1- Initialize the DISPATCHERS variable.

ALTER SYSTEM SET DISPATCHERS='(PROTOCOL=TCP)(DISPATCHERS=50)' scope=spfile;

2- Initialize the variable SHARED_SERVERS. This variable is optional.

ALTER SYSTEM SET SHARED_SERVERS=10 scope=spfile;

3- Close and open the database.

SHUTDOWN IMMEDIATE;
STARTUP;

4- Ensure that the DISPATCHERS and SHARED SERVERS are working.

SELECT PROGRAM FROM V$PROCESS;

Notice with me you will find (D000, D001, D002) and so on.

Tags : Database

You May Also Like

Comments

no comment yet!