DEFINITIONS

Definitions More Info.
Definition ID4.037
TitleSQL
CategoryNOTES
Definitionbackup sorgusu tum cesitler icin
Definition DescriptionSELECT TOP 100
CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,
bs.database_name,
bs.backup_start_date,
bs.backup_finish_date,
DATEDIFF(hh, bs.backup_start_date, bs.backup_finish_date) As BackupDurationHour,
DATEDIFF(mi, bs.backup_start_date, bs.backup_finish_date) As BackupDurationMinute,
bs.expiration_date,
CASE bs.type
WHEN 'D' THEN 'Full Database'
WHEN 'L' THEN 'Log'
WHEN 'I' THEN 'Differential'
WHEN 'F' THEN 'File Level'
WHEN 'G' THEN 'File Level Differential'
WHEN 'P' THEN 'Partial'
WHEN 'Q' THEN 'Differential partial'
END AS backup_type,
convert(varchar,cast(bs.backup_size/1024/1024 as money),10) as 'Backup Size in MB',
-- MB fark bir önceki backup ile
convert(varchar,cast(bs.compressed_backup_size /1024/1024 as money),10) as 'comp Size in MB',
-- MB fark bir önceki comp ile
bmf.logical_device_name,
bmf.physical_device_name,
bs.name AS backupset_name,
bs.description
--INTO dpAudit.dbo.DBAServerBackupHistory_MB
FROM msdb.dbo.backupmediafamily bmf
INNER JOIN msdb.dbo.backupset bs ON bmf.media_set_id = bs.media_set_id
WHERE (CONVERT(datetime, bs.backup_start_date, 102) >= GETDATE() - 10)
AND bs.type IN ('D','I')
ORDER BY
bs.database_name,
bs.backup_finish_date DESC
RecordBycunay
Record Date20-11-2020 14:15:03
Düzenle
Kopyala
Sil