Configure an Oracle Shared Server

Source: Internet
Author: User
There are two main ways for users to connect to the Oracle database server: private server connection and shared server connection. In the private server mode, when the client sends a connection request to the database

There are two main ways for users to connect to the Oracle database server: private server connection and shared server connection. In the private server mode, when the client sends a connection request to the database

There are two main ways for users to connect to the Oracle database server: private server connection and shared server connection.

In VPC mode, when the client sends a request to connect to the database, the listener is responsible for connecting the client to the VPC process, which serves only the user process of the session, even if it is idle. VPC processes correspond to user processes one by one. Each server process uses system resources, including the CPU cycle and memory.

In a high-load system, because the VPC process occupies memory and CPU resources, it will have a negative impact on the scalability of the system, therefore, the client usually needs to connect to the Apsara stack server of the database through the middleware connection pool or the sharing server of the database.

Related reading:

Configuration Analysis of Oracle Shared Server (Shared Server/MTS)

Research on listener registration mechanism of Oracle Shared Server

In Shared Server mode, client user process connection requests are sent to the dispatch process (dispatcher) with the smallest load by the listener, the scheduling process is responsible for transmitting user requests to a common request queue in SGA. The idle sharing server process completes the user requests in the Request queue and puts the results in the response queue. Finally, the scheduling process retrieves the results in the response queue and returns them to the user process.

The connection between the session and the scheduling process persists during the session, while the connection with the listener is short. All scheduling processes share a public request queue, but each scheduling process has an independent response queue.

Configure the Shared Server

On the server side, the Shared Server is irrelevant to the database, but only to the instance. By dynamically registering an instance, listeners are automatically configured for the shared server.

The shared server requires two required parameters: dispatchers and shared_servers.

The dispatchers parameter controls the number of scheduling processes started in the instance and the behavior of these processes (protocol type, etc.). The max_dispatchers parameter specifies the maximum number of scheduling processes that can be started.

The shared_servers parameter controls the number of shared server processes started in the instance. The max_shared_servers parameter specifies the maximum number of processes that can be started on the Shared Server. The default value is 1/8 of the processers parameter value.

$ Grep-A 5 APPLE $ TNS_ADMIN/tnsnames. ora
APPLE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.90) (PORT = 1522 ))
)
SQL>! Ps aux | grep ora_s0 .. _ orcl | grep-v grep
Oracle 5223 0.0 1.0 666136 15028? Ss ora_s000_orcl
SQL> show parameter dispatchers
NAME TYPE VALUE
---------------------------------------------------------------------------------
Dispatchers string (PROTOCOL = TCP) (SERVICE = orclXDB)
Max_dispatchers integer
SQL> alter system set dispatchers = '(PROTOCOL = TCP) (dispatchers = 3)'; // create three scheduling processes D000, D001, and D002
SQL> select name, network, paddr, status from v $ dispatcher;
NAME NETWORK PADDR STATUS
----------------------------------------------------------------------------------------------------------
D000 (ADDRESS = (PROTOCOL = tcp) (HOST = ora11g.example.com) (PORT = 62238) Route route 7ac8aff0 WAIT
D001 (ADDRESS = (PROTOCOL = tcp) (HOST = ora11g.example.com) (PORT = 54626) WAIT 7ac8c030 WAIT
D002 (ADDRESS = (PROTOCOL = tcp) (HOST = ora11g.example.com) (PORT = 16374) WAIT 7ac8d070 WAIT
SQL>! Ps aux | grep ora_d0 .. _ orcl | grep-v grep
Oracle 9303 0.0 1.0 666976 15992? Ss ora_d000_orcl
Oracle 9392 0.0 1.0 666976 15976? Ss ora_d00w.orcl
Oracle 9396 0.0 1.0 666976 16004? Ss ora_d002_orcl
SQL> alter system set shared_servers = 6; // create 6 response queues S000 ~ S005 (generally a multiple of dispatchers)
SQL> select name, paddr, status, circuit from v $ shared_server;
NAME PADDR STATUS CIRCUIT
----------------------------------------------------
S000 000000007AC8E0B0 WAIT (COMMON) 00
S001 000000007AC8F0F0 WAIT (COMMON) 00
S002 000000007AC90130 WAIT (COMMON) 00
S003 000000007AC91170 WAIT (COMMON) 00
S004 000000007AC921B0 WAIT (COMMON) 00
S005 000000007AC94230 WAIT (COMMON) 00
SQL>! Ps aux | grep ora_s0 .. _ orcl | grep-v grep
Oracle 5223 0.0 1.0 666136 15028? Ss ora_s000_orcl
Oracle 6692 0.1 1.0 666136 15028? Ss ora_s001_orcl
Oracle 6696 0.1 1.0 666136 15028? Ss ora_s002_orcl
Oracle 6700 0.0 1.0 666136 15032? Ss ora_s003_orcl
Oracle 6704 0.1 1.0 666136 15044? Ss ora_s004_orcl
Oracle 6708 0.1 1.0 666136 15032? Ss ora_s005_orcl
SQL> alter system set dispatchers = '(PROTOCOL = TCP) (dispatchers = 3) (listener = apple)'; // register dispathers TO THE LISTENER1 listener separately.
SQL>! Lsnrctl service listener1
--------------- Omitted output ---------------
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.90) (PORT = 1522 )))
Services Summary...
Service "orcl.example.com" has 1 instance (s). Instance "orcl", status READY, has 4 handler (s) for this service...
Handler (s ):
"DEDICATED" established: 0 refused: 0 state: ready
LOCAL SERVER
"D002" established: 0 refused: 0 current: 0 max: 972 state: ready
DISPATCHER
(ADDRESS = (PROTOCOL = tcp) (HOST = ora11g.example.com) (PORT = 16374 ))
"D001" established: 0 refused: 0 current: 0 max: 972 state: ready
DISPATCHER
(ADDRESS = (PROTOCOL = tcp) (HOST = ora11g.example.com) (PORT = 54626 ))
"D000" established: 0 refused: 0 current: 1 max: 972 state: ready
DISPATCHER
(ADDRESS = (PROTOCOL = tcp) (HOST = ora11g.example.com) (PORT = 62238 ))
The command completed successfully

For more details, please continue to read the highlights on the next page:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.