這篇文章主要介紹了sqlserver如何實現(xiàn)查看備份日志腳本,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供瑪曲網(wǎng)站建設、瑪曲做網(wǎng)站、瑪曲網(wǎng)站設計、瑪曲網(wǎng)站制作等企業(yè)網(wǎng)站建設、網(wǎng)頁設計與制作、瑪曲企業(yè)網(wǎng)站模板建站服務,十載瑪曲做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡服務。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如何實現(xiàn)查看備份日志腳本”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設公司行業(yè)資訊頻道,更多相關(guān)知識等著你來學習!