Solved

What is page locking

Posted on 1998-12-14
4
154 Views
Last Modified: 2010-07-27
What is page locking in SQL and how large is a page?
Has a page a fix size e.g. 4KB or 8KB or a number of records?
0
Comment
Question by:flmexpert
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
spiridonov earned 0 total points
ID: 1092277
Page locking is like putting a flag on the page. The flag, depending on lock can mean: 'Don't allow any one to access this page' (in case of update lock) or for example, 'Allow to read, but don't allow to update' (in case of shared select lock). There are several lock types, that can be placed on a page,you can read about them in SQL Books Online. Page size in Sql Server is 2Kb.
0
 
LVL 2

Expert Comment

by:tschill120198
ID: 1092278
SQL 7.0 increases the page size to 8K.
0
 

Author Comment

by:flmexpert
ID: 1092279
SQL 7.0 uses record locking and why should it use also pages ?

Also there is a problem:
If i have a record with a size of 3 KB and
make "update ... where <this record>".
SQL 7 locks only this record and SQL 6.5 ?
Locks it this record with two 2 KB pages ?

0
 
LVL 2

Expert Comment

by:tschill120198
ID: 1092280
This is called "lock escalation", where SQL converts many fine-grain locks into fewer course-grain locks to reduce the overhead of managing the locks...  

Resources that it can lock (from smaller to larger granularity) are: RID -> Key -> Page -> Extent -> Table -> Database.

Look in BOL under "lock escalation".

As for the update query locking 2 pages, since the record is 3K (and therefore resides on 2 pages), it would make sense that both pages for the record be locked.  Or am I missing something?

0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question