¿Como determinar la fecha del ultimo restore de una base de datos?

By | 2012/05/18
Visitas: 1020 - 1 Comentario
-- Buscando en la msdb, la tabla RestoreHistory y sus dependientes
use msdb;
go
select
      DBRestored  = destination_database_name,
      RestoreDate = restore_date,
      SourceDB    = b.database_name,
      SourceFile  = physical_name,
      BackupDate  = backup_start_date
from RestoreHistory h
inner join BackupSet b
      on h.backup_set_id = b.backup_set_id
inner join BackupFile f
      on f.backup_set_id = b.backup_set_id
order by RestoreDate
go

Resultado:

 
DBRestored  RestoreDate             SourceDB    SourceFile
CopyOfpubs  2011-11-02 10:03:46.717 pubs        F:\DATA\db\pubs.mdf
CopyOfpubs  2011-11-02 10:03:46.717 pubs        F:\DATA\db\pubs_log.LDF

Fuente: sqlusa.com

Category: SQL

One thought on “¿Como determinar la fecha del ultimo restore de una base de datos?

Comments are closed.