USE MSDB
GO;
SELECT TOP 1 * FROM BACKUPSET -- TABLE TO STORE BACKUP ENTRIES
WHERE
TYPE = 'D' AND DATABASE_NAME = 'DB_BNKNG'
ORDER BY backup_finish_date DESC
SELECT * FROM BACKUPMEDIAFAMILY -- TABLE TO STORE BACKUP LOCATIONS
HOW TO AUDIT FOR LATEST FULL BACKUP?
SELECT TOP 1 TYPE, DATABASE_NAME, backup_finish_date,physical_device_name
FROM BACKUPSET
JOIN BACKUPMEDIAFAMILY
ON
BACKUPSET.media_set_id = BACKUPMEDIAFAMILY.media_set_id
WHERE
TYPE = 'D' AND DATABASE_NAME = 'DB_BNKNG'
ORDER BY backup_finish_date DESC
GO;
SELECT TOP 1 * FROM BACKUPSET -- TABLE TO STORE BACKUP ENTRIES
WHERE
TYPE = 'D' AND DATABASE_NAME = 'DB_BNKNG'
ORDER BY backup_finish_date DESC
SELECT * FROM BACKUPMEDIAFAMILY -- TABLE TO STORE BACKUP LOCATIONS
HOW TO AUDIT FOR LATEST FULL BACKUP?
SELECT TOP 1 TYPE, DATABASE_NAME, backup_finish_date,physical_device_name
FROM BACKUPSET
JOIN BACKUPMEDIAFAMILY
ON
BACKUPSET.media_set_id = BACKUPMEDIAFAMILY.media_set_id
WHERE
TYPE = 'D' AND DATABASE_NAME = 'DB_BNKNG'
ORDER BY backup_finish_date DESC
HOW TO AUDIT FOR LATEST DIFFERENTIAL BACKUP?
SELECT TOP 1 TYPE, DATABASE_NAME, backup_finish_date,physical_device_name
FROM BACKUPSET
JOIN BACKUPMEDIAFAMILY
ON
BACKUPSET.media_set_id = BACKUPMEDIAFAMILY.media_set_id
WHERE
TYPE = 'I' AND DATABASE_NAME = 'DB_BNKNG'
ORDER BY backup_finish_date DESC
HOW TO AUDIT FOR LOG BACKUPS?
SELECT TYPE, DATABASE_NAME, backup_finish_date,physical_device_name
FROM BACKUPSET
JOIN BACKUPMEDIAFAMILY
ON
BACKUPSET.media_set_id = BACKUPMEDIAFAMILY.media_set_id
WHERE
TYPE = 'L' AND DATABASE_NAME = 'DB_BNKNG'
ORDER BY backup_finish_date DESC -- E:\DB_BNKNG_log.trn
0 comments: