Comparison between dedicated Oracle servers and shared servers

Source: Internet
Author: User
Tags dedicated server

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: a dedicated server connection (dedicated server) and a shared server connection (shared server ). 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 is a connection pool concept that is usually used during programming. 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, such as connecting more than 5000 users 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 directly proportional to the processing capability of the system. The figure below shows that when the number of concurrent users exceeds a threshold, the processing capability of the system 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 have a large number of OLTP users) and some are DW, you can consider using dedicated servers and shared servers at the same time. "

View running status:

 
 
  1. Idle> show parameter shared_server mts_servers
  2.  
  3. NAME_COL_PLUS_SHOW_PARAM TYPE
  4. ------------------------------------------------------------
  5. VALUE_COL_PLUS_SHOW_PARAM
  6. ------------------------------------------------------------
  7. Max_shared_servers integer
  8. 20
  9. Shared_server_sessions integer
  10. 165
  11. Shared_servers integer
  12. 1
  13.  
  14. -- If VALUE_COL_PLUS_SHOW_PARAM is greater than 0, it is in dedicated mode.
  15. Idle> select p. program, s. server from v $ session s, v $ process p
  16. 2 where s. paddr = p. addr
  17. 3;
  18.  
  19. PROGRAM SERVER
  20. ---------------------------------------------------------
  21. Oracle @ infa (PMON) DEDICATED
  22. Oracle @ infa (DBW0) DEDICATED
  23. Oracle @ infa (LGWR) DEDICATED
  24. Oracle @ infa (CKPT) DEDICATED
  25. Oracle @ infa (SMON) DEDICATED
  26. Oracle @ infa (RECO) DEDICATED
  27. Oracle @ infa (TNS V1-V3) DEDICATED
  28. Oracle @ infa (TNS V1-V3) DEDICATED
  29. Oracle @ infa (TNS V1-V3) DEDICATED
  30. Oracle @ infa (TNS V1-V3) DEDICATED
  31. Oracle @ infa (TNS V1-V3) DEDICATED
  32. Oracle @ infa (TNS V1-V3) DEDICATED
  33. Oracle @ infa (TNS V1-V3) DEDICATED
  34. Oracle @ infa (TNS V1-V3) DEDICATED
  35. Oracle @ infa (TNS V1-V3) DEDICATED
  36.  
  37. 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.

Original article title: differences between dedicated Oracle servers and shared servers

Link: http://www.cnblogs.com/programwjy/archive/2010/08/24/1807249.html

Related Article

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.