首页 > 代码库 > Backup--查看备份还原需要的空间
Backup--查看备份还原需要的空间
--======================================================--使用于SQL SERVER 2008 和SQL SERVER 2008 R2DECLARE @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 2005DECLARE @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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。