Solved

Find the date the database was last restored

Posted on 2008-10-03
5
494 Views
Last Modified: 2010-04-21
I have MS SQL Server 2005.  Is it possible to find out the date that the database was last restored?
0
Comment
Question by:saturation
  • 3
  • 2
5 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 22634747
select distinct physical_device_name,  * from backupfile bf
join backupset bs on bf.backup_set_id = bs.backup_set_id
join backupmediafamily bm on bs.media_set_id = bm.media_set_id
where database_name = 'yourdbname'
order by backup_finish_date desc
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22634758
sorry...misread.  Look at the create_date in this query:

select * from sys.databases
0
 

Author Comment

by:saturation
ID: 22634829
That shows the created date, but is there a date for the last time a DB was restored into that database?
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 22634909
select * from msdb..restorehistory
0
 

Author Closing Comment

by:saturation
ID: 31502785
Perfect!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now