zoukankan      html  css  js  c++  java
  • Backup--查看备份还原需要的空间

    --======================================================
    --使用于SQL SERVER 2008 和SQL SERVER 2008 R2
    DECLARE @DatabBaseBakPath NVARCHAR(500)
    SET @DatabBaseBakPath='备份路径'
    
    DECLARE @BakFileList2008 TABLE 
        (    LogicalName nvarchar(128)
            ,PhysicalName nvarchar(260)
            ,Type char(1)
            ,FileGroupName nvarchar(128)
            ,SIZE numeric(20,0)
            ,MaxSize numeric(20,0)
            ,FileID bigint
            ,CreateLSN numeric(25,0)
            ,DropLSN numeric(25,0) NULL
            ,UniqueID uniqueidentifier
            ,ReadOnlyLSN numeric(25,0) NULL
            ,ReadWriteLSN numeric(25,0) NULL
            ,BackupSizeInBytes bigint
            ,SourceBlockSize int
            ,FileGroupID int
            ,LogGroupGUID uniqueidentifier NULL
            ,DifferentialBaseLSN numeric(25,0) NULL
            ,DifferentialBaseGUID uniqueidentifier
            ,IsReadOnly bit
            ,IsPresent bit
            ,TDEThumbprint varbinary(32)
          )    
        
    INSERT INTO @BakFileList2008        
    EXEC sp_executesql N'Restore FileListOnly From Disk=@DatabBaseBakPath'
    ,N'@DatabBaseBakPath nvarchar(260)'
    ,@DatabBaseBakPath 
    
    SELECT * 
    FROM @BakFileList2008
    --======================================================
    --使用于SQL SERVER 2005
    DECLARE @DatabBaseBakPath NVARCHAR(500)
    SET @DatabBaseBakPath='备份路径'
    
    DECLARE @BakFileList2005 TABLE 
        (
             LogicalName nvarchar(128)
            ,PhysicalName nvarchar(260)
            ,Type char(1)
            ,FileGroupName nvarchar(128)
            ,SIZE numeric(20,0)
            ,MaxSize numeric(20,0)
            ,FileID bigint
            ,CreateLSN numeric(25,0)
            ,DropLSN numeric(25,0) NULL
            ,UniqueID uniqueidentifier
            ,ReadOnlyLSN numeric(25,0) NULL
            ,ReadWriteLSN numeric(25,0) NULL
            ,BackupSizeInBytes bigint
            ,SourceBlockSize int
            ,FileGroupID int
            ,LogGroupGUID uniqueidentifier NULL
            ,DifferentialBaseLSN numeric(25,0) NULL
            ,DifferentialBaseGUID uniqueidentifier
            ,IsReadOnly bit
            ,IsPresent bit
        )    
    
    INSERT INTO @BakFileList2005      
    EXEC sp_executesql N'Restore FileListOnly From Disk=@DatabBaseBakPath'
    ,N'@DatabBaseBakPath nvarchar(260)'
    ,@DatabBaseBakPath 
      
    
    SELECT * 
    FROM @BakFileList2005
  • 相关阅读:
    20120109_1
    .NET(C#)开源代码分析
    Vue filter API All In One
    js 千位分隔符 All In One
    css fontfeaturesettings All In One
    vue 子组件不使用 watch 如何更新组件 All In One
    miro whiteboard All In One
    转载:sql注入的危害(登陆并获取数据库的名字,表的名称和字段)
    Windows 7/windows server 2008 R2 64位版IIS不能连接Access数据库,80004005报错的解决办法
    LINQ如何做SELECT TOP操作
  • 原文地址:https://www.cnblogs.com/TeyGao/p/3905155.html
Copyright © 2011-2022 走看看