明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

PlateSpin備份時SQL Server的信息介紹

[摘要]以前寫過一篇文章IO is frozen on database xxx, No user action is required“, 主要是介紹PlateSpin在服務器層面做DR備份時,SQL S...

以前寫過一篇文章IO is frozen on database xxx, No user action is required, 主要是介紹PlateSpin在服務器層面做DR備份時,SQL Server日志里面有"I/O is frozen on database xxxx"以及I/O was resumed on database xxx"信息,詳細信息參考那篇博客,這篇主要是從側面一個佐證、補充!

clip_image001

其實后面發(fā)現(xiàn),當PlateSpin作業(yè)運行時,你會發(fā)現(xiàn)數(shù)據(jù)庫會msdb.dbo.backupset中會會記錄一條數(shù)據(jù)庫完整備份,備份到Virtual Device的記錄。這個也是側面一個佐證!當然更細、更深入方面的原理、知識點,由于網(wǎng)上PlateSpine的資料不多,自己也沒有時間去深入了解。這里只是我在采集備份信息時,發(fā)現(xiàn)的一個細節(jié)而已,當時很是納悶,那個時間點沒有做全備、也沒有備份到虛擬設備(Virtual Device)?后面查找原因,才發(fā)現(xiàn)這個跟PlateSpin有關系。特此記錄一下!

SELECT  CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS servername ,
        bs.database_name ,
        bs.backup_start_date ,
        bs.backup_finish_date ,
        DATEDIFF(MINUTE,bs.backup_start_date, bs.backup_finish_date) AS backup_consume_time,
        bs.expiration_date ,
        CASE bs.type
          WHEN 'D' THEN 'Full Backup'
          WHEN 'I' THEN 'Diff Backup'
          WHEN 'L' THEN 'Log  Bacup'
          WHEN 'F' THEN 'File Backup'
          WHEN 'G' THEN 'File Diff'
          WHEN 'P' THEN 'Partial Backup'
          WHEN 'Q' THEN 'Partial Diff Backup'
        END AS backup_type ,
        CASE bf.device_type 
          WHEN 2 THEN 'Disk'
          WHEN 5 THEN 'Tape'
          WHEN 7 THEN 'Virtual Device'
          WHEN 105 THEN 'permanent backup device'
        END AS backup_media,
        bs.backup_size/1024/1024/1024  AS [backup_size(GB)] ,
        bs.compressed_backup_size/1024/1024/1024 AS [compressed_backup_size(GB)],
        bf.logical_device_name ,
        bf.physical_device_name ,
        bs.name AS backupset_name ,
        bs.first_lsn,
        bs.last_lsn,
        bs.checkpoint_lsn,
        bs.description
FROM    msdb.dbo.backupmediafamily bf
        INNER JOIN msdb.dbo.backupset bs ON  bf.media_set_id = bs.media_set_id
WHERE   ( CONVERT(DATETIME, bs.backup_start_date, 102) >= CAST('2017-10-18 21:00' AS DATETIME))
     AND ( CONVERT(DATETIME, bs.backup_start_date, 102) <= CAST('2017-10-18 23:59' AS DATETIME))
 AND 
 bs.type='D' AND bs.database_name='HistoryData'
ORDER BY bs.database_name ,
         bs.backup_finish_date;

clip_image002

以上就是PlateSpin備份時SQL Server的信息介紹的詳細內容,更多請關注php中文網(wǎng)其它相關文章!


學習教程快速掌握從入門到精通的SQL知識。