Sunday, September 11, 2011

How to enabled Shared Server Environment

Initialization Parameters for Shared Server

The following initialization parameters control shared server operation:
  • SHARED_SERVERS: Specifies the initial number of shared servers to start and the minimum number of shared servers to keep. This is the only required parameter for using shared servers.
  • MAX_SHARED_SERVERS: Specifies the maximum number of shared servers that can run simultaneously.
  • SHARED_SERVER_SESSIONS: Specifies the total number of shared server user sessions that can run simultaneously. Setting this parameter enables you to reserve user sessions for dedicated servers.
  • DISPATCHERS: Configures dispatcher processes in the shared server architecture.
  • MAX_DISPATCHERS: Specifies the maximum number of dispatcher processes that can run simultaneously. This parameter can be ignored for now. It will only be useful in a future release when the number of dispatchers is auto-tuned according to the number of concurrent connections.
  • CIRCUITS: Specifies the total number of virtual circuits that are available for inbound and outbound network sessions.
You need to set two parameter
  1. dispatchers
  2. shared_servers

This command will create three dispatchers and each dispatcher can established 10 sessions.
alter system set dispatchers= "(protocol=tcp)(dispatchers=3)(connections=10)"

This command will create three pre initialized server process for shared server connections.
alter system set shared_servers= 3

By this parameter you can established max 20 sessions for shared servers connections.
alter system set shared_server_sessions= 20

other parameters are:
1. max_dispatchers
MAX_DISPATCHERS specifies the maximum number of dispatcher processes allowed to be running simultaneously. It can be overridden by the DISPATCHERS parameter and is maintained for backward compatibility with older releases.

2. max_shared_servers
MAX_SHARED_SERVERS specifies the maximum number of shared server processes allowed to be running simultaneously. Setting this parameter enables you to reserve process slots for other processes, such as dedicated servers.

When you want to reduce the range of shared servers, you can reduce MAX_SHARED_SERVERS before reducing SHARED_SERVERS. If MAX_SHARED_SERVERS is lower than SHARED_SERVERS, then the number of shared servers will not vary but will remain at the constant level specified by SHARED_SERVERS. If MAX_SHARED_SERVERS is not specified, then a shared server process may be spawned as long as the number of free process slots is greater than 1 / 8 the maximum number of processes, or 2 if PROCESSES is less than 24.


How to established client shared server connections to the database

make entry in tnsnames.ora at client side.

test =
 (description=
    (address_list=
       (address =(protocol=tcp)(host=urhostname)(port=1521))
    )
    (connect_data=
        (service_name=orcl) (server=shared)
    )
 )

Check Listener have dispatcher service register.

 lsnrctl services

Example output



Instance "orcl", status READY, has 3 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
"D000" established:0 refused:0 current:0 max:10 state:ready
DISPATCHER <machine: sales-server, pid: 1689>
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=52414))
"D001" established:0 refused:0 current:0 max:10 state:ready
DISPATCHER <machine: sales-server, pid: 1691>
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=52415))

Listener Control Utility SERVICES Command



The name of the service handler. Dispatchers are named D000 through D999. Dedicated servers have the name of DEDICATED.
This section also identifies the following about the service handler:
  • established: The number of client connections this service handler has established.
  • refused: The number of client connections it has refused.
  • current: The number of client connections it is handling, that is, its current load.
  • max: The maximum number of connections for the service handler, that is, its maximum load.
  • state: The state of the handler:
    - A READY state means that the service handler can accept new connections.
    - A BLOCKED state means that the service handler cannot accept new connections.



No comments:

Post a Comment