Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find date of last database restore?

Status
Not open for further replies.

sqlturbo

IS-IT--Management
Mar 11, 2002
67
US

For a few SQL Server databases that I maintain, I do a full backup daily on tape using VERITAS Backup Exec. By mistake the backup tape from July 2004 was applied to do the restore. Since the tape had the backup of all the databases on the production box, the restore got applied to all the databases on which Backup Exec could get exclusive access. As soon as I noticed this, I stopped the restore mid way. How do I find out which databases got affected? Is there any way I could find out the date of last restore on a database?

The log of the backup job was deleted by mistake again!
Ideas needed badly!

Thanks!
 
There is a restorehistory table in msdb that has restore info in it see if yours has one if it doesnt have an entry for that database, it has never been restored. least i think. try it out
 
Check the create date of the databases. When a database is restored the create date is reset to the date and time of the restore.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Coorran007, You are right. It does have a restore history table. Thanks!

mrdenny, The create date of the database remains what it was when it was first created. A restore does not change the create date of the table. (Create date as seen by a right click on the database in EM). What does change is the date modified date on the date file itself when a restore is applied, which is obvious. From that one could glean when was the restore applied if the database did not have any transactions done on it after it was restored.
 
A typo error!

In my last reply I meant the date on the data file itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top