ITPub博客

首页 > 数据库 > Oracle > [20191203]后台进程dbrm关闭.txt

[20191203]后台进程dbrm关闭.txt

原创 Oracle 作者:lfree 时间:2019-12-03 15:48:59 0 删除 编辑

[20191203]后台进程dbrm关闭.txt

--//上午分析了resmgr:cpu quantum等待事件,分析主要参考链接:https://www.iteye.com/blog/dbzone-2359348.
--//里面提到:
alter system set "_resource_manager_always_off"=true scope=spfile;
alter system set "_resource_manager_always_on"=false scope=spfile;

--//可以关闭后台进程dbrm.自己测试看看.

1.环境:
SYS@book> @ ver1
PORT_STRING         VERSION        BANNER
------------------- -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SYS@book> @ bg dbrm
old   1: select  addr,pid,spid,program from v$process where background=1 and PROGRAM like upper('%&1%')
new   1: select  addr,pid,spid,program from v$process where background=1 and PROGRAM like upper('%dbrm%')
ADDR                 PID SPID   PROGRAM
---------------- ------- ------ --------------------------
00000000861FA4D8       7 2317   oracle@gxqyydg4 (DBRM)
--//注:我在测试环境测试过,直接kill -9 2317 数据库会crash.千万不要在生产系统做这步测试!!

SYS@book> @ hide _resource_manager_always_o
NAME                           DESCRIPTION                         DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES ISSYS_MOD
------------------------------ ----------------------------------- ------------- ------------- ------------ ----- ---------
_io_resource_manager_always_on io resource manager always on       TRUE          FALSE         FALSE        FALSE FALSE
_resource_manager_always_off   disable the resource manager always TRUE          FALSE         FALSE        FALSE FALSE
_resource_manager_always_on    enable the resource manager always  TRUE          TRUE          TRUE         FALSE FALSE

--//注:oracle这2个参数很奇怪_resource_manager_always_off,_resource_manager_always_on,理论有1个就ok了.
--//不知道的用意何在...

2.继续:
SYS@book> alter system set "_resource_manager_always_on"=false;
alter system set "_resource_manager_always_on"=false
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
--//无法在线修改.

--//重启数据库:
SYS@book> startup
ORACLE instance started.
Total System Global Area  643084288 bytes
Fixed Size                  2255872 bytes
Variable Size             205521920 bytes
Database Buffers          427819008 bytes
Redo Buffers                7487488 bytes
Database mounted.
Database opened.

SYS@book> @ hide _resource_manager_always_o
NAME                           DESCRIPTION                         DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES ISSYS_MOD
------------------------------ ----------------------------------- ------------- ------------- ------------ ----- ---------
_io_resource_manager_always_on io resource manager always on       TRUE          FALSE         FALSE        FALSE FALSE
_resource_manager_always_off   disable the resource manager always TRUE          FALSE         FALSE        FALSE FALSE
_resource_manager_always_on    enable the resource manager always  FALSE         FALSE         FALSE        FALSE FALSE

SYS@book> @ bg dbrm
ADDR                 PID SPID   PROGRAM
---------------- ------- ------ --------------------------
00000000861FA4D8       7 4496   oracle@gxqyydg4 (DBRM)
--//一样还是启动.

3.继续测试:
SYS@book> alter system set "_resource_manager_always_off"=true;
alter system set "_resource_manager_always_off"=true
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified

SYS@book> alter system set "_resource_manager_always_off"=true scope=spfile;
System altered.

--//再次重启数据库:
SYS@book> startup
ORACLE instance started.
Total System Global Area  643084288 bytes
Fixed Size                  2255872 bytes
Variable Size             205521920 bytes
Database Buffers          427819008 bytes
Redo Buffers                7487488 bytes
Database mounted.
Database opened.

SYS@book> set verify off
SYS@book> @ hide _resource_manager_always_o
NAME                           DESCRIPTION                         DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES ISSYS_MOD
------------------------------ ----------------------------------- ------------- ------------- ------------ ----- ---------
_io_resource_manager_always_on io resource manager always on       TRUE          FALSE         FALSE        FALSE FALSE
_resource_manager_always_off   disable the resource manager always FALSE         TRUE          TRUE         FALSE FALSE
_resource_manager_always_on    enable the resource manager always  FALSE         FALSE         FALSE        FALSE FALSE

SYS@book> @ bg dbrm
no rows selected

--//也就是关闭dbrm进程要设置:
_resource_manager_always_off=TRUE
_resource_manager_always_on=FALSE

4.收尾还原:
SYS@book> show spparameter _resource_manager_always_o
SID NAME                          TYPE    VALUE
--- ----------------------------- ------- -----
*   _resource_manager_always_off  boolean TRUE
*   _resource_manager_always_on   boolean FALSE

SYS@book> alter system reset "_resource_manager_always_on" scope=spfile;
System altered.

SYS@book> alter system reset "_resource_manager_always_off" scope=spfile;
System altered.

SYS@book> show spparameter _resource_manager_always_o

--//重启数据库:
SYS@book> @ bg dbrm
ADDR                 PID SPID   PROGRAM
---------------- ------- ------ --------------------------
00000000861FA4D8       7 4690   oracle@gxqyydg4 (DBRM)

SYS@book> select * from v$bgprocess where NAME='DBRM';
PADDR              PSERIAL# NAME DESCRIPTION               ERROR
---------------- ---------- ---- ------------------------- -----
00000000861FA4D8          1 DBRM DataBase Resource Manager 0

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

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    2548
  • 访问量
    6335941