Oracle7 Server Application Developer's Guide

Contents Index Home Previous Next

SERIALIZABLE and ROW_LOCKING Parameters

When an instance is started, two initialization parameters determine how the instance handles locking: SERIALIZABLE and ROW_LOCKING. By default, SERIALIZABLE is set to FALSE and ROW_LOCKING is set to ALWAYS. In almost every case, these parameters should not be altered. They are provided for sites that must run in ANSI/ISO compatible mode, or that want to use applications written to run with earlier versions of Oracle. Only these sites should consider altering these parameters, as there is a significant performance degradation caused by using other than the defaults. For detailed explanations of these parameters, see the Oracle7 Server Reference manual.

The settings for these parameters should be changed only when an instance is shut down. If multiple instances are accessing a single database, all instances should use the same setting for these parameters.

Summary of Non-Default Locking Options

Two initialization parameters are available to change the way locking occurs at the system level. As a result, there are three global settings other than the default. Table 3 - 1 summarizes the non-default settings and why you might choose to run your database system in a non-default way.

Case Description SERIALIZABLE ROW_LOCKING
1 Equivalent to Version 5 and earlier Oracle releases (no concurrent inserts, updates, or deletes in a table). FALSE INTENT
2 ANSI compatible. TRUE ALWAYS
3 ANSI compatible, with table-level locking (no concurrent inserts, updates, or deletes in a table). TRUE INTENT
Table 3 - 1. Summary of Non-Default Locking Options

Table 3 - 2 illustrates the difference in locking behavior resulting from the three possible settings of the initialization parameters, as shown in Table 3 - 1.

STATEMENT CASE 1 CASE 2 CASE 3
row table row table row table
SELECT - - - S - S
INSERT X SRX X RX X SRX
UPDATE X SRX X SRX X SRX
DELETE X SRX X SRX X SRX
SELECT . . .FOR UPDATE X RS X S X S
LOCK TABLE . . . IN . .
ROW SHARE MODE RS RS RS RS RS RS
ROW EXCLUSIVE MODE RX RX RX RX RX RX
SHARE MODE S S S S S S
SHARE ROW EXCLUSIVE MODE SRX SRX SRX SRX SRX SRX
EXCLUSIVE MODE X X X X X X
DDL statements - X - X - X
Table 3 - 2. Non-default Locking Behavior


Contents Index Home Previous Next