这篇文章主要介绍了sqlserver如何实现查看备份日志脚本,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
sqlserver 查看备份日志脚本
----------------------------------------------
SELECT CONVERT(CHAR(100), Serverproperty('Servername')) AS ServerName
,bs.database_name AS Database_Name
,bs.recovery_model AS Recovery_Model
,bs.is_damaged AS Is_Damaged
,bs.backup_start_date AS Backup_Start_Date
,bs.backup_finish_date AS Backup_Finish_Date
,bs.expiration_date AS Expiration_Date
,CASE bs.type
WHEN 'D' THEN 'Database'
WHEN 'L' THEN 'Log'
END AS Backup_Type
,bs.backup_size/1024/1024 AS [Backup_Size(MB)]
,bs.compressed_backup_size/1024/1024 AS [Compressed_Backup_Size]
,bs.compressed_backup_size/bs.backup_size AS Compressed_Rate
,bf.logical_device_name
,bf.physical_device_name
,bs.name AS Backupset_Name
,bs.description
FROM msdb.dbo.backupmediafamily bf
INNER JOIN msdb.dbo.backupset bs
ON bf.media_set_id = bs.media_set_id
ORDER BY bs.database_name,
bs.backup_finish_date
感谢你能够认真阅读完这篇文章,希望小编分享的“sqlserver如何实现查看备份日志脚本”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。