سؤال

I need a SQL query to determine when log shipping last occured for a given database. Would this be correct?

SELECT  Max(restore_date)
FROM    msdb.dbo.restorehistory 
WHERE   destination_database_name = 'XXXXXXXXXX' AND
        restore_type = 'L'
هل كانت مفيدة؟

المحلول

Yes

but

only if you do not restored logs manually last time.

and

better use the procedures at Monitor Instance dedicated to this task

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top