Avoiding Locking Scenarios
Số trang: 3
Loại file: pdf
Dung lượng: 6.28 KB
Lượt xem: 12
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Avoiding Locking Scenarios• Best Practices – Application – 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...
Nội dung trích xuất từ tài liệu:
Avoiding Locking ScenariosAvoiding Locking Scenarios • Best Practices – Application – 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 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.More Useful Registry Variables forLocking • 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
Nội dung trích xuất từ tài liệu:
Avoiding Locking ScenariosAvoiding Locking Scenarios • Best Practices – Application – 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 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.More Useful Registry Variables forLocking • 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
Tìm kiếm theo từ khóa liên quan:
Best Practices databse cơ sở dữ liệu giáo trình oracle tài liệu oracleGợi ý tài liệu liên quan:
-
62 trang 401 3 0
-
Đề thi kết thúc học phần học kì 2 môn Cơ sở dữ liệu năm 2019-2020 có đáp án - Trường ĐH Đồng Tháp
5 trang 378 6 0 -
Giáo trình Cơ sở dữ liệu: Phần 2 - TS. Nguyễn Hoàng Sơn
158 trang 292 0 0 -
13 trang 292 0 0
-
Phân tích thiết kế hệ thống - Biểu đồ trạng thái
20 trang 285 0 0 -
Tài liệu học tập Tin học văn phòng: Phần 2 - Vũ Thu Uyên
85 trang 255 1 0 -
Đề cương chi tiết học phần Quản trị cơ sở dữ liệu (Database Management Systems - DBMS)
14 trang 244 0 0 -
8 trang 186 0 0
-
Giáo trình về dữ liệu và các mô hình cơ sở dữ liệu
62 trang 183 0 0 -
Giáo trình Cơ sở dữ liệu: Phần 2 - Đại học Kinh tế TP. HCM
115 trang 175 0 0