签到成功

知道了

CNDBA社区CNDBA社区

Oracle 修改进程的优先级

2018-11-16 21:50 2709 0 原创 Oracle 性能优化
作者: dave

在上篇博客我们讲可以通过修改LGWR进程的优先级来缓解log file sync的等待事件。http://www.cndba.cn/dave/article/3145

http://www.cndba.cn/dave/article/3145

Oracle log file sync 等待事件 与 COMMIT_WAIT,COMMIT_LOGGING 参数说明
https://www.cndba.cn/dave/article/3144http://www.cndba.cn/dave/article/3145

参数是: _high_priority_processes=’VKTM|LMS|LGWR”

从11g开始,LGWR进程默认就在优先级的参数中:

[dave@www.cndba.cn ~]$ orz _param  _high_priority_processes
Session altered.

NAME                     VALUE
---------------------------------------- ----------------------------------------
_high_priority_processes    LMS*|LM1*|LM2*|LM3*|LM4*|LM5*|LM6*|LM7*|
                            LM8*|LM9*|LM*|LCK0|CKPT|DBRM|RMS0|LGWR|CR*|RS0*|RS1*|RS2*

这里是RAC 缓解,所以包含了LMS进程,这个参数是个静态参数,修改必须重启:http://www.cndba.cn/dave/article/3145

[dave@www.cndba.cn dbs]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Fri Nov 16 21:48:08 2018
Version 18.3.1.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.1.0.0
SQL> alter system set "_high_priority_processes"="VKTM|LMS|LGWR" scope=both;
alter system set "_high_priority_processes"="VKTM|LMS|LGWR" scope=both
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified


SQL> alter system set "_high_priority_processes"="VKTM|LMS|LGWR" scope=spfile;

System altered.

SQL> shutdown immedaite
SP2-0717: illegal SHUTDOWN option
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2768239832 bytes
Fixed Size            8899800 bytes
Variable Size          754974720 bytes
Database Buffers     1879048192 bytes
Redo Buffers            7876608 bytes
In-Memory Area          117440512 bytes
Database mounted.
Database opened.
SQL> !orz _param _high_priority_processes

Session altered.


NAME                     VALUE
---------------------------------------- ----------------------------------------
_high_priority_processes         VKTM|LMS|LGWR|LM*|LCK0|CKPT|DBRM|RMS0|LGWR|CR*|RS0*|RS1*|RS2*

但注意这里修改之后的值,还是加了原来默认的选项,如果我们查看pfile,缺是我们修改的值:http://www.cndba.cn/dave/article/3145http://www.cndba.cn/dave/article/3145

SQL> create pfile from spfile;
File created.
[dave@www.cndba.cn dbs]$ cat initcndba1.ora |grep _high_priority_processes
*._high_priority_processes='VKTM|LMS|LGWR'
[dave@www.cndba.cn dbs]$

再修改一次:http://www.cndba.cn/dave/article/3145

http://www.cndba.cn/dave/article/3145
http://www.cndba.cn/dave/article/3145http://www.cndba.cn/dave/article/3145

[dave@www.cndba.cn dbs]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Fri Nov 16 21:48:08 2018
Version 18.3.1.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.1.0.0
SQL>  alter system set "_high_priority_processes"="LWGR" scope=spfile;

System altered.

SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2768239832 bytes
Fixed Size            8899800 bytes
Variable Size          754974720 bytes
Database Buffers     1879048192 bytes
Redo Buffers            7876608 bytes
In-Memory Area          117440512 bytes
Database mounted.
Database opened.

[dave@www.cndba.cn dbs]$ orz _param _high_priority_processes
Session altered.

NAME                     VALUE
---------------------------------------- ----------------------------------------
_high_priority_processes         LWGR|LM*|LCK0|CKPT|DBRM|RMS0|LGWR|CR*|RS0*|RS1*|RS2*

经过对比,我们发现了规律,就是_high_priority_processes是用户指定的进程,实际上还会加上默认的参数值,就是这里的LM|LCK0|CKPT|DBRM|RMS0|LGWR|CR|RS0|RS1|RS2*。 所以如果进程已经存在的话,就没必要在进行修改了。

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2239
    原创
  • 3
    翻译
  • 547
    转载
  • 186
    评论
  • 访问:6628176次
  • 积分:4249
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ