如何确定SharePoint的文档库列表的大小

方法一: SharePoint Designer

====================

1. 在SharePoint Designer中打开站点.

2. 右键单击你想要查看的文档库的tree node, 选择properties.

docsize1

 

方法二: Object Model

==================

SPSite对象的StorageManagementInformation方法可以被用来读取整个站点集上的列表, 文档库的尺寸信息.

using (SPSite site = new SPSite("http://servername"))
{ 
    DataTable tbl; 
    tbl = site.StorageManagementInformation(
        SPSite.StorageManagementInformationType.DocumentLibrary, 
        SPSite.StorageManagementSortOrder.Decreasing, 
        SPSite.StorageManagementSortedOn.Size, 100); 
    foreach (DataRow row in tbl.Rows) 
    {
        foreach (DataColumn column in tbl.Columns)          
            MessageBox.Show("Doc Lib Name :" + row["Title"].ToString() + "  Size (bytes): " + row["Size"].ToString()); 
    } 
}

 

方法三: 用存储过程在数据库中直接捞取

==================

使用这个存储过程, 可以得到按字节的, 站点集中的包括metadata的信息在内的所有文档库的大小.

PROCEDURE proc_GetDocLibrarySizes (
@SiteId uniqueidentifier
);

 

[MS-WSSCADM]: Windows SharePoint Services Content Database Administrative Communications Protocol Specification

http://msdn.microsoft.com/en-us/library/cc313099.aspx

SharePoint Document library size

http://sridharu.blogspot.com/2009/02/sharepoint-document-library-size.html

posted on 2010-02-19 22:14  中道学友  阅读(1484)  评论(0编辑  收藏  举报

导航

技术追求准确,态度积极向上