Oracle体系结构及备份(十四)——bg-dbwr

一 什么是DBWR进程

 

        DBWR,数据库写进程。

        The database writer writes modified blocksfrom the database buffer cache to the datafiles. Oracle Database allows amaximum of 20 database writer processes (DBW0-DBW9 and DBWa-DBWj). TheDB_WRITER_PROCESSES initialization parameter specifies the number of DBWnprocesses. The database selects an appropriate default setting for thisinitialization parameter or adjusts a user-specified setting based on thenumber of CPUs and the number of processor groups.

 Oracle体系结构及备份(十四)——bg-dbwr_第1张图片

        DBWn写的条件:

                发生检查点

                脏缓存到达限制

                没有自由的缓存

                超时发生

                RAC Ping请求

                表空间离线

                表空间只读

                表被删除或者截断

                开始备份表空间

 

二 操作示例


 [oracle@localhost 桌面]$ sqlplus / as sysdba;

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 6 11:05:47 2013

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  838860800 bytes
Fixed Size		    1222192 bytes
Variable Size		  775948752 bytes
Database Buffers	   58720256 bytes
Redo Buffers		    2969600 bytes
Database mounted.

SQL> SELECT name FROM v$bgprocess WHERE paddr<>'00'; 

NAME
-----
PMON
PSP0
MMAN
DBW0
LGWR
CKPT
SMON
RECO
CJQ0
QMNC
MMON

NAME
-----
MMNL

12 rows selected.

SQL> alter system set db_writer_processes=2 scope=spfile;

System altered.

SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> startup force
ORACLE instance started.

Total System Global Area  838860800 bytes
Fixed Size		    1222192 bytes
Variable Size		  775948752 bytes
Database Buffers	   58720256 bytes
Redo Buffers		    2969600 bytes
Database mounted.

SQL> SELECT name FROM v$bgprocess where paddr<>'00';

NAME
-----
PMON
PSP0
MMAN
DBW0
DBW1
LGWR
CKPT
SMON
RECO
CJQ0
QMNC

NAME
-----
MMON
MMNL

13 rows selected.
SQL> alter system set db_writer_processes=12 scope=spfile;

System altered.

SQL> startup force
ORACLE instance started.

Total System Global Area  838860800 bytes
Fixed Size		    1222192 bytes
Variable Size		  784337360 bytes
Database Buffers	   50331648 bytes
Redo Buffers		    2969600 bytes
Database mounted.
Database opened.
SQL> select name from v$bgprocess where paddr<>'00';

NAME
-----
PMON
PSP0
MMAN
DBW0
DBW1
DBW2
DBW3
DBW4
DBW5
DBW6
DBW7

NAME
-----
DBW8
DBW9
DBWa
DBWb
LGWR
CKPT
SMON
RECO
CJQ0
QMNC
MMON

NAME
-----
MMNL

23 rows selected.

SQL> alter system set db_writer_processes=24 scope=spfile;

System altered.

SQL> startup force
ORACLE instance started.

Total System Global Area  838860800 bytes
Fixed Size		    1222192 bytes
Variable Size		  788531664 bytes
Database Buffers	   46137344 bytes
Redo Buffers		    2969600 bytes
Database mounted.
Database opened.
SQL> select name from v$bgprocess where paddr<>'00';

NAME
-----
PMON
PSP0
MMAN
DBW0
DBW1
DBW2
DBW3
DBW4
DBW5
DBW6
DBW7

NAME
-----
DBW8
DBW9
DBWa
DBWb
DBWc
DBWd
DBWe
DBWf
DBWg
DBWh
DBWi

NAME
-----
DBWj
LGWR
CKPT
SMON
RECO
CJQ0
QMNC
MMON
MMNL

31 rows selected.
SQL> select name from v$bgprocess where paddr<>'00' and name like 'DB%';

NAME
-----
DBW0
DBW1
DBW2
DBW3
DBW4
DBW5
DBW6
DBW7
DBW8
DBW9
DBWa

NAME
-----
DBWb
DBWc
DBWd
DBWe
DBWf
DBWg
DBWh
DBWi
DBWj

20 rows selected.
--32bit系统:dbw0----dbw9(10个)
--64bit系统:dbwa----dbwj(20个)
SQL> select count(name) from v$bgprocess where paddr<>'00' and name like 'DB%';

COUNT(NAME)
-----------
	 20

SQL> alter system set db_writer_processes=1 scope=spfile;

System altered.

SQL> startup force
ORACLE instance started.

Total System Global Area  838860800 bytes
Fixed Size		    1222192 bytes
Variable Size		  788531664 bytes
Database Buffers	   46137344 bytes
Redo Buffers		    2969600 bytes
Database mounted.
Database opened.


三 总结


        1.DBWR,数据库写进程。

        2.DBWn写的条件:发生检查点、脏缓存到达限制、没有自由的缓存、超时发生、RAC Ping请求、表空间离线、表空间只读、表被删除或者截断、开始备份表空间。

        3. db_writer_processes控制DBWn进程的最大数目,可以修改,但不能超过最大值。



  我的邮箱[email protected]   新浪微博@Wentasy27         
  微信公众平台:JustOracle(微信号:justoracle)
  IT交流群:336882565(加群时验证 From CSDN XXX)
  Oracle交流讨论组:https://groups.google.com/d/forum/justoracle
  By Larry Wen


Oracle体系结构及备份(十四)——bg-dbwr_第2张图片 Oracle体系结构及备份(十四)——bg-dbwr_第3张图片 Oracle体系结构及备份(十四)——bg-dbwr_第4张图片
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客]

你可能感兴趣的:(十四,Oracle体系结构及备份,bg-dbwr)