0

How do I determine the database and subsite size of my 2007 SPS environnment? I do have access to central administration

0

As we know SharePoint content database works based on site collection not sub site. So, in order to get database size report for a sub site we need to write custom coding... there is no inbuilt PS command or stsadm command to handle this.

We can use the below open source solution for this requirement, it is very simple and easy to use free tool :

https://archive.codeplex.com/?p=spusedspaceinfo

Reference URL :

How to find the SubSite size of SharePoint site 2007

Similarly, we can use the below PowerShell script :

#Get Size of all Sub-sites in a Site Collection

[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

 

# Function to calculate folder size

Function CalculateFolderSize($Folder)

{

    [long]$FolderSize = 0

  

    foreach ($File in $Folder.Files)

    {

   #Get File Size

        $FolderSize += $file.TotalLength;

    

  #Get the Versions Size

        foreach ($FileVersion in $File.Versions)

        {

            $FolderSize += $FileVersion.Size

        }

    }

 #Iterate through all subfolders

    foreach ($SubFolder in $Folder.SubFolders)

    {

  #Call the function recursively

        $FolderSize += CalculateFolderSize $SubFolder

    }

    return $FolderSize

}

 

  

$SiteURL = "http://sharepoint.company.com/"

$Site = new-object Microsoft.SharePoint.SPSite($SiteURL)

  

  foreach($Web in $Site.AllWebs)

  {

    #Call function to calculate Folder Size

    [long]$WebSize = CalculateFolderSize($Web.RootFolder)

    

    #Get Recycle Bin Size

    foreach($RecycleBinItem in $Web.RecycleBin)

        {

           $WebSize += $RecycleBinItem.Size

        }

  

        $Size = [Math]::Round($WebSize/1MB, 2)

        Write-Host  $web.Url ":`t" $Size "MB"

 

    #Dispose the object

    $web.dispose()

   }

Reference URL: https://www.sharepointdiary.com/2012/03/sharepoint-sub-site-storage-report.html#ixzz6CBs65rGH

0

the method to find out the size of a single site collection in a content database that can potentially hold multiple site collections is by using the stsadm -o enumsites command on one of the SharePoint servers.

E.g.

Web application url = http://portal.contoso.com

connect to SharePoint server start command prompt ( Start - Run - cmd.exe ) navigate to the 12-hive cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin stsadm -o enumsites -url http://portal.contoso.com > enumsites.txt notepad enumsites.txt This will give you a XML file with an overview of all site collections of your web application, including the database they are located in an the size of the site collection and looks like this:

<Sites Count="4">
  <Site Url="http://portal.contoso.com" Owner="CONTOSO\bill" ContentDatabase="WSS_Content_Portal" StorageUsedMB="2122.2" StorageWarningMB="0" StorageMaxMB="0" />
  <Site Url="http://portal.contoso.com/sites/siteA" Owner="CONTOSO\bill" ContentDatabase="WSS_Content_Portal" StorageUsedMB="0.5" StorageWarningMB="0" StorageMaxMB="0" />
  <Site Url="http://portal.contoso.com/sites/siteB" Owner="CONTOSO\bill" ContentDatabase="WSS_Content_Portal" StorageUsedMB="100.2" StorageWarningMB="0" StorageMaxMB="0" />
  <Site Url="http://portal.contoso.com/sites/siteC" Owner="CONTOSO\bill" ContentDatabase="WSS_Content_Portal" StorageUsedMB="0.4" StorageWarningMB="0" StorageMaxMB="0" />
</Sites>

If you only want to report on a single database in the web application add the -databasename parameter:

stsadm -o enumsites -url http://portal.contoso.com -databasename WSS_Content_Portal > enumsites.txt

Reference,

https://social.technet.microsoft.com/Forums/office/en-US/f546b400-0ffe-486f-b9bb-d21d62ea4f97/how-to-find-the-size-of-content-database-for-a-site-or-site-collection-in-moss-2007?forum=sharepointgenerallegacy

Using powershell and code, refer

https://stackoverflow.com/questions/5007180/how-to-find-size-of-the-content-database-in-moss-2007-and-no-of-site-collectins

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.