一.DB_BLOCK_CHECKSUM 参数说明
在Oracle 10.2.0.3 之前:
DB_BLOCK_CHECKSUM有2个选项: TRUE 和 FALSE,默认值为TRUE。
在Oracle 10.2.0.3 中:
DB_BLOCK_CHECKSUM有3个选项:OFF | TYPICAL | FULL,默认为TYPICAL.
在Oracle 11g中:
DB_BLOCK_CHECKSUM有5个选项:OFF | FALSE | TYPICAL | TRUE | FULL,默认值为TYPICAL.
但是在Oracle 11g中新增了一个参数:DB_ULTRA_SAFE,其用来管理DB_BLOCK_CHECKSUM参数。 DB_ULTRA_SAFE参数在第二节说明。
关于Oracle 11g新增的参数,可以参考官网:
What's New in Oracle Database Reference?
http://docs.oracle.com/cd/E11882_01/server.112/e25513/whatsnew.htm
Oracle 11g 官网对DB_BLOCK_CHECKSUM 参数的说明:
DB_BLOCK_CHECKSUM determineswhether DBWn and the direct loader will calculate a checksum (anumber calculated from all the bytes stored in the block) and store it in thecache header of every data block when writing it to disk. Checksums areverified when a block is read - only if this parameter is TYPICAL or FULLand the last write of the block stored a checksum.
--DB_BLOCK_CHECKSUM 参数决定了DBWn进程和直接路径读取进程是否为块计算checksum并将该checksum存放在每个数据块的cache header并写入到磁盘中。当该数据块被读取时,该checksum会受到验证, 前提是DB_BLOCK_CHECKSUM 被设置为TYPICAL 或 FULL,且最近一次该块的写出中存有checksum。
In FULL mode,Oracle also verifies the checksum before a change application fromupdate/delete statements and recomputes it after the change is applied. Inaddition, Oracle gives every log block a checksum before writing it to thecurrent log.
--在FULL模式下,Oracle还会当块要发生变化应用前对该块验证checksum,并会在DML update/insert/delete语句引起变化被应用到块后再次计算该checksum。此外,Oracle会对写入到当前redo日志文件的每一个redo block计算checksum。
Starting withOracle Database 11g, most of the log block checksum is done by the generatingforeground processes, while the LGWR performs the rest of the work, for betterCPU and cache efficiency. Prior to Oracle Database 11g, the LGWR solelyperformed the log block checksum.
If thisparameter is set to OFF, DBWn calculates checksums only forthe SYSTEM tablespace, but not for user tablespaces. In addition, nolog checksum is performed when this parameter is set to OFF.
--若该参数设置为OFF,则 DBWn进程仅为system表空间上的对象计算checksum, 而对于普通表空间不计算。
Checksums allowOracle to detect corruption caused by underlying disks, storage systems, or I/Osystems. If set to FULL, DB_BLOCK_CHECKSUM also catchesin-memory corruptions and stops them from making it to the disk. Turning onthis feature in TYPICAL mode causes only an additional 1% to 2%overhead. In the FULL mode it causes 4% to 5% overhead. Oracle recommendsthat you set DB_BLOCK_CHECKSUM to TYPICAL.
--checksum让Oracle具备检测由底层磁盘、存储子系统、IO子系统引起的坏块。若设置为FULL, 则DB_BLOCK_CHECKSUM还会捕捉内存讹误并避免将存在逻辑讹误的块被写入到磁盘上。设置DB_BLOCK_CHECKSUM为TYPICAL模式可能引起1%-2%的性能损耗,设置为FULL mode可能引起4%-5%的性能损耗。Oracle推荐用户设置DB_BLOCK_CHECKSUM为TYPICAL。
For backwardcompatibility the use of TRUE (implying TYPICAL)and FALSE (implying OFF) values is preserved.
二.DB_ULTRA_SAFE 参数说明
该参数是Oracle 11g新增的参数。 Oracle 对该参数的解释:
DB_ULTRA_SAFE setsthe default values for other parameters that control protection levels.
简单点,DB_ULTRA_SAFE参数整合了DB_BLOCK_CHECKING, DB_BLOCK_CHECKSUM, 和 DB_LOST_WRITE_PROTECT三个参数。
DB_ULTRA_SAFE ={ OFF | DATA_ONLY | DATA_AND_INDEX },默认值为OFF。
当DB_ULTRA_SAFE 设置为:
(1)OFF:
When anyof DB_BLOCK_CHECKING, DB_BLOCK_CHECKSUM, or DB_LOST_WRITE_PROTECT areexplicitly set, no changes are made.
--不改变这三个参数的值。
(2)DATA_ONLY:
三个参数会按照如下方式进行修改:
DB_BLOCK_CHECKING will be set to MEDIUM.
DB_LOST_WRITE_PROTECT will be set to TYPICAL.
DB_BLOCK_CHECKSUM will be set to FULL.
(3)DATA_AND_INDEX:
三个参数会按照如下方式进行修改:
DB_BLOCK_CHECKING will be set to FULL.
DB_LOST_WRITE_PROTECT will be set to TYPICAL.
DB_BLOCK_CHECKSUM will be set to FULL.
--查看db_ultra_safe 参数:
SQL> show parameter db_ultra_safe
NAME TYPE VALUE
----------------------------------------------- ------------------------------
db_ultra_safe string OFF
SQL> show parameter db_block_check
NAME TYPE VALUE
----------------------------------------------- ------------------------------
db_block_checking string FALSE
db_block_checksum string TYPICAL
SQL>
--修改db_ultra_safe 为data_only:
SQL> alter system set db_ultra_safe=data_only;
alter system set db_ultra_safe=data_only
*
ERROR at line 1:
ORA-02095: specified initialization parametercannot be modified
--不能直接修改,需要重启实例。
SQL> alter system setdb_ultra_safe=data_only scope=spfile;
System altered.
--生产环境慎用:
SQL> startup force
ORACLE instance started.
Total System Global Area 818401280 bytes
Fixed Size 2232800 bytes
Variable Size 541068832 bytes
Database Buffers 272629760 bytes
Redo Buffers 2469888 bytes
Database mounted.
Database opened.
SQL> show parameter db_ultra
NAME TYPE VALUE
----------------------------------------------- ------------------------------
db_ultra_safe string DATA_ONLY
SQL> show parameter db_block_check
NAME TYPE VALUE
----------------------------------------------- ------------------------------
db_block_checking string MEDIUM
db_block_checksum string FULL
SQL> show parameter db_lost
NAME TYPE VALUE
----------------------------------------------- ------------------------------
db_lost_write_protect string TYPICAL
SQL>