April 5, 2005 at 8:15 am
Is there a quick SQL I can run to see when the most recent RESTORE of a DB took place?
Thanks
April 5, 2005 at 8:33 am
you can query restorehistory table in msdb database.
for example:
select max(restore_date)
from msdb.dbo.restorehistory
where destination_database_name='pubs'
April 6, 2005 at 2:58 am
You can check the following sql also which tells about the backups.
SELECT B.NAME, ISNULL(STR(ABS(DATEDIFF(DAY, GETDATE(),
MAX(BACKUP_FINISH_DATE)))), 'NEVER') 'DAYS - THE BACKUP IS DONE' ,
ISNULL(CONVERT(CHAR(10), MAX(BACKUP_FINISH_DATE), 101), 'NEVER') 'DATE- ON WHICH THE BACKUP WAS DONE'
FROM MASTER.DBO.SYSDATABASES B LEFT OUTER JOIN MSDB.DBO.BACKUPSET A
ON A.DATABASE_NAME = B.NAME AND A.TYPE = 'D' GROUP BY B.NAME ORDER BY B.NAME
April 6, 2005 at 1:16 pm
Thanks...
We have an App that requires the user to Restore a DB from us and merge it with what they already have - monthly. I can check our logs to see when the App was run - but needed to know if the Restore happened before or after running our App.
Thanks...
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply