Sharepoint 数据库 AllDocStreams.Content 未存储完整的 blob

问题描述 投票:0回答:1

我需要从 SharePoint 数据库中提取文档,包括以前版本 (*.0)。

我从 csv 转储中获得的文件甚至不是我从 SharePoint gui 中获得的文件大小的一半,并且我比较了这两个文件中的 blob,它们与 gui 文件中的 blob 继续的点相同并且数据库中的 blob 停止。我还以 .zip 形式打开 .docx 文件,发现缺少文件夹和文件。

我在网上看到的所有内容都说要从 AllDocStreams.Content 获取 blob,就是这样。但 SharePoint 必须从其他地方获取其余的 blob,而且我已经检查过,它不在 AllFileFragments 中。

sql-server sharepoint sharepoint-2010
1个回答
0
投票

我有一个脚本可能对你有帮助,但它是2013版本的,我不记得所有的选项,但尝试自己弄清楚,这是给你的例子。

Declare  @ID uniqueidentifier
--select top 1 @ID = id from alldocs where LeafName like N'text.xls%' --and DirName like N'sites/test/test1/'
SET @ID= '5FD687B8-FDC1-461B-9345-7229FA60D13A'
--select @ID
--set @ID='1202436F-BD82-4694-997C-62791374C288'
--select max(BSN) from DocStreams where DocId='1202436F-BD82-4694-997C-62791374C288'
--select NextBSN from  alldocs where id = '1202436F-BD82-4694-997C-62791374C288'
--update alldocs set NextBSN= 17865 where id = '1202436F-BD82-4694-997C-62791374C288'
      
select id as DocId, IsCurrentVersion, Level,NextBSN, TimeLastModified, TimeLastWritten, DirName, LeafName,* from AllDocs where Id= @ID
select * from DocsToStreams where DocId= @ID and HistVersion=0 and level=1
--select * from DocsToStreams_ORIGINAL where DocId= @ID and HistVersion=0 and level=2
select * from DocStreams where DocId = @ID
select sum(Size),count(*) from DocsToStreams dts join DocStreams ds on dts.DocId = ds.DocId and dts.BSN=ds.BSN where ds.DocId = @ID and HistVersion=0 and level=2 --order by dts.streamid
select max(BSN) from DocStreams where DocId=@ID
--select * from DocStreams where DocId = @ID


select * from DocsToStreams where DocId= 'A919A064-A5B9-4D83-95FE-5497F4D711F3'

select count(*) from [dbo].[DocsToStreams]
--INSERT INTO [dbo].[DocsToStreams]
           ([SiteId]
           ,[DocId]
           ,[HistVersion]
           ,[Level]
           ,[Partition]
           ,[BSN]
           ,[StreamId])
select SiteId, DocId,0,2,0,BSN,CASE WHEN BSN = 17857 THEN 1 ELSE BSN - 40 END from DocStreams where DocId = '1202436F-BD82-4694-997C-62791374C288' and BSN >= 17857
© www.soinside.com 2019 - 2024. All rights reserved.