SQL Server 查看备份集元数据的 4 种方法。

方法 1、 restore labelonly

方法 2、 restore headeronly

方法 3、 restore filelistonly

方法 4、 restore verifyonly

--------------------------------------------------------------------------------------------------------------------------------------------------------

                                                             

                                                              backup database Studio
                                                              to disk = 'E:Studio.bak'
                                                              with
                                                              medianame ='this is medianame',
                                                              mediadescription = 'this is mediadescryption',
                                                              name = 'this is name',
                                                              description ='this is description'
                                                              go

方法 1、restroe lableonly 返回一个结果集,它包含给定备份设备识别的备份介质的相关信息。

          restore labelonly

          from disk = 'E:Studio.bak';

          go

          

方法 2、restore headeronly 返回包含 SQL Server 中特定备份设备上所有备份集的所有备份标头信息的结果集。

         restore headeronly
         from disk ='E:Studio.bak';
         go

         

方法 3、restore filelistonly 返回由 SQL Server 中的备份集内包含的数据库和日志文件列表组成的结果集。

           restore filelistonly
           from disk ='E:Studio.bak';
           go

           

方法 4、restore verifyonly 验证备份但不还原备份,检查备份集是否完整以及整个备份是否可读。 但是,RESTORE VERIFYONLY 不尝试验证备份卷中的数据结构。       

           restore verifyonly
           from disk = 'E:Studio.bak';
           go

           

原文地址:https://www.cnblogs.com/JiangLe/p/3999007.html