Differences between dedicated Oracle servers and shared servers

Source: Internet
Author: User
Tags dedicated server server memory
Transferred from: bytes.
When creating an Oracle database, you should see this option in the database creation assistant wizard, which is the connection mode of the database. In Oracle9i or 10g, we can see two connection modes, one is dedicatedServerA connection (dedicated server) is also called a shared server connection ). Next we will classify the differences between the two connection methods.

Dedicated server mode means that each time you access Oracle, the listener of the Oracle server will get this access request and then create a new process for this access for service. Therefore, access to each client generates a new process for service, which is similar to one-to-one ing. An important feature of this connection mode is that UGA (User-wide) is stored in PGA (process-wide, this feature also demonstrates that the current user's memory space is allocated by process.

The other shared server connection isProgramThe concept of a connection pool is usually used during writing. In this mode, a batch of server connection processes will be created during database initialization, and these connection processes will be put into a connection pool for management. The number of processes in the initialized pool can be set manually during database initialization. When a connection is established, listener first accepts the request for establishing a connection to the client, and then listener generates a process called the dispatcher to connect to the client. The scheduler places client requests in a request queue of the SGA (system full-region), then shares the server connection pool to find whether there are idle connections, and then processes the idle server. After the processing is completed, the processing result is placed in the corresponding queue of the SGA. The scheduler queries the corresponding queue to obtain the returned result and then returns it to the client. The advantage of this connection mode is that the number of server processes can be controlled, and it is unlikely that the server memory will crash due to the large number of connections. However, with the increase in complexity and the corresponding request queue, the probability can be decreased.

In short, in the development phase, the first dedicated server may be better, because there is less complexity in the middle, and the number of connections is usually small during development. In the actual application environment where multiple applications use one database at the same time, the second method may be better, because if 1000 or 10000 requests are suddenly connected at that time, if the database server establishes 10000 connections at the same time, it must be unable to stand it. Of course, it depends on the actual situation and how to make a decision. There is no absolute difference between the two.

Comparison between the two: "If you come to a city and want to do a few things in different places in the city, you have two options for transportation: one is to hire a car. This car will take you from A to B and wait until you finish your work in B and take you from B to C ...... Another option is to call the taxi company to book a taxi, first take you from A to B, then what should you do with the taxi, and you should do your work, take a taxi to another business. After you finish your work on B, you will book a car with the taxi company, taxi companies will contact other taxis near B to pick you up ......

First, the setting of dedicated servers is very simple ----- You do not need to set it. This is the default option of oracle.

For shared servers, you need to make some additional settings. It is not difficult to follow the Administrator guide. The key is that you need to decide how many shared server servers and dispatcher are needed, this requires not only experience accumulation, but also continuous observation and adjustment.
In dedicated servers, all your waits are the Waits of the database itself, and in shared servers, you may need to wait for an available shared server process.

Obviously, when the number of concurrent connections of a user is large, the number of server processes of dedicated servers will also become very large. For the operating system, adding one process means more management burden, you must know that the number of concurrent threads supported by the operating system is not infinite. This means that in dedicate servers, when you have a large number of user connections (for example, more than 5000 users are connected at the same time), your system will be quite burdened. In this case, shared servers can handle relatively better operations, because 5000 users are connected at the same time, and we know that only 1% of connections are active, then we only need to set 50 shared servers to process all user requests well and save system resources.

As a benefit, shared servers can be used to control concurrent. You must know that the number of concurrent users is not proportional to the system's processing capacity (as shown in the following figure). When the number of concurrent users exceeds a threshold, the system's processing capacity will be significantly reduced. Shared servers can control that the system concurrent does not exceed this threshold.

Before the introduction of PGA automatic management, shared servers saves memory than dedicated servers, and after the introduction of the automatically managed PGA, this advantage of shared servers is not as obvious as we think.

Dedicate servers a server process works for a large request for a long time without affecting other users. However, in shared servers, some large requests will affect other users.

Other factors need to be considered. For example, if Weblogic's connecting pool is used at the front end, it may not be necessary for you to use shared servers at the database level, at this time, your user connection has been controlled at the Weblogic level.

Shared servers also has a so-called pseudo-deadlock problem. You can refer to Tom's new book.

We have discussed so many topics about dedicated servers and shared servers. Finally, we will give you a small note: In fact, dedicated servers and shared servers can coexist. In fact, even if you use shared servers, some management operations must also be performed in dedicated mode, such as startup or shutdown database. If it is hard to choose, if some of your applications may be OLTP (a large number of users) and some are DW, you can consider using dedicated servers and shared servers at the same time.

"

View running status:

Idle> show parameter shared_server mts_servers

Name_col_plus_show_param type
---------------------------------------------------------------------------
Value_col_plus_show_param
Certificate -----------------------------------------------------------------------------------------------------------------------------------
Max_shared_servers integer
20
Shared_server_sessions integer
165
Shared_servers integer
1

-- If value_col_plus_show_param is greater than 0, it is in dedicated mode.
Idle> select P. Program, S. server from V $ session S, V $ PROCESS p
2 Where S. paddr = P. ADDR
3;

Program Server
---------------------------------------------------------
Oracle @ INFA (pmon) dedicated
Oracle @ INFA (dbw0) dedicated
Oracle @ INFA (lgwr) dedicated
Oracle @ INFA (ckpt) dedicated
Oracle @ INFA (SMON) dedicated
Oracle @ INFA (reco) dedicated
Oracle @ INFA (TNS V1-V3) dedicated
Oracle @ INFA (TNS V1-V3) dedicated
Oracle @ INFA (TNS V1-V3) dedicated
Oracle @ INFA (TNS V1-V3) dedicated
Oracle @ INFA (TNS V1-V3) dedicated
Oracle @ INFA (TNS V1-V3) dedicated
Oracle @ INFA (TNS V1-V3) dedicated
Oracle @ INFA (TNS V1-V3) dedicated
Oracle @ INFA (TNS V1-V3) dedicated

15 rows selected.

Mode switch:

The Connection established by the client.
If the server is in dedicated mode, it is useless to modify the client.
You can change the parameters in the parameter file to VPC or shared mode.

Sample:

Trace:Http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14231/manproc.htm#sthref630

In most cases, we prefer or are used to the dedicated mode. In the two modes, the distribution of SGA and other resources will be different. Therefore, if you convert the mode to the MTS mode, do not forget that SGA also needs to be adjusted. The most typical is that the MTS mode requires a large large_pool_size. If you really want to switch, take a closer look at Oracle's MTS documentation. The shared connection only places the connection session information in the large pool, so the large pool is larger. The sesion information of the dedicated connection is stored in PGA.

Note:
1. If it is a dedicated server, the client can only create a dedicated server connection
2. If it is a shared server, the client can create the dedicated server connection and shared server connection, as long as the server = dedicated or server = shared is specified in the Service name.

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.