專用服務器連接---(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
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com