文章目录

Oracle Dedicated server
. 用户进程和服务器进程是分开的。
. 每个用户进程都有自己的服务器进程。
. 用户进程和服务器进程可在不同的机器上运行,以利用分布式处理的优势。
. 用户进程和服务器进程的比率是1 比1。
. 即使用户进程不发出数据库请求,专用服务器也存在,只是保持空闲状态。
此处所用的程序接口取决于用户进程和专用服务器进程是否在同一台机器上。如果在同一
机器上,进程间的程序接口将使用主机操作系统的交互进程通信(IPC) 机制。
Oracle Shared Server
. 在Oracle Shared Server 体系结构下,客户机-用户进程最终会与调度程序建立连接。
. PMON 进程向监听程序注册调度程序的位置和负载,使监听程序能够将请求转发给占用率最低的调度程序。服务注册不要求在listener.ora 文件中进行配置。
. 一个调度程序可同时支持多个客户机连接。每个客户机连接都使用一个虚拟线路。虚拟线路是一块共享内存,调度程序将它用于客户机数据库连接请求与答复。
Oracle Shared Server **dedicated server的比较
. shared server结构可以减少针对某一例程的进程数目,增加可服务的用户数,实现负载平衡,减少空闲服务器进程的数目,减少系统内存占用和系统开销
. dedicated server结构下,各个用户进程和事务之间不会互相影响,比如系统存在很多long-running事务的时候,最好使用dedicated server结构
. 理论情况下,oltp(事务多而小)可以建议使用shared server,非oltp(事务少而大)建议使用dedicate server
. 实际情况下,很多系统都是既有oltp特性又有非oltp特性的,所以建议在系统资源充足的情况下,最好使用dedicated server,这样减少事务之间的干扰。
当然在有些情况下,必须使用shared server,比如要使用oracle net connection pooling的特性的话。
设置**shared serverSQL> show parameter dispatchers

NAME TYPE VALUE
-—————————————————- —————- ———————————————
dispatchers string
max_dispatchers integer
SQL>

alter system set dispatchers='(protocol=tcp) (dispatchers=4)';

System altered.

SQL> show parameter dispatchers

NAME TYPE VALUE
-—————————————————- —————- ———————————————
dispatchers string (protocol=tcp) (dispatchers=4)
max_dispatchers integer
SQL>SQL>

show parameter shared_servers

NAME TYPE VALUE
-—————————————————- —————- ———————————————
max_shared_servers integer
shared_servers integer 0
SQL>

alter system set shared_servers=2;System altered.SQL> show parameter shared_servers

NAME TYPE VALUE
-—————————————————- —————- ———————————————
max_shared_servers integer
shared_servers integer 2
SQL>SQL>

show parameter circuits

NAME TYPE VALUE
-—————————————————- —————- ———————————————
circuits integerSQL> show parameter session

NAME TYPE VALUE
-—————————————————- —————- ———————————————
sessions integer 170SQL> alter system set circuits=170;System altered.SQL>
SQL>

conn 
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 
Connected as systemSQL> select name,network,paddr,status from v$dispatcher;

NAME NETWORK PADDR STATUS
-—- ———————————————————————————————————————— ———— ————————
D000 (ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32774)) 2A220390 WAIT
D001 (ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32775)) 2A220948 WAIT
D002 (ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32776)) 2A220F00 WAIT
D003 (ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32777)) 2A2214B8 WAITSQL> select dispatcher, circuit, server, status from v$circuit;DISPATCHER CIRCUIT SERVER STATUS
-————- ———— ———— ————————
2A2214B8 280A7E1C 00 NORMAL
2A220F00 27FD4624 2A221A70 NORMAL
SQL>

select * from v$shared_server;

NAME PADDR STATUS MESSAGES BYTES BREAKS CIRCUIT IDLE BUSY REQUESTS
-—- ———— ———————— ————— ————— ————— ———— ————— ————— —————
S000 2A221A70 EXEC 87 35195 1 27FD4624 72123 347 40
S001 2A222028 EXEC 384 229881 2 00 71836 615 88SQL> select * from v$queue;PADDR TYPE QUEUED WAIT TOTALQ
-———- ————— ————— ————— —————
00 COMMON 0 14 147
2A220390 DISPATCHER 0 3 24
2A220948 DISPATCHER 0 10 80
2A220F00 DISPATCHER 0 8 84
2A2214B8 DISPATCHER 0 4 105

SQL>SQL>

select sid,audsid,paddr,username,status,server,machine,terminal,program from v$session where username is not null;

SID AUDSID PADDR USERNAME STATUS SERVER MACHINE TERMINAL PROGRAM
-— ————— ———— ————- ———— ————- ————————- ———— ——————————————
141 80289 2A222028 SYSTEM ACTIVE SHARED WORKGROUP\SEAGULL SEAGULL PLSQLDev.exe
143 80283 2A2225E0 SYSTEM INACTIVE DEDICATED seagull pts/1 (TNS V1-V3)
145 80287 2A2214B8 SYSTEM INACTIVE NONE WORKGROUP\SEAGULL SEAGULL PLSQLDev.exe
159 4294967295 2A21DB88 SYS INACTIVE DEDICATED seagull pts/0 (TNS V1-V3)
SQL> !lsnrctl servicesLSNRCTL for Linux: Version 10.2.0.3.0 - Production on 21-FEB-2008 11:35:33Copyright (c) 1991, 2006, Oracle. All rights reserved.Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary…
Service “ora10g” has 1 instance(s).
Instance “ora10g”, status READY, has 5 handler(s) for this service…
Handler(s):
“D003” established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32777))
“D002” established:1 refused:0 current:1 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32776))
“D001” established:1 refused:0 current:1 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32775))
“D000” established:1 refused:0 current:1 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32774))
“DEDICATED” established:0 refused:0 state:ready
LOCAL SERVER
Service “ora10g_XPT” has 1 instance(s).
Instance “ora10g”, status READY, has 5 handler(s) for this service…
Handler(s):
“D003” established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32777))
“D002” established:1 refused:0 current:1 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32776))
“D001” established:1 refused:0 current:1 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32775))
“D000” established:1 refused:0 current:1 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=32774))
“DEDICATED” established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfullySQL>

文章目录