I have a list with roughly 5500 items, and I would like to find out the size on disk. Is there some way I can do this? I don't mind running a query in the database, if necessary.
我有一个大约5500项的列表,我想找出磁盘上的大小。有什么方法可以做到这一点吗?如果有必要,我不介意在数据库中运行查询。
7 个解决方案
#1
If you enable a site quota, an option under site settings appears called Storage Space Allocation. When you go to set a quota in the Central Administration, the page will tell you what the current storage used is so you can have an idea before there. Once you get to the Storage Space Allocation report, you can see the total size of a library.
如果启用站点配额,则会在站点设置下显示一个名为“存储空间分配”的选项。当您在管理中心设置配额时,该页面将告诉您当前使用的存储是什么,以便您可以在那之前了解。进入存储空间分配报告后,您可以看到库的总大小。
Unfortunately, you can't get this report without turning on a site quota.
遗憾的是,如果不打开网站配额,您将无法获得此报告。
#2
Navigate to http://[myapplication]/[mySitecollection]/_layouts/storman.aspx
导航到http:// [myapplication] / [mySitecollection] /_layouts/storman.aspx
This will list the Storage Space Allocation for the site collection.
这将列出网站集的存储空间分配。
#3
Sorry to necro. But I found this thread while searching for an answer to this questionmyself. I could not get Tim Dobrinski's suggestion to work.This T-SQL query does not deal with everything but gives a very good idea. Pop it into Excel, then add a column for "Size in MB" and add in a formula.
对不起来了。但是我在寻找这个问题的答案时找到了这个帖子。我无法得到蒂姆多布林斯基的建议。这个T-SQL查询不是处理所有事情,而是提出了一个非常好的主意。将其弹出到Excel中,然后添加“大小以MB为单位”的列并添加公式。
USE [WSS_Content]
GO
SELECT
[dbo].[Webs].[FullUrl]
,[dbo].[Lists].[tp_Title] AS "ListName"
,[dbo].[Docs].[DirName]
,[dbo].[Docs].[LeafName]
,[dbo].[Docs].[Size]
,[dbo].[Docs].[MetaInfoSize]
,[dbo].[Docs].[Version]
,[dbo].[Docs].[TimeCreated]
,[dbo].[Docs].[TimeLastModified]
,[dbo].[Docs].[MetaInfoTimeLastModified]
,[dbo].[Docs].[CheckoutUserId]
,[dbo].[Docs].[CheckoutDate]
,[dbo].[Docs].[ExtensionForFile]
FROM [WSS_Content].[dbo].[Docs]
INNER JOIN [WSS_Content].[dbo].[Webs] ON [dbo].[Webs].[Id] = [dbo].[Docs].[WebId]
INNER JOIN [WSS_Content].[dbo].[Lists] ON [dbo].[Lists].[tp_ID] = [dbo].[Docs].[ListId]
WHERE [dbo].[Docs].[Size] > 0
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.stp')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.aspx')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.xfp')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.dwp')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%template%')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.inf')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.css')
#4
If you save the list in question as a template to the file system, this should give you a rough idea of its size. If you need to do this on a periodic basis this approach is not as useful.
如果将有问题的列表作为模板保存到文件系统,这应该可以让您大致了解其大小。如果您需要定期执行此操作,则此方法不太有用。
#5
We actually built an inhouse application to do this, but there may be some commercial products out there.
我们实际上已经构建了一个内部应用程序,但可能会有一些商业产品。
Anyway what we do is go through each item in the list and count up the number of bytes for each field. If there is a document we add in the size of this document. If there are versions then we multiple the byte count for each version. Then we multiple this times 1.5. Not exact, but it provides us with a number that is good enough.
无论如何,我们要做的是遍历列表中的每个项目并计算每个字段的字节数。如果有文档,我们会添加此文档的大小。如果有版本,那么我们将每个版本的字节数加倍。然后我们多次这个时间1.5。不确切,但它为我们提供了一个足够好的数字。
#6
Site Settings -> Storage Metrics
站点设置 - >存储指标
You can see how much each object is consuming, click on Lists to see each individual list
您可以查看每个对象消耗的数量,单击列表以查看每个单独的列表
You don't have to set a site quota
您不必设置站点配额
Sharepoint 2013
#7
This is taken from SharePoint 2013:
这取自SharePoint 2013:
USE [WSS_Content_Intranet]
GO
SELECT
(ISNULL(DocSizes,0) + ISNULL(UserDataSize,0)) As TotalSize,
nLists.tp_ID,
nLists.tp_Title,
nLists.tp_ItemCount,
Webs.FullUrl
FROM
Webs
INNER JOIN
(
SELECT
ALAux.ItemCount as tp_ItemCount,
Lists.tp_Title,
Lists.tp_ID,
Lists.tp_WebID,
ALAux.Modified as tp_Modified,
Lists.tp_ServerTemplate,
Docs.DirName,
Docs.LeafName,
Lists.tp_ImageUrl
FROM
Lists
CROSS APPLY
TVF_AllListsAux_NoLock_ListId(Lists.tp_SiteId, Lists.tp_ID) AS ALAux
INNER JOIN
Docs
ON
Lists.tp_RootFolder = Docs.Id AND
Lists.tp_WebId = Docs.WebId
WHERE
tp_BaseType <> 1 AND
Lists.tp_SiteId = YOUR_SITE_ID
) As nLists
ON
Webs.Id = nLists.tp_WebId
LEFT OUTER JOIN
(
SELECT
(SUM(CAST((ISNULL(Docs.Size,0)) AS BIGINT))) As DocSizes,
Docs.ListId,
Docs.SiteId
FROM
Docs
WHERE
Docs.Type = 0 AND SiteId = YOUR_SITE_ID
GROUP BY
Docs.ListId,Docs.SiteId
) As DocsInList
ON
DocsInList.ListId = nLists.tp_ID
LEFT OUTER JOIN
(
SELECT
(SUM(CAST((ISNULL(tp_Size,0)) AS BIGINT))) As UserDataSize,
tp_ListId
FROM
UserData
GROUP BY
UserData.tp_ListId
) AS UserDataInList
ON
UserDataInList.tp_ListId = DocsInList.ListId
ORDER BY TotalSize DESC
It returns all lists of all webs, summing the size of the items and the attached documents. Document libraries are not included, use this:
它返回所有网站的所有列表,总结项目的大小和附加的文档。文件库不包括在内,请使用:
SELECT
Lists.tp_Title,
Lists.tp_ID as Id,
SUM(Docs.Size/1024 + Docs.MetaInfoSize/1024)/1024 AS SizeMB,
COUNT(*) as NumberOfFiles
FROM dbo.Docs
INNER JOIN Webs ON Webs.Id = Docs.WebId
INNER JOIN Lists ON Lists.tp_ID = Docs.ListId
WHERE Docs.Size > 0
GROUP BY Lists.tp_Title,Lists.tp_ID
#1
If you enable a site quota, an option under site settings appears called Storage Space Allocation. When you go to set a quota in the Central Administration, the page will tell you what the current storage used is so you can have an idea before there. Once you get to the Storage Space Allocation report, you can see the total size of a library.
如果启用站点配额,则会在站点设置下显示一个名为“存储空间分配”的选项。当您在管理中心设置配额时,该页面将告诉您当前使用的存储是什么,以便您可以在那之前了解。进入存储空间分配报告后,您可以看到库的总大小。
Unfortunately, you can't get this report without turning on a site quota.
遗憾的是,如果不打开网站配额,您将无法获得此报告。
#2
Navigate to http://[myapplication]/[mySitecollection]/_layouts/storman.aspx
导航到http:// [myapplication] / [mySitecollection] /_layouts/storman.aspx
This will list the Storage Space Allocation for the site collection.
这将列出网站集的存储空间分配。
#3
Sorry to necro. But I found this thread while searching for an answer to this questionmyself. I could not get Tim Dobrinski's suggestion to work.This T-SQL query does not deal with everything but gives a very good idea. Pop it into Excel, then add a column for "Size in MB" and add in a formula.
对不起来了。但是我在寻找这个问题的答案时找到了这个帖子。我无法得到蒂姆多布林斯基的建议。这个T-SQL查询不是处理所有事情,而是提出了一个非常好的主意。将其弹出到Excel中,然后添加“大小以MB为单位”的列并添加公式。
USE [WSS_Content]
GO
SELECT
[dbo].[Webs].[FullUrl]
,[dbo].[Lists].[tp_Title] AS "ListName"
,[dbo].[Docs].[DirName]
,[dbo].[Docs].[LeafName]
,[dbo].[Docs].[Size]
,[dbo].[Docs].[MetaInfoSize]
,[dbo].[Docs].[Version]
,[dbo].[Docs].[TimeCreated]
,[dbo].[Docs].[TimeLastModified]
,[dbo].[Docs].[MetaInfoTimeLastModified]
,[dbo].[Docs].[CheckoutUserId]
,[dbo].[Docs].[CheckoutDate]
,[dbo].[Docs].[ExtensionForFile]
FROM [WSS_Content].[dbo].[Docs]
INNER JOIN [WSS_Content].[dbo].[Webs] ON [dbo].[Webs].[Id] = [dbo].[Docs].[WebId]
INNER JOIN [WSS_Content].[dbo].[Lists] ON [dbo].[Lists].[tp_ID] = [dbo].[Docs].[ListId]
WHERE [dbo].[Docs].[Size] > 0
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.stp')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.aspx')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.xfp')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.dwp')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%template%')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.inf')
AND ([dbo].[Docs].[LeafName] NOT LIKE '%.css')
#4
If you save the list in question as a template to the file system, this should give you a rough idea of its size. If you need to do this on a periodic basis this approach is not as useful.
如果将有问题的列表作为模板保存到文件系统,这应该可以让您大致了解其大小。如果您需要定期执行此操作,则此方法不太有用。
#5
We actually built an inhouse application to do this, but there may be some commercial products out there.
我们实际上已经构建了一个内部应用程序,但可能会有一些商业产品。
Anyway what we do is go through each item in the list and count up the number of bytes for each field. If there is a document we add in the size of this document. If there are versions then we multiple the byte count for each version. Then we multiple this times 1.5. Not exact, but it provides us with a number that is good enough.
无论如何,我们要做的是遍历列表中的每个项目并计算每个字段的字节数。如果有文档,我们会添加此文档的大小。如果有版本,那么我们将每个版本的字节数加倍。然后我们多次这个时间1.5。不确切,但它为我们提供了一个足够好的数字。
#6
Site Settings -> Storage Metrics
站点设置 - >存储指标
You can see how much each object is consuming, click on Lists to see each individual list
您可以查看每个对象消耗的数量,单击列表以查看每个单独的列表
You don't have to set a site quota
您不必设置站点配额
Sharepoint 2013
#7
This is taken from SharePoint 2013:
这取自SharePoint 2013:
USE [WSS_Content_Intranet]
GO
SELECT
(ISNULL(DocSizes,0) + ISNULL(UserDataSize,0)) As TotalSize,
nLists.tp_ID,
nLists.tp_Title,
nLists.tp_ItemCount,
Webs.FullUrl
FROM
Webs
INNER JOIN
(
SELECT
ALAux.ItemCount as tp_ItemCount,
Lists.tp_Title,
Lists.tp_ID,
Lists.tp_WebID,
ALAux.Modified as tp_Modified,
Lists.tp_ServerTemplate,
Docs.DirName,
Docs.LeafName,
Lists.tp_ImageUrl
FROM
Lists
CROSS APPLY
TVF_AllListsAux_NoLock_ListId(Lists.tp_SiteId, Lists.tp_ID) AS ALAux
INNER JOIN
Docs
ON
Lists.tp_RootFolder = Docs.Id AND
Lists.tp_WebId = Docs.WebId
WHERE
tp_BaseType <> 1 AND
Lists.tp_SiteId = YOUR_SITE_ID
) As nLists
ON
Webs.Id = nLists.tp_WebId
LEFT OUTER JOIN
(
SELECT
(SUM(CAST((ISNULL(Docs.Size,0)) AS BIGINT))) As DocSizes,
Docs.ListId,
Docs.SiteId
FROM
Docs
WHERE
Docs.Type = 0 AND SiteId = YOUR_SITE_ID
GROUP BY
Docs.ListId,Docs.SiteId
) As DocsInList
ON
DocsInList.ListId = nLists.tp_ID
LEFT OUTER JOIN
(
SELECT
(SUM(CAST((ISNULL(tp_Size,0)) AS BIGINT))) As UserDataSize,
tp_ListId
FROM
UserData
GROUP BY
UserData.tp_ListId
) AS UserDataInList
ON
UserDataInList.tp_ListId = DocsInList.ListId
ORDER BY TotalSize DESC
It returns all lists of all webs, summing the size of the items and the attached documents. Document libraries are not included, use this:
它返回所有网站的所有列表,总结项目的大小和附加的文档。文件库不包括在内,请使用:
SELECT
Lists.tp_Title,
Lists.tp_ID as Id,
SUM(Docs.Size/1024 + Docs.MetaInfoSize/1024)/1024 AS SizeMB,
COUNT(*) as NumberOfFiles
FROM dbo.Docs
INNER JOIN Webs ON Webs.Id = Docs.WebId
INNER JOIN Lists ON Lists.tp_ID = Docs.ListId
WHERE Docs.Size > 0
GROUP BY Lists.tp_Title,Lists.tp_ID