Oracle Private Mode (dedicated) and shared mode (SHARE)

Source: Internet
Author: User
Tags dedicated server sqlplus

Oracle is a broad and profound technology. After 2 years of playing Oracle, there are still a lot of knowledge points unclear. Yesterday the group of Friends mentioned the dedicated and SHARE two modes. Not clear, silently do some homework. From the Internet to search a bit of knowledge, organize the following:  dedicated server (dedicated): A client connection corresponding to a server process sharing server (SHARE): Multiple client connections to a server process, the server side exists a process scheduler to manage. It must use net services. This means that TNS must be configured. It is suitable for high concurrency, small amount of things, if this time using the sharing mode, can greatly reduce the high concurrency for the Oracle Server resource consumption. Shared server architecture: The client process eventually connects to a scheduler, where the Pmon process registers the scheduler's location and load, enabling the listener to commit to the least-loaded scheduler. A scheduler can concurrently support multiple client connections.    Dedicated Server architecture: Each client process is connected to a dedicated server process. The server process was not shared by any other client.         Another: The dedicated server architecture does not support HTTP and IIOP customers, only TTC customers are supported. In general, we use the Oracle default dedicated server approach, there is no need for shared server mode. One is that we use middleware (such as: WebLogic) to the Oracle, the middleware itself has a connection pooling mechanism, the other is the oracle of this shared server is not good enough, there are many shortcomings. Shared servers have the following disadvantages: 1) The code path for a shared server is longer than a dedicated server, so it is inherently slower than a dedicated server. 2) There is the possibility of an artificial deadlock, because it is serial, and as long as a connection is blocked, all users on that server process are blocked and are highly likely to deadlock. 3) There is the possibility of an exclusive transaction, because if a session has a transaction that takes too long to run, it exclusively shares the resource, and the other user can only wait, while the dedicated server, each client is a session. 4) Shared server mode restricts certain database features, such as: You cannot start and shut down instances individually, you cannot perform media recovery, you cannot use log Miner, and the sql_trace is meaningless (because it is a share instead of the current session). MTS reduced memory is actually the memory required for each user to connect to the operating system process in dedicated server mode, but it uses the large_pool of the SGA to allocate UGA, pay Paul, and the reduced memory is minimal. If the connection and disconnection of a user session is frequent, the cost of creating and deleting the database process is very high, preferably in a shared server mode (otherwise, connection pooling technology should be used). Using Shared server mode is of little significance if the client is used for a lifetime (during the session life cycle) for a single connection. Because most of the time, a session is connected to a server process and the server process cannot be shared. Some instructions for the shared Services initialization parameter: Shared_servers: Specifies the number of shared server process starts when instance is started, do not set this parameter too large, the user will take more time to start the database instance , the shared_servers is dynamically adjusted according to the load after Oracle starts. If 0, indicates that the database does not start the shared services mode. This parameter is required for the configuration of shared server, and only this parameter is required.   Modify Parameters:  alter System set shared_servers=1;max_shared_servers:oracle the largest available shared server at the same time Process. Do not set this parameter to less than shared_servers, if dynamically modifying shared_servers greater than max_shared_servers,oracle overrides the value of Max_shared_servers. At this point you need to modify max_shared_servers. Also cannot be greater than processes. This parameter is intended for use in large resource operations (batch processing), in order to reserve some process for DBA tasks (Rman Backup), Shared_server_sesions: Specifies the number of shared server sessions that are allowed altogether. If this parameter is set, then do not exceed the value of sessions, if not set this value, then as long as there is idle session, it can be used. Setting this value is reserved for the private connection user sessions.dispatchers: Configure dispatcher process. If you do not set this parameter, as long as the shared_servers is set, the Oracle A TCP protocol-based dispatcher is also automatically set. Also need to see how many connections    SQL> select * FROM v$dispatcher;max_dispatchers the operating system supports a dispatcher can handle: Set the number of dispatchers that can run simultaneously at the same time, must be greater thanTo dispatchers, less than processes. This parameter will also be overwritten by dispatchers. Circuits: Specifies the total number of virtual circuits. Turn off sharing mode: If you set the Shared_servers parameter to 0, all shared connections to the database will not succeed, but a shared connection that is not freed continues to remain connected until it is disconnected. If both Shared_servers and Max_shared_servers are set to 0, then the shared connection will be terminated. If all the shared connections are disconnected, you can use the ALTER system set dispatcher= '; Clears the dispatcher to prevent the next time the database is started and the shared connection mode is turned on. A way to determine whether Oracle is a shared or private mode:  1. Show parameter shared_server; (Note: 8i should be: Show parameter mts_servers;) sql> show parameter shared_server;name             &N Bsp      type        value----------------------------------------------------------- ------------------max_shared_servers           all     20shared_server_sessions & nbsp       integer     330shared_servers                intege R     12.   View V$session View sql> Select Username,server,program from v$session where username are not null; USERNAME          server    program------------------------------------------------------------------------- -----SYS                  dedicated Rman.exerman                dedicated Rman.exesys                  dedicated R Man.exesys                  dedicated sqlplus.exesys       &NB Sp          dedicated rman.exedave                dedicated Toad.exesys                  dedicated Toad.exe3. View monitoring: Lsnrctl servicec:\users\administrator.daviddai>lsnrctl servicelsnrctl for 32-bit windows:version 11.2.0.1.0- Production on 2 June-June -2010 11:7:40 Copyright (c) 1991, Oracle.  all rights reserved. Connected to (description= (address=) (PROTOCOL=IPC)) Service Summary: The service "ORCL" consists of 1Instance.    instance "ORCL", state ready, 1 handlers containing this service ...     handlers:       "dedicated" established: 34 rejected Absolute: 0 Status:ready         LOCAL Server service "Orclxdb" contains 1 instances.    instance "ORCL", state ready, contains 1 handlers for this service ...     handlers:       "D000" established: 0 has been rejected: 0 Current: 0 Max: 1022 status: ready         DISPATCHER <machine:daviddai, pid:10884>   &nb Sp     (address= (PROTOCOL=TCP) (Host=daviddai) (port=58400) command execution succeeded 4. View the Tnsnames.ora file. such as: ORCL =   (DESCRIPTION =     (address_list =       (ADDRESS = (PROTOCOL = TCP ) (HOST = Daviddai) (PORT = 1521))           (connect_data =       (SERVER = dedicated)        (service_name = ORCL)     )   ) Here is the dedicated private mode connection ORCL Instance. Write on (server = shared) is using the shared server mode, but then shared_server_process needs to be open, or it will fail to connect to Oracle. If this paragraph is not written, then the system will be based on the serverMode automatic adjustment, but according to the measured results, even if the server is defined as a shared server mode, shared_server_process is not open, the connection found in v$session is still server = dedicated. So basically we have this paragraph we can be empty to write, but sometimes to connect our shared server model of the database, empty there may be the system think to use a shared server way to connect, then declare the server = Dedicated use a dedicated server way to connect. When the database is started, if Shared_servers is not specified, but dispatchers is set, then Oracle considers the shared server to be started and the shared_servers is set to 1. When the database is started, shared_servers is not set, dispatchers is not set, even if dispatchers is modified later and shared server cannot be started, the database must be restarted.   In addition, Background process, as well as through local connections, can only be dedicated. For example Sqlplus user/pass form if the database does not have a shared server configured, Then the client can only connect to the database in dedicated mode. The ORA-12545 connection fails because the object host or object does not exist. Ora-12545:connect failed because target host or object does not existcause:the address specified are not valid, or the prog Ram being connected to does not exist. Action:ensure The ADDRESS parameters has been entered correctly; The most likely incorrect parameter is the node name. Ensure the executable for the server exists (perhaps "Oracle" is missing.) If the protocol is TCP/IP, edit the tnsnames. ORA file to change the host name to a numeric IP AddreSS and try again. Modified according to the above requirements, or not, and later modified the host file, in which the server's host IP address is increased, the problem is resolved. The host file for WINDOWS XP is under C:WINDOWS\SYSTEM32\DRIVERS\ETC. The file name is called host, and no extension is known. # Copyright (c) 1993-1999 Microsoft corp.127.0.0.1 localhost10.85.10.80 daviddai in dedicated Server Mode, there is a Dedicated server process for each user process. Select This option if the number of total clients are expected to being small, or when database clients would make persistent , long-running requests to the database. In Shared Server Mode, several client connections share a database-allocated pool of resources. With this mode, a large number of users need to connect to the database. It is also useful when the database memory is limited and for better performance, since can has more client connections T o the database than in dedicated server mode with the same memory. If you choose a shared server mode, you must also indicate the number of servers processes you want to create when an Instanc E is started up. For more information about SEtting This parameter, click help.  http://blog.itpub.net/15672129/viewspace-686318 

Oracle Private Mode (dedicated) and shared mode (SHARE) (RPM)

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.