1.专有模式
dedicated server: shared_servers=0
新建一个连接,产生一个新的server prrocess,oracle<sid>

使用dbca创建数据库,选择专有模式,shred_servers=1,有s000,d000进程
SQL> show parameter shared_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers                   integer
shared_servers                       integer     1
SQL> show parameter dispatcher

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dispatchers                          string      (PROTOCOL=TCP) (SERVICE=ORCLXDB)
max_dispatchers                      integer

[oracle@localhost ~]$ ps -ef | grep s00
oracle    4888     0 16:25 ?        00:00:00 ora_s000_ORCL
[oracle@localhost ~]$ ps -ef | grep d00
oracle    4886     0 16:25 ?        00:00:00 ora_d000_ORCL



2.共享模式
 


shared server: shared_servers>0
新建一个连接,不产生新的server process,使用已有的s00n,d00n
连接多,时间短
即使数据库工作在共享模式,其本地连接也是专有的.

SQL> alter system set shared_servers=5 scope=both;

System altered.

SQL> alter system set dispatchers = "(protocol=tcp)(dispatchers=5)(protocol=ipc)(dispatchers=1)"  scope=both;

System altered.

SQL> alter system set max_dispatchers=10 scope=both;

System altered.

SQL> show parameter shared_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers                   integer
shared_servers                       integer     5

SQL> show parameter dispatcher

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dispatchers                          string      (PROTOCOL=TCP) (SERVICE=ORCLXDB), (protocol=tcp)(dispatchers=5)(protocol=ipc)(dispatchers=1)
max_dispatchers                      integer     10

[oracle@localhost ~]$ ps -ef | grep s00
oracle    4183     0 20:31 ?        00:00:00 ora_s000_ORCL
oracle    4741     0 20:50 ?        00:00:00 ora_s001_ORCL
oracle    4743     0 20:50 ?        00:00:00 ora_s002_ORCL
oracle    4745     0 20:50 ?        00:00:00 ora_s003_ORCL
oracle    4747     0 20:50 ?        00:00:00 ora_s004_ORCL

[oracle@localhost ~]$ ps -ef | grep d00
oracle    4181     0 20:31 ?        00:00:00 ora_d000_ORCL
oracle    4764     0 20:50 ?        00:00:00 ora_d001_ORCL


客户端
$ORACLE_HOME/network/admin/tnsnames.ora
-------------------------
    ORCL =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.88)(PORT = 1521))
        )
        (CONNECT_DATA =
         (SERVER = SHARED)
          (SERVICE_NAME = orcl)
        )
      
    
--将Server改为共享模式,此时缺省为共享,新建连接,不产生oracle<sid>进程
--当Server为共享模式,客户端设为专有,仍为专有连接

 

转载自:http://blog.sina.com.cn/s/blog_6caddb500100mp1l.html