Solved

What is page locking

Posted on 1998-12-14
4
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
T-SQL to copy a database 37 66
SQL 2014 missing dll from Bin? 3 31
SQL Syntax 6 28
Related to SQL Query 5 19
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.

763 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