`
edwards0307
  • 浏览: 26122 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

Dedicated Server and Shared Server

 
阅读更多

1.concepts about DS and SS

 

   DS:Oracle will create a new process for me when I log in. This is commonly
referred to as the dedicated server configuration, since a server process will be dedicated to me
for the life of my session.

         One client process mapping to One DS process

                                                                                          datafiles

               client----- DS server process--get data from-----

                                                                                          sga

                                                       

    

   SS(MTS):In shared server mode, the shared processes are generally started up with the database.

                 the client connection will send a request to the dispatcher. The dispatcher will first place       this request onto the request queue in the SGA (1). The first available shared server will dequeue this request (2) and process it. When the shared server completes,
the response (return codes, data, and so on) is placed into the response queue (3), subse-
quently picked up by the dispatcher (4), and transmitted back to the client.

                client------dispatchers------request quence------

                                                                                         |

                                                                                         |   

                                                                       available shared server process

 

                                                                                         |

                                                                                         |

                                                                                    get data

                                                                                         |

                                                                                         |

                                                       shared server  place the response into the the response queue

 

   Note:Both dedicated and shared server processes have the same job: they process all of the SQL you give to them. When you submit a SELECT * FROM EMP query to the database, an Oracle dedi-cated/shared server process parses the query and places it into the Shared pool (or finds it in the Shared pool already, hopefully). This process comes up with the query plan, if necessary,
and executes the query plan, perhaps finding the necessary data in the buffer cache or reading  the data from disk into the buffer cache.

 

   Connection and Session

   

   Note:

           A connectionmay have zero, one, or more sessions established on it. Each session is separate and inde-pendent, even though they all share the same physical connection to the database.

           A connection is simply a physical circuit between your client process and the database instance—a network connection, most commonly. The connection may be to a dedi-
   cated server process or to a dispatcher. As previously stated, a connection may have zero or more sessions, meaning that a connection may exist with no corresponding sessions.

           A session is a logical entity that exists in the instance,It is  your session in the server, where you execute SQL, commit transactions, and run stored procedures.

 

   Dedicated Server

   1.one connection have one or zero session

   client:sqlplus hr/hr@oraclelsh

   server:ps -ef| grep oracle

     oracle    5438     1  0 12:09 ?        00:00:00 oraclelsh (LOCAL=NO)

   client:disconnect

   server:ps -ef| grep oracle

     oracle    5438     1  0 12:09 ?        00:00:00 oraclelsh (LOCAL=NO)

    2.one connection two sessions

    client: sqlplus system/oracle@oraclelsh

    server:ps -ef | grep oracle

       oracle    1234    1  0 12:09 ?        00:00:00 oraclelsh (LOCAL=NO)

    select sid,username,addr from v$session;

               1234 system

   client:  set autotrace on

   select sid,username,addr from v$session;

               1234 system

               1235 system

   server: ps  -ef | grep oracle

               1234 system 

 

   Shared Server

      dispatchers(if ora-00105,we modify it in the pfile.then create spfile,last statup)

      max_dispatchers

      shared_servers

      max_shared_servers

      circuits

      shared_server_sessions

      ora_d000_lsh(dispatchers processes)

      ora_s000_lsh(shared server processes)

        server=shared/dedicated

     1 when in shared server connection. we can not startup,shutdown immediate,backup.(

      ORA-00106: cannot startup/shutdown database when connected to a dispatcher)

      we statup,shudown database in dedicated server.

     2.ORA-12520: TNS:listener could not find available handler for requested type of servercheck server is in DD or MTS.

        in tnsnames.ora,we choice error way(server=dedicated or shared)

        alter system set dispatchers='(protocol=tcp)(dispatchers=1)'

     3. view the current session use which connection type.

         select sid from v$mystat;

         select server from v$session;

     4.ERROR:ORA-12523: TNS:listener could not find instance appropriate for the client connection

          (SERVICE_NAME = db_name.db_domain)   

            

          v$circuit

          v$dispatcher

          v$shared_server

          v$queue

          v$sesson

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics