Solved

What is page locking

Posted on 1998-12-14
4
144 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now