Interview Questions

1. How Ghost cleanup task works?

• Ghostcleanuptask thread wakes up every 10 seconds.

• Sweepdatabases one by one starting from master.

• Skip the database if it is not able to take ashared lock for database (LCK_M_S) or database is not in Open read/write state.

• Scans the PFS pages of the current database to get the pages which has ghost records.

1. PFS Page:A PFS page occurs once in 8088 pages. SSQL Server will attempt to place a PFS page on the first page of every PFS interval(8088Pages). The only time a PFS page is not the first page in its interval is in the first interval for a file.

2. In this case, the file header page is first, and the PFS page is second. (Page ID starts from 0 so the first PFS page is at Page ID 1) 

• Remove the records which are marked as deleted (ghosted) physically

By Hena Parveen 2 0
Is this helpful? Yes No

Submit an interview question

Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of w3Sniff.

Get Started

Comments

Leave a Comment


Check out more interview questions

Based on your skills

MS SQL Server

1662689 1720 23 859

Angular

42495 92 0 46

Wordpress

34317 72 1 36