Dynamic conversion and difference between Oracle sharing and dedicated mode

Source: Internet
Author: User
Tags dedicated server
 I haven't figured out the swap dedicated for sharing, found this article http://blog.csdn.net/tianlesoftware/archive/2010/06/26/5695784.aspx

, Let me practice, indeed understand a lot. Most of the following links are converted from this link. You can add them to your favorites for easy searching and learning in the future.

Differences between sharing and dedicated servers:

Dedicated server (dedicated): a client connects to a server process

Share server: Multiple Clients connect to a server process, which is managed by a process scheduler. It must use Net services. That is, TNS must be configured. It is suitable for high concurrency and small transaction volume. If the sharing mode is adopted at this time, it can greatly reduce the resource consumption for the Oracle server due to high concurrency.

 

 

Shared servers have the following Disadvantages:

1) The shared server code path is longer than the dedicated server, so it is inherently slower than the dedicated server.

2) there is a possibility of a human deadlock because it is serial. As long as a connection is blocked, all users on the server process will be blocked and the deadlock is very likely.

3) There is a possibility of exclusive transactions, because if a session's transaction runs for too long, it exclusively shares resources, other users can only wait, while a dedicated server, each client is a session.

4) The Shared Server Mode limits some database features. For example, the instance cannot be started or closed independently, the media cannot be restored, and the log miner cannot be used, SQL _trace does not make sense (because it is shared rather than the current session ).

The memory reduced by MTS is actually the memory required by each user to connect to the operating system process in dedicated server mode. However, it uses the large_pool of SGA to allocate UGA and remove the east wall to complement the west wall, the reduced memory is very small. If user sessions are frequently connected and disconnected, the overhead of database Process Creation and deletion will be very high. In this case, it is best to use the Shared Server mode (otherwise, the connection pool technology should be used ). It is of little significance to use the Shared Server mode if a client is connected for Life (within the session lifecycle. Most of the time, a session is connected to a server process, and server processes cannot be shared.

 

 

Some descriptions of the Sharing Service initialization parameters:
Shared_servers: specify the number of shared server processes started when the instance is started. Do not set this parameter too large. Otherwise, when starting the database instance
It takes more time. After oracle is started, it dynamically adjusts shared_servers Based on the load. If the value is 0, the shared service mode is not enabled for the database. This parameter is
Required to configure Shared Server, and only this parameter is required.

-- Modify parameters:Alter system set shared_servers = 1;

Max_shared_servers: The Shared Server process that Oracle can use at the same time. Do not set this parameter to a value smaller than shared_servers.
Shared_servers is greater than max_shared_servers. Oracle overwrites the value of max_shared_servers. In this case, you need to modify max_shared_servers.
It cannot be greater than processes. This parameter is set for (batch processing) operations that occupy a large amount of resources. In order to reserve some processes for DBA tasks (RMAN backup ),

Shared_server_sesions: Specifies the total number of Shared Server sessions allowed. If this parameter is set, do not exceed sessions.
If this value is set, it can be used as long as there are idle sessions. Set this value to reserve user sessions for the VPC connection.

Dispatchers: configure the dispatcher process. If this parameter is not set, Oracle automatically sets a TCP-based dispatcher as long as shared_servers is set.
You also need to check how many connections can be processed by a dispatcher in the operating system.

SQL> select * from V $ dispatcher;

Max_dispatchers: set the number of dispatchers that can run simultaneously at the same time. The value must be greater than or equal to dispatchers and less than processes. This parameter will also be overwritten by dispatchers.

Disable the scheduling process:
First, you need to query the dispatchers name: Select name, network from V $ dispatcher;
Then shut down the scheduling process: Alter system shutdown immediate 'd000 ';

Circuits: Specifies the total number of virtual circuits.
SQL> select * from V $ circuit;

Disable sharing mode:
If the shared_servers parameter is set to 0 (alter system set shared_servers = 0;), all the shared connections to the database will fail, but the shares will not be released.
The connection continues until it is disconnected. If both shared_servers and max_shared_servers are set to 0 (alter system set max_shared_servers = 0 ;),
The shared connection is terminated. If all the shared connections are disconnected, you can use alter system set dispatcher = ''to clear the dispatcher to prevent the next startup.
The shared connection mode is enabled for the database.

To determine whether Oracle is a shared mode or a dedicated mode:

1. Show parameter shared_server;(Note: 8i should be: Show parameter mts_servers ;)
SQL> show parameter shared_server;

Name type value
-----------------------------------------------------------------------------
Max_shared_servers integer 0
Shared_server_sessions integer
Shared_servers integer 0 -- 0 indicates the dedicated mode

2. view the V $ session View
SQL> select username, server, program from V $ session where username is not null;

Username server program
-------------------------------------
Gwm none
Sys shared plsqldev.exe
Sys shared plsqldev.exe
Sys dedicated sqlplus.exe -- Private Mode

3. view the listener: LSNRCTL Service
$ LSNRCTL Service

LSNRCTL for IBM/AIX assume system/6000: Version 10.2.0.1.0-production on 08-Mar-
14:28:08 2011

Copyright (c) 1991,200 5, Oracle. All rights reserved.

Connecting to (address = (Protocol = TCP) (host =) (Port = 1521 ))
Services summary...
Service "telemt" has 1 instance (s ).
Instance "telemt", status ready, has 2 handler (s) for this service...
Handler (s ):
"Dedicated" Established: 6 refused: 0 state: Ready
Local Server
& Quot; d000 & quot; Established: 51 refused: 0 current: 3 MAX: 1022 state: blocked
Dispatcher <machine: ossdb2, PID: 504060>
(Address = (Protocol = TCP) (host = loopback) (Port = 53932 ))
Service "telemt_xpt" has 1 instance (s ).
Instance "telemt", status ready, has 2 handler (s) for this service...
Handler (s ):
"Dedicated" Established: 6 refused: 0 state: Ready
Local Server
& Quot; d000 & quot; Established: 51 refused: 0 current: 3 MAX: 1022 state: blocked
Dispatcher <machine: ossdb2, PID: 504060>
(Address = (Protocol = TCP) (host = loopback) (Port = 53932 ))
The command completed successfully

4. view the tnsnames. ora File. For example:
Igisdb =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = 134.74.21.51) (Port = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = telemts)
(Server = dedicated)
)
)

In this example, you can connect to the telemts instance in dedicated mode. Write (Server = shared) is to use the Shared Server mode, but the shared_server_process needs
Open (that is, the shared_servers parameter of the Oracle server is to be set to share mode), or else an error occurs that cannot connect to Oracle (ora-12520: TNS: The Listener cannot find for the requested server type
To available processors ).
If this section is left blank and not written, the system will automatically adjust it according to the server mode. However, based on the actual test results, even if the server is defined as the Shared Server mode, shared_server_process is not played.
When enabled, the connection found in V $ session is still Server = dedicated. So basically, we can leave it empty, but sometimes we need to connect to our shared service.
If you leave it empty, the system may think that you need to connect to the database using a Shared Server. Therefore, it is best to declare that server = dedicated uses a dedicated server to connect to the database.

When the database is started, if shared_servers is not specified but dispatchers is set, Oracle considers that shared server is started and
Shared_servers is 1. When the database is started, shared_servers is not set and dispatchers is not set. Even if dispatchers is modified later, it cannot be started.
Shared Server. You must restart the database.

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.