Situation : While performing log shipping failover I got the error like LSN mismatch .
To fix this issue I need to find the missing log backup details.
For this we need to use system tables from master (sysdatabases) and msdb databases (backupset and backupmediafamily )
To fix this issue I need to find the missing log backup details.
For this we need to use system tables from master (sysdatabases) and msdb databases (backupset and backupmediafamily )
SELECT sd.NAME ,bs.TYPE ,bs.database_name ,bs.backup_start_date AS last_backup FROM master..sysdatabases sd LEFT JOIN msdb..backupset bs ON rtrim(bs.database_name) = rtrim(sd.NAME) LEFT JOIN msdb..backupmediafamily bmf ON bs.media_set_id = bmf.media_set_id WHERE sd.NAME = 'DBA_Info' -- pass the db name here AND bs.backup_start_date > getdate() - 10 ORDER BY sd.NAME ,last_backup
very helpful and informative.
ReplyDeleteThanks for visiting the blog. Kepp in touch.
ReplyDelete