首页  >  文章  >  数据库  >  PlateSpin备份时SQL Server的信息介绍

PlateSpin备份时SQL Server的信息介绍

一个新手
一个新手原创
2017-10-20 11:24:191755浏览

 

以前写过一篇文章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

 

 

其实后面发现,当PlateSpin作业运行时,你会发现数据库会msdb.dbo.backupset中会会记录一条数据库完整备份,备份到Virtual Device的记录。这个也是侧面一个佐证!当然更细、更深入方面的原理、知识点,由于网上PlateSpine的资料不多,自己也没有时间去深入了解。这里只是我在采集备份信息时,发现的一个细节而已,当时很是纳闷,那个时间点没有做全备、也没有备份到虚拟设备(Virtual Device)啊?后面查找原因,才发现这个跟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(&#39;2017-10-18 23:59&#39; AS DATETIME))
 AND 
 bs.type=&#39;D&#39; AND bs.database_name=&#39;HistoryData&#39;
ORDER BY bs.database_name ,
         bs.backup_finish_date;

 

clip_image002

以上是PlateSpin备份时SQL Server的信息介绍的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn