TAILIEUCHUNG - Understanding SQL Server Locks

Understanding SQL Server Locks SQL Server uses locks to implement transaction isolation and to ensure the information stored in a database is consistent. | Understanding SQL Server Locks SQL Server uses locks to implement transaction isolation and to ensure the information stored in a database is consistent. Locks prevent one user from reading or changing a row that is being changed by another user. For example when you update a row a row lock is placed on that row to prevent another user from updating the row at the same time. Types of SQL Server Locks SQL Server uses many types of locks some of which are shown in Table . This table shows the locks in ascending order of locking granularity which refers to the size of the resource being locked. For example a row lock has a finer granularity than a page lock. Table SQL Server Lock Types LOCK TYPE DESCRIPTION Row RID Placed on a row in a table. Stands for row identifier. Used to uniquely identify a row. Key KEY Placed on a row within an index. Used to protect key ranges in serializable transactions. Page PAG Placed on a page which contains 8KB of row or index data. Extent EXT Placed on an extent which is a contiguous group of 8 data or index pages. Table TAB Placed on a table and locks all the rows and indexes in that table. Database DB Used to lock the whole database when the database administrator puts it into single user mode for maintenance. SQL Server Locking Modes SQL Server uses different locking modes that determine the level of locking placed on the resource. These locking modes are shown in Table . You ll see these locking modes in the next section. Table SQL Server Locking Modes LOCKING MODE DESCRIPTION Shared S Indicates that a transaction is going to read from the resource using a Table SQL Server Locking Modes LOCKING MODE DESCRIPTION SELECT statement. Prevents other transactions from modifying the locked resource. A shared lock is released as soon as the data has been read-unless the transaction isolation level is set to REPEATABLE READ or SERIALIZABLE. Update U Indicates that a transaction intends to modify a resource using an .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.