[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 505
  • Last Modified:

Find the date the database was last restored

I have MS SQL Server 2005.  Is it possible to find out the date that the database was last restored?
0
saturation
Asked:
saturation
  • 3
  • 2
1 Solution
 
chapmandewCommented:
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
 
chapmandewCommented:
sorry...misread.  Look at the create_date in this query:

select * from sys.databases
0
 
saturationAuthor Commented:
That shows the created date, but is there a date for the last time a DB was restored into that database?
0
 
chapmandewCommented:
select * from msdb..restorehistory
0
 
saturationAuthor Commented:
Perfect!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now