查詢 SQL Server 備份還原紀錄
備份紀錄
SELECT TOP 20 b.physical_device_name, a.backup_start_date, a.first_lsn, a.user_name, a.type FROM msdb..backupset a
INNER JOIN msdb..backupmediafamily b ON a.media_set_id = b.media_set_id
--WHERE a.type = 'L'
ORDER BY a.backup_finish_date DESC
SELECT b.name, a.type, MAX(a.backup_finish_date) lastbackup
FROM msdb..backupset a
INNER JOIN master..sysdatabases b ON a.database_name COLLATE DATABASE_DEFAULT = b.name COLLATE DATABASE_DEFAULT
GROUP BY b.name, a.type
ORDER BY b.name, a.type
還原紀錄
select * from msdb..restorehistory
order by restore_date desc
留言
張貼留言