June 18, 2010 at 8:39 am
I am getting confused about log sequence number (LSN).
Is LSN a ever increasing number?I have created a database with table and records and suppose the initial LSN for a table be 100 in the page header and after 10 years doing lot of modification to that page will be the LSN be around 10K considering the other data pages would have taken the LSN in increasing order over years.
Redo:
When a table is created and data is inserted a LSN value is stored in page header Suppose 100. I do data modification successfully with commit to a row which is present in that page.The LSN value changes to 105 since it is a increasing value.The prev LSN value is updated to 100. I read in SQL Internals that during redo phase if the LSN record that refers to that page is less than LSN in page header then it indicates that the log records must be redone.
If the page LSN is greater than Log LSN then this page was written to disk after the indicated transaction occurred, and the transaction does not need to be redone.
How can the page LSN be greater than log LSN ?since the log LSN for that page should be equal
the
June 20, 2010 at 1:54 am
>> How can the page LSN be greater than log LSN ?since the log LSN for that page should be equal
One possibility may be when you restore individual pages from a database backup. Those pages need to be made consistent with the rest of the database pages by restoring subsequent transaction log backups. However, only the restored pages need to be updated, while the existing pages can remain as is.
SQL BAK Explorer - read SQL Server backup file details without SQL Server.
Supports backup files created with SQL Server 2005 up to SQL Server 2017.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply