x

How to Know DB properties

Hi, How can we know that a database has been restored

a) From which database backup ?
b) On which date ?

Regards RajRam.

more ▼

asked Jan 28, 2010 at 05:08 AM in Default

avatar image

RajRam
41 1 1 3

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

You can you the Backup/Restory table that SQL Server stores in the msdb database.

http://msdn.microsoft.com/en-us/library/ms188653%28SQL.90%29.aspx

more ▼

answered Jan 28, 2010 at 05:30 AM

avatar image

sp_lock
10.8k 27 37 37

(comments are locked)
10|1200 characters needed characters left

I think this is what you need;

USE [msdb] go

SELECT [rs].[destination_database_name] , [rs].[restore_date] , [bs].[backup_start_date] , [bs].[backup_finish_date] , [bs].[database_name] AS [source_database_name] , [bmf].[physical_device_name] AS [backup_file_used_for_restore] FROM msdb..restorehistory rs INNER JOIN msdb..backupset bs ON [rs].[backup_set_id] = [bs].[backup_set_id] INNER JOIN msdb..backupmediafamily bmf ON [bs].[media_set_id] = [bmf].[media_set_id] ORDER BY [rs].[restore_date] DESC

Courtesy of Thomas LaRock at http://www.mssqltips.com/tip.asp?tip=1860&ctc

more ▼

answered Jan 28, 2010 at 05:45 AM

avatar image

Fatherjack ♦♦
43.8k 79 99 118

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1089
x129
x14

asked: Jan 28, 2010 at 05:08 AM

Seen: 1656 times

Last Updated: Jan 28, 2010 at 10:03 PM

Copyright 2017 Redgate Software. Privacy Policy