Select DB_NAME(database_id)
 file_id, 'Error case' = CASE event_type 
 WHEN 1 THEN '823 or 824 or Torn Page'
 WHEN 2 THEN 'Bad Checksum'
 WHEN 3 THEN 'Torn Page'
 WHEN 4 THEN 'Restored'
 WHEN 5 THEN 'Repaired (DBCC)'
 WHEN 7 THEN 'Deallocated (DBCC)'
 END,
 page_id,
 error_count,
 last_update_date,
 PageType = Case
 When page_id - 1 % 8088 = 0 Then 'Is PFS Page'
 When page_id - 2 % 511232 = 0 Then 'Is GAM Page'
 When page_id - 3 % 511232 = 0 Then 'Is SGAM Page'
 When page_id BETWEEN 0 and 9 Then 'Is boot Page'
 Else 'Is Not PFS, GAM, or SGAM page' 
 End
 From msdb..suspect_pages

One Response to Simple script for suspect_pages analysis

Leave a Reply

Your email address will not be published. Required fields are marked *

November 2024
M T W T F S S
« Jul    
 123
45678910
11121314151617
18192021222324
252627282930