ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【实验】【Shared Server Mode】取消共享服务器模式

【实验】【Shared Server Mode】取消共享服务器模式

原创 Linux操作系统 作者:secooler 时间:2009-07-23 14:40:30 0 删除 编辑
【实验目标】
共享服务器模式     --->  专有服务器模式        
Shared Server Mode --->  Dedicatied Server Mode

【方法一】需要重新启动数据库
中心思想:注释掉shared_servers、max_shared_servers、dispatchers和max_dispatchers四个参数,重启数据库
1.生成待修改的PFILE
sys@ora10g> create pfile from spfile;

File created.

2.修改PFILE,将shared_servers、max_shared_servers、dispatchers和max_dispatchers四个参数删除掉或注释掉
ora10g@testdb /home/oracle$ vi $ORACLE_HOME/dbs/initora10g.ora

3.关闭数据库
sys@ora10g> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

4.通过上面的PFILE生成SPFILE
NotConnected@> create spfile from pfile='$ORACLE_HOME/dbs/initora10g.ora';

File created.

5.重启数据库(这时默认使用的参数文件已经是刚刚生成的SPFILE)
NotConnected@> startup;
ORACLE instance started.

Total System Global Area  562036736 bytes
Fixed Size                  2022312 bytes
Variable Size             163578968 bytes
Database Buffers          390070272 bytes
Redo Buffers                6365184 bytes
Database mounted.
Database opened.

6.OK,修改成功。
sec@ora10g> select server,program,status from v$session order by 1;

SERVER    PROGRAM                                          STATUS
--------- ------------------------------------------------ --------
DEDICATED oracle@testdb (q001)                             ACTIVE
DEDICATED oracle@testdb (PMON)                             ACTIVE
DEDICATED OMS                                              INACTIVE
DEDICATED OMS                                              ACTIVE
DEDICATED OMS                                              INACTIVE
DEDICATED oracle@testdb (q000)                             ACTIVE
DEDICATED OMS                                              INACTIVE
DEDICATED OMS                                              INACTIVE
DEDICATED oracle@testdb (J000)                             ACTIVE
DEDICATED oracle@testdb (QMNC)                             ACTIVE
DEDICATED oracle@testdb (ARC2)                             ACTIVE
DEDICATED oracle@testdb (ARC1)                             ACTIVE
DEDICATED oracle@testdb (ARC0)                             ACTIVE
DEDICATED sqlplus@testdb (TNS V1-V3)                       ACTIVE
DEDICATED oracle@testdb (MMNL)                             ACTIVE
DEDICATED oracle@testdb (MMON)                             ACTIVE
DEDICATED oracle@testdb (CJQ0)                             ACTIVE
DEDICATED oracle@testdb (RECO)                             ACTIVE
DEDICATED oracle@testdb (SMON)                             ACTIVE
DEDICATED oracle@testdb (CKPT)                             ACTIVE
DEDICATED oracle@testdb (LGWR)                             ACTIVE
DEDICATED oracle@testdb (DBW0)                             ACTIVE
DEDICATED oracle@testdb (MMAN)                             ACTIVE
DEDICATED oracle@testdb (PSP0)                             ACTIVE
DEDICATED emagent@testdb (TNS V1-V3)                       ACTIVE

25 rows selected.

【方法二】不需要重新启动数据库
中心思想:在线将shared_servers、max_shared_servers两个参数修改为零(0)。
1.当前共享服务器进程情况
sys@ora10g> select NAME,PADDR,STATUS,MESSAGES,BYTES from v$shared_server;

NAME PADDR            STATUS             MESSAGES      BYTES
---- ---------------- ---------------- ---------- ----------
S000 000000008165ECF0 EXEC                   2330     501830
S001 000000008165F4D8 EXEC                    111      16136
S002 000000008165FCC0 WAIT(COMMON)          12677    2929774

2.先看一下修改shared_servers参数为0的效果
sys@ora10g> alter system set shared_servers=0 scope=both;

System altered.

sys@ora10g> select NAME,PADDR,STATUS,MESSAGES,BYTES from v$shared_server;

NAME PADDR            STATUS             MESSAGES      BYTES
---- ---------------- ---------------- ---------- ----------
S000 000000008165ECF0 EXEC                   2356     505158
S001 000000008165F4D8 EXEC                    187      24957
S002 000000008165FCC0 WAIT(COMMON)          14770    3309104

3.是不是效果不明显呢?那再看看将max_shared_servers参数修改为0的效果
sys@ora10g> alter system set max_shared_servers=0 scope=both;

System altered.

sys@ora10g> select NAME,PADDR,STATUS,MESSAGES,BYTES from v$shared_server;

NAME PADDR            STATUS             MESSAGES      BYTES
---- ---------------- ---------------- ---------- ----------
S000 000000008165ECF0 EXEC                   2386     508998
S001 000000008165F4D8 EXEC                    191      26155
S002 000000008165FCC0 QUIT                  14966    3318519

到这里,所有的服务器进程都被强制终止。

4.OK,在不能重新启动的数据库系统中就可以使用这样的方法进行修改。

-- The End --

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/519536/viewspace-610026/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE 总监,阿里云MVP,北京大学理学硕士,恩墨学院创始人,教育专家,中国区 Cloudera 首位官方授权大数据讲师,金牌培训专家,BDA大数据联盟创始人,OCM联盟创始人,ACCUG创始人、ACOUG核心专家,Blogger。

注册时间:2008-03-16

  • 博文量
    797
  • 访问量
    7974778