1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Avoiding Locking Scenarios docx

3 267 0
Tài liệu được quét OCR, nội dung có thể không chính xác
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Avoiding locking scenarios best practices
Chuyên ngành Database
Định dạng
Số trang 3
Dung lượng 6,28 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Avoiding Locking Scenarios = a Si wey ^ go, ss 8 & ok ORS S OR BOQ, 2 ¢ Best Practices — Agyiicavan AWG WGA LIN S = — Use least restrictive isolation level that maintains the data in

Trang 1

Avoiding Locking Scenarios

=

a Si wey ^ go, ss 8 & ok ORS S OR BOQ, 2

¢ Best Practices — Agyiicavan AWG WGA LIN S

=

— Use least restrictive isolation level that maintains the data integrity requirements of the application

— Reduce Isolation level of specific statements by using statement level isolation (i.e., WITH clause)

— CLOSE cursors WITH RELEASE to free locks prior to end of

transaction

— Perform updates as close to the end of the transaction as possible, to reduce exclusive lock duration

— COMMIT frequently to release locks

— Avoid multiple applications accessing the same tables, but acquiring locks in different orders (Access patterns should be similar)

— Avoid having multiple processes that access the same table for both reads and writes within the same transaction

Trang 2

Avoiding Locking Scenarios

Best Practices — Database

— Avoid lock escalations by increasing DB CFG parameters

LOCKLIST and/or MAXLOCKS

— Avoid lock timeouts:

« Adjust the DB CFG parameter LOCKTIMEOUT or use the SET

CURRENT LOCK TIMEOUT command

— Avoid deadlocks:

¢ Reduce row blocking during index and table scans:

— DB2_SKIPINSERTED to skip/ignore uncommitted inserted rows

— DB2_ SKIPDELETED to skip/ignore uncommitted deleted rows

— DB2 EVALUNCOMMITTED to defer locking until row is known to

satisfy query Uncommitted data will be evaluated Skips deleted rows

on table scans.

Trang 3

More Useful |

Locking

iegistry Variables for

¢ DB2 KEEPTABLELOCK

— allows DB2 to maintain the table lock when an

uncommitted read or cursor stability isolation level

is closed The table lock is released at the end of the transaction

- DB2 MAX NON TABLE LOCKS

— defines the maximum number of NON table locks

a transaction can have before it releases these locks Because transactions often access the

same table more than once, retaining locks and changing their state to NON can improve

performance

¢ DB2LOCK_TO_RB

— specifies whether lock timeouts cause the entire transaction to be rolled back, or only the current statement

Ngày đăng: 15/12/2013, 10:15

TỪ KHÓA LIÊN QUAN

w