专用服务器连接---(server = dedicated)共享服务器连接---(server = shared)那么如何配置共享服务器呢?有两个参数是必须的:dis
在某些应用中共享服务器还是有独特的优势的,从官方描述中可以看到如下优势:
减少实例进程的数目
增加对外服务的用户数目
减少无用或者空闲服务器的进程数目
减少oracle数据库对内存占用和os的开销
实现负载平衡
相对于专有服务器模式,一个比较重要的区别是共享服务器要求使用net services来连接,即使用户经常和服务器进程在同一台机器上也是如此。
但是在某些情况下必须使用专用服务器:比如使用sysdba登陆进行管理操作的时候。
当然,要使用这两种不同的模式,,重要的还是在服务器进行配置后还要在客户端的连接串配置有所体现
专用服务器连接---(server = dedicated)
共享服务器连接---(server = shared)
那么如何配置共享服务器呢?有两个参数是必须的:
dispatchers
shared_servers
可选择配置的参数:
max_dispatchers
max_shared_servers
circuits
shared_server_sessions
大部分情况下我们只要修改dispatchers即可,我们先看下默认的专用服务器情况下参数:
[oracle@test ~]$ sqlplus /as sysdba
sql*plus: release 10.2.0.5.0 - production on tue aug 14 15:04:26 2012
copyright (c) 1982, 2010, oracle. all rights reserved.
connected to:
oracle database 10g enterprise edition release 10.2.0.5.0 - production
with the partitioning, olap, data mining and real application testing options
sys@gt10g> select * from v$version;
banner
----------------------------------------------------------------
oracle database 10g enterprise edition release 10.2.0.5.0 - prod
pl/sql release 10.2.0.5.0 - production
core 10.2.0.5.0 production
tns for linux: version 10.2.0.5.0 - production
nlsrtl version 10.2.0.5.0 - production
sys@gt10g> show parameter disp;
name type value
------------------------------------ -------- ------------------------------
dispatchers string (protocol=tcp) (service=gt10gxdb)
max_dispatchers integer
共享服务器和专用服务器还可以从监听程序的信息体现出来,我们先记录下修改之前的专用服务器的监听状态和信息:
[oracle@test ~]$ lsnrctl status
lsnrctl for linux: version 10.2.0.5.0 - production on 14-aug-2012 15:03:32
copyright (c) 1991, 2010, oracle. all rights reserved.
connecting to (description=(address=(protocol=tcp)(host=test)(port=1521)))
status of the listener
------------------------
alias listener
version tnslsnr for linux: version 10.2.0.5.0 - production
start date 14-aug-2012 14:52:08
uptime 0 days 0 hr. 11 min. 24 sec
trace level off
security on: local os authentication
snmp off
listener parameter file /u01/oracle/10g/product/10.2.0/db_1/network/admin/listener.ora
listener log file /u01/oracle/10g/product/10.2.0/db_1/network/log/listener.log
listening endpoints summary...
(description=(address=(protocol=tcp)(host=test)(port=1521)))
(description=(address=(protocol=ipc)(key=extproc0)))
services summary...
service plsextproc has 1 instance(s).
instance plsextproc, status unknown, has 1 handler(s) for this service...
service gt10g has 1 instance(s).
instance gt10g, status ready, has 1 handler(s) for this service...
service gt10gxdb has 1 instance(s).
instance gt10g, status ready, has 1 handler(s) for this service...
service gt10g_xpt has 1 instance(s).
instance gt10g, status ready, has 1 handler(s) for this service...
the command completed successfully
[oracle@test ~]$ lsnrctl service
lsnrctl for linux: version 10.2.0.5.0 - production on 14-aug-2012 15:03:39
copyright (c) 1991, 2010, oracle. all rights reserved.
connecting to (description=(address=(protocol=tcp)(host=test)(port=1521)))
services summary...
service plsextproc has 1 instance(s).
instance plsextproc, status unknown, has 1 handler(s) for this service...
handler(s):
dedicated established:0 refused:0
local server
service gt10g has 1 instance(s).
instance gt10g, status ready, has 1 handler(s) for this service...
handler(s):
dedicated established:0 refused:0 state:ready
local server
service gt10gxdb has 1 instance(s).
instance gt10g, status ready, has 1 handler(s) for this service...
handler(s):
d002 established:0 refused:0 current:0 max:1022 state:ready
dispatcher
(address=(protocol=tcp)(host=test)(port=47446))
service gt10g_xpt has 1 instance(s).
instance gt10g, status ready, has 1 handler(s) for this service...
handler(s):
dedicated established:0 refused:0 state:ready
local server
the command completed successfully
现在我们要设置一下共享服务器,这里我们只要设置dispatchers参数:
sys@gt10g> alter system set dispatchers = (protocol=tcp)(dispatchers=3)(protocol=ipc)(dispatchers=1);
system altered.
我们首先从监听状态和信息来看下前后的不同:
[oracle@test ~]$ lsnrctl status
lsnrctl for linux: version 10.2.0.5.0 - production on 14-aug-2012 15:07:37
copyright (c) 1991, 2010, oracle. all rights reserved.
connecting to (description=(address=(protocol=tcp)(host=test)(port=1521)))
status of the listener
------------------------
alias listener
version tnslsnr for linux: version 10.2.0.5.0 - production
start date 14-aug-2012 14:52:08
uptime 0 days 0 hr. 15 min. 28 sec
trace level off
security on: local os authentication
snmp off
listener parameter file /u01/oracle/10g/product/10.2.0/db_1/network/admin/listener.ora
listener log file /u01/oracle/10g/product/10.2.0/db_1/network/log/listener.log
listening endpoints summary...
(description=(address=(protocol=tcp)(host=test)(port=1521)))
(description=(address=(protocol=ipc)(key=extproc0)))
services summary...
service plsextproc has 1 instance(s).
instance plsextproc, status unknown, has 1 handler(s) for this service...
service gt10g has 1 instance(s).
instance gt10g, status ready, has 2 handler(s) for this service...
service gt10gxdb has 1 instance(s).
instance gt10g, status ready, has 1 handler(s) for this service...
service gt10g_xpt has 1 instance(s).
instance gt10g, status ready, has 2 handler(s) for this service...
the command completed successfully
[oracle@test ~]$ lsnrctl service
lsnrctl for linux: version 10.2.0.5.0 - production on 14-aug-2012 15:09:22
copyright (c) 1991, 2010, oracle. all rights reserved.
connecting to (description=(address=(protocol=tcp)(host=test)(port=1521)))
services summary...
service plsextproc has 1 instance(s).
instance plsextproc, status unknown, has 1 handler(s) for this service...
handler(s):
dedicated established:0 refused:0
local server
service gt10g has 1 instance(s).
instance gt10g, status ready, has 2 handler(s) for this service...
handler(s):
dedicated established:0 refused:0 state:ready
local server
d000 established:0 refused:0 current:0 max:1022 state:ready
dispatcher
(address=(protocol=ipc)(key=#19006.1))
service gt10gxdb has 1 instance(s).
instance gt10g, status ready, has 1 handler(s) for this service...
handler(s):
d002 established:0 refused:0 current:0 max:1022 state:ready
dispatcher
(address=(protocol=tcp)(host=test)(port=47446))
service gt10g_xpt has 1 instance(s).
instance gt10g, status ready, has 2 handler(s) for this service...
handler(s):
dedicated established:0 refused:0 state:ready
local server
d000 established:0 refused:0 current:0 max:1022 state:ready
dispatcher
(address=(protocol=ipc)(key=#19006.1))
the command completed successfully