Create two connection modes (dedicated server and Shared Server) for connecting to the Oracle Database Server.

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 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, the advantages and disadvantages of the two connection methods have their own advantages and disadvantages. In dedicated server mode, each user has a connection, so some applications do not occupy the connection, causing other customers' requests to be suspended. The biggest drawback is the memory management. As the number of connections increases, a PGA is allocated for each added connection. If the number of connections increases by 10000, 10000 PGA is required, memory is easy to eat. The advantage of the shared connection mode is that the number of connections is fixed, so the amount of memory does not occupy a lot. However, during database initialization, the shared server must be initialized. For example, there are 100 shared servers, in the shared connection mode, UGA is allocated to the PGA. Therefore, a large amount of memory needs to be initialized during initialization, that is, the memory of 100 UGA instances. In addition, the shared server also has the advantage that many advanced database connection features require the use of shared servers, so sometimes to use these features have to be set to the shared server connection mode. The biggest drawback of the Shared Server is that when running in the data warehouse mode, if a large number of requests require a long time to occupy the server, it will cause many other requests to be suspended, this reduces the performance of the entire server. In addition, when some application servers provide connection pools, for example, J2EE often has application server connection pools, such as WebLogic, open source DBCP, and c3p0. When these connection pools are available, the Shared Server is cumbersome in terms of performance. In addition, sometimes, when using a Shared Server, the process occupying the server tries to lock the data not processed by the previous transaction because the data transaction is not processed in a timely manner, which may cause a database deadlock, in particular, if the connection lock timeout is not set, it can only be solved by killing the process in the database on the DBA. However, there is also the best solution, that is, the hybrid mode, that is, for the same database server, there are both dedicated servers and shared servers, sharing servers are used to deal with that highly transactional activity. Dedicated servers are used to deal with requests that consume time and resources. Of course, it depends on the actual situation and how to make a decision. There is no absolute difference between the two.

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.