Tuesday, September 4, 2007

Configuring Shared Server in Oracle 10g

Configuring Shared Server in Oracle 10g

Learning objective

After completing this topic, you should be able to distinguish between the initialization parameters used to configure Shared Server.

1. The DISPATCHERS parameter

When you are configuring Oracle Shared Server you must set the initialization parameters for your instance.

On most systems, you only need to configure the DISPATCHERS parameter. The other parameters are optional and have appropriate default settings.

Normally, the DISPATCHERS parameter is already configured to start one dispatcher for each network protocol and to service the XML database. However, this depends on the options selected when you created your database.

You can apply multiple sets of values in the DISPATCHERS parameter using the format

'< parameters for first set>','< parameters for second set>'

Various attributes, or arguments, can be added to each DISPATCHERS parameter using a name-value syntax similar to that used by Oracle Net Services.

The syntax allows you to specify existing and additional non-case-sensitive attributes in a position-independent manner.

For example, the following DISPATCHERS parameter contains two attributes that tell the dispatcher which protocol it is for and how many dispatchers it has to start:

DISPATCHERS = '(PROTOCOL=TCP) (DISPATCHERS=3)'

The DISPATCHERS parameter is a String parameter type. Its parameter class is Dynamic and its default value is NULL.

NULL means that, unless it is configured with at least one dispatcher, no dispatchers will be started.

DISPATCHERS = '(PROTOCOL=TCP) (DISPATCHERS=3)'

When estimating how many dispatchers to use, you must be aware that the number of connections a dispatcher can deal with depends on the type of workload.

However, a good rule of thumb is to provide one dispatcher for every fifty concurrent database connections.

Of all the dispatcher attributes, only PROTOCOL is required. Also, it's only necessary to enter the three-letter abbreviation of the argument when entering the attribute.

Some of the attributes that can be added to a DISPATCHERS parameter are:

  • PROTOCOL ( PRO or PROT)
  • DISPATCHERS ( DIS or DISP)
  • SERVICE ( SER or SERV)
  • LISTENER ( LIS or LIST)
  • SESSION ( SES or SESS)
  • CONNECTIONS ( CON or CONN)
PROTOCOL ( PRO or PROT)
PROTOCOL indicates the network protocol that the dispatcher is opening a listening endpoint for. The protocol usually used is TCP.
DISPATCHERS ( DIS or DISP)
DISPATCHERS provides the number of dispatchers to start. The default value is 1.
SERVICE ( SER or SERV)
SERVICE refers to the Oracle Net Services name that is registered with the listener by the dispatcher. If a service name is not provided, the dispatcher registers the values in SERVICE_NAMES.
LISTENER ( LIS or LIST)
LISTENER is the listener's alias name. This is used by the PMON process to register dispatcher information. The alias should be resolved through a naming method.
SESSION ( SES or SESS)
SESSION represents a value for the maximum number of network sessions that each dispatcher can handle. The default value depends on the operating system used.
CONNECTIONS ( CON or CONN)
CONNECTIONS represents a value for the maximum number of network connections that each dispatcher can handle. The default value depends on the operating system used. For example, Windows and Sun Solaris have a default value of 1024.

Question

Which dispatcher attribute must be entered in the DISPATCHER S parameter?

Options:

  1. DISPATCHERS
  2. LISTENER
  3. PROTOCOL
  4. SERVICE

Answer

PROTOCOL is the only dispatcher attribute that is required in the DISPATCHER S parameter.

Option 1 is incorrect. The value set in the DISPATCHERS attribute indicates the number of dispatchers to start for the network protocol.

Option 2 is incorrect. LISTENER is not required. This value provides the listener's alias name, which is used by the PMON process to register dispatcher information.

Option 3 is correct. PROTOCOL is the only required attribute and it indicates the name of the network protocol for which the dispatcher is opening a listening endpoint. Usually, the protocol used is TCP.

Option 4 is incorrect. Although it is not required, SERVICE refers to the Oracle Net Services name that is registered with the listener by the dispatcher.

To change the initialization parameters in Enterprise Manager you select All Initialization Parameters in the Instance section of the Administration tabbed page.

To find the dispatchers in the list of Initialization Parameters you enter d ispatchers in the Filter field and click Go.

The DISPATCHERS parameter in this server uses the protocol TCP and the Oracle Net Services name orcl1XDB.

You now want to set the number of dispatchers to 4 in the parameter.

You Type (DIS=4) in the Value field for the dispatchers parameter and click Apply.

The DISPATCHERS parameter is now updated to have a maximum of four dispatchers.

You can also specify other attributes in the parameter, such as Sessions, Listener, or Connections.

Suppose you now want to specify 200 as the maximum number of network connections to allow for each dispatcher.

You type (CONN=200) into the Value field for the DISPATCHERS parameter and click Apply.

The DISPATCHERS parameter now specifies that the maximum number of network connections is 200 for each dispatcher.

Question

You now have to update the DISPATCHERS parameter so that there will be five dispatchers for the instance.

This task requires you to enter the argument that sets 5 dispatchers to start for the TCP protocol. Which of these options allows you to complete this task?

Options:

  1. You type (DIS=5) into the Value field in the Initialization Parameter page and click Apply.
  2. You type (SESS=5) into the Value field in the Initialization Parameter page and click Apply.

Answer

You type (DIS=5) into the Value field in the Initialization Parameter page and click Apply.

2. SHARED_SERVERS and MAX_SHARED_SERVERS

Although the DISPATCHERS parameter is the only parameter that needs to be configured in a shared server, other parameters can be changed when configuring the instance.

For example, you may want to set the maximum and minimum number of server processes that can run concurrently.

To do this you set the MAX_SHARED_SERVERS and SHARED_SERVERS parameters.

To specify the minimum number of server processes that can run concurrently, you configure the SHARED_SERVER parameter.

It is not essential to set this parameter because the Common Request Queue is monitored by the instance.

The instance can add shared servers as the queue needs them, and take them off again when they are no longer required.

To find the SHARED_SERVERS parameter in the Initialization Parameters page, you enter shared_servers into the Filter field and click Go.

The SHARED_SERVERS parameter type is Integer and its class is Dynamic. Its default value is 0 if DISPATCHERS is NULL , and 1 if DISPATCHERS is set.

The range of values that can be used for the SHARED_SERVERS parameter varies according to the operating system.

Common practice suggests that you set one shared server for every 25 concurrent database connections.

You now want to set the SHARED_SERVERS parameter with enough shared servers for 75 concurrent database connections.

You type 3 in the Value field for the SHARED_SERVERS parameter and click Apply.

The SHARED_SERVERS parameter is now set to 3.

You configure the MAX_SHARED_SERVERS parameter to specify the maximum number of server processes that can run simultaneously.

It is important to set this parameter to control the instance, as it creates additional shared servers to service the needs of the common request queue.

The MAX_SHARED_SERVERS is an Integer parameter type, and its class is Dynamic. It has no default value, and its range of values depends on the operating system.

You now want to set the maximum number of shared servers that can be run simultaneously to eight.

You type 8 into the Value field for the MAX_SHARED_SERVERS parameter and click Apply.

The MAX_SHARED_SERVERS parameter is now set to 8.

It's best to set the MAX_SHARED_SERVERS parameter when activity is at its highest. You should check the limit against the activity of the shared servers to find the right setting.

You can find the maximum number of servers started by querying the V$SHARED_SERVER_MONITOR data dictionary view.

Question

Although the instance can add shared servers as required by the Common Request Queue, you decide to set it in advance to be sure that there is an adequate number of shared servers to meet the number of concurrent database connections.

This task requires you to input the value to ensure that a minimum of twelve shared server processes will run simultaneously. Which of these options allows you to complete this task?

Options:

  1. You type 12 into the Value field for the max_shared_servers parameter in the Initialization Parameter page and click Apply.
  2. You type 12 into the Value field for the shared_servers parameter in the Initialization Parameter page and click Apply.

Answer

You type 12 into the Value field for the SHARED_SERVERS parameter in the Initialization Parameter page and click Apply.

3. CIRCUITS and SHARED SERVER SESSIONS

The CIRCUITS parameter enables you to control user connections to the database through dispatchers and servers. These connections are known as virtual circuits.

The CIRCUITS parameter determines the total number of virtual circuits that are available for inbound and outbound network sessions.

To find the virtual circuits parameter in the Initialization Parameter page, you enter circuits into the Filter field and click Go.

The CIRCUITS parameter type is Integer, and its class is Dynamic.

Its default value is the same as that of SESSIONS if the Oracle Shared Server is configured.

If not, the default value is 0.

Now you want to change the total number of virtual circuits that are available for inbound and outbound network sessions.

You type 100 in the Value field and click Apply.

The CIRCUITS parameter is now set to 100.

This parameter is one of several that provide the total SGA requirements for an instance.

However, you set it only if you want to limit the total number of connections users may make while using the shared server architecture.

To control the total number of shared server sessions that can run concurrently, you set the SHARED_SERVER_SESSIONS parameter.

This parameter can also be used to reserve user sessions for dedicated servers.

To find it in the Intialization Parameters page, you enter shared_server_sessions in the Filter field and click Go.

You now want to change the total number of shared server sessions that can run concurrently to 100.

You type 100 in the Value field and click Apply.

The total number of shared server sessions that can open concurrently is now set at 100.

Question

You need to change one of the initialization parameters for the instance so as to control the user connections to the database through dispatchers and servers.

This task requires you to set the appropriate parameter so that a total of 80 connections only can be made. Which of these options allows you to complete this task?

Options:

  1. You click All Initialization Parameters in the Instance section of the Administration tabbed page. You type circuits in the Filter field and click Go. You then type 80 into the Value field for the CIRCUITS parameter and click Apply.
  2. You click All Initialization Parameters in the Security section of the Administration tabbed page. You type virtual_circuits in the Filter field and click Go. You then type 80 into the CIRCUITS field and click Apply.

Answer

You click All Initialization Parameters in the Instance section of the Administration tabbed page. You type circuits in the Filter field and click Go. You then type 80 into the Value field for the CIRCUITS parameter and click Apply.

Question

Match the initialization parameters used to configure Shared Server to their corresponding definitions.

Options:

  1. CIRCUITS
  2. MAX_SHARED_SERVERS
  3. SHARED_SERVERS
  4. SHARED_SERVER_SESSIONS

Targets:

  1. The maximum number of server processes that can run simultaneously
  2. The minimum number of server processes that can run concurrently
  3. The total number of virtual circuits for inbound and outbound network sessions
  4. The total number of shared server sessions that can run concurrently

Answer

MAX_SHARED_SERVERS sets the maximum number of server processes, and SHARED_SERVERS sets the minimum number of server processes. CIRCUITS sets the total number of virtual circuits for sessions, and SHARED_SERVER_SESSIONS sets the total number of shared server sessions that can run concurrently.

The CIRCUITS parameter controls the number of virtual circuits, which are the user connections made to the database through dispatchers and servers.

The MAX_SHARED_SERVERSparameter is needed to control the instance, which creates additional shared servers to service the needs of the Common Request Queue.

It is not essential to set SHARED_SERVERS , because the instance monitors the Common Request Queue and adds shared servers accordingly.

The SHARED_SERVER_SESSIONS parameter can also be used to reserve user sessions for dedicated servers.

Summary

In order to configure Oracle Shared Server you must update the initialization parameters for the instance.

However, only the DISPATCHERS parameter is required in most systems. This parameter is used to start one or more dispatchers for the network protocol. You can also set various attributes for each dispatcher using the name-value syntax. Only the protocol attribute, usually TCP, is required.

To control the minimum and maximum number of server processes that can run concurrently, you use the SHARED_SERVERS and MAX_SHARED_SERVERS parameters respectively. The SHARED_SERVERS parameter is less important, as the instance monitors the Common Request Queue so it knows when to add shared servers. However, the MAX_SHARED_SERVERS parameter is needed to limit how many shared servers are added.

You can also set the CIRCUITS parameter to control how many virtual circuits are available for inbound and outbound network sessions. To control the total number of shared server sessions that can run concurrently, you set the SHARED_SERVER_SESSIONS parameter.

No comments: