Oracle 参数 COMMIT_WRITE 官方解释,作用,如何配置最优化建议

本站中文解释

COMMIT_WRITE参数定义了系统提交前要写入到数据库相关操作的行为模式。

它可以设置为:

NOWRITE: 表示系统在提交前不进行任何写入操作,可以减少IO操作,但可能引起一些问题,比如redo logs可能因为没有刷新而受到影响;

WRITE: 系统在提交前会对提交操作进行刷新,以确保一致性,但是出现更多的磁盘IO操作;

BATCH: 它主要是结合操作,将多条SQL指令进行批量的处理,可以在做提交前处理比较多的SQL,减少IO处理次数;

FORCE: 系统会强制要求提交操作中的所有写操作都必须进行磁盘刷新,增加的IO操作也更保险。

正确设置方法:

一般来说,由于提交操作具有事务一致性特点,请尽量设置为BATCH或FORCE,有独立事务时可以使用WRITE模式,或者考虑内存中是否有必要把内部操作进行提交,当然也可以使用NOWRITE模式。因为NOWRITE模式会增加系统崩溃时的磁盘不一致性风险,所以最好仅在一些小的和可信的操作中使用它。

官方英文解释

COMMIT_WRITE is an advanced parameter used to control how redo for transaction commits is written to the redo logs.

Property Description

Parameter type

String

Syntax

COMMIT_WRITE = '{IMMEDIATE | BATCH},{WAIT |NOWAIT}'

Default value

If this parameter is not explicitly specified, then database commit behavior defaults to writing commit records to disk before control is returned to the client.

If only IMMEDIATE or BATCH is specified, but not WAIT or NOWAIT, then WAIT mode is assumed.

If only WAIT or NOWAIT is specified, but not IMMEDIATE or BATCH, then IMMEDIATE mode is assumed.

Be aware that the NOWAIT option can cause a failure that occurs after the database receives the commit message, but before the redo log records are written. This can falsely indicate to a transaction that its changes are persistent. Also, it can violate the durability of ACID (Atomicity, Consistency, Isolation, Durability) transactions if the database shuts down unexpectedly.

Modifiable

Yes (at both session-level and system-level). Values supplied for COMMIT_WRITE in an ALTER SYSTEM or ALTER SESSION statement must be separated by a comma.

Modifiable in a PDB

Yes

Range of values

Single-quoted, comma-separated list of either IMMEDIATE or BATCH, and either WAIT or NOWAIT.

Basic

No

Oracle RAC

Each instance may have its own setting

The IMMEDIATE and BATCH options control how redo is batched by Log Writer. The WAIT and NOWAIT options control when the redo for a commit is flushed to the redo logs.

Note:

The COMMIT_WRITE parameter is deprecated. It is retained for backward compatibility only. It is replaced by the COMMIT_LOGGING and COMMIT_WAIT parameters.


数据运维技术 » Oracle 参数 COMMIT_WRITE 官方解释,作用,如何配置最优化建议