1. By EliasBlake,prosperdatasystems@gmail.com
SharePoint Content Database Document Sizing Stats
Here is a SQL scripton the allDocstable inWSS Contentdatabasesthathelped trenddatagrowthandanticipate storage
needsforSharePointdatabases andwasparticularlyuseful forSite Collectionsbuiltintootherapplicationframeworks
like DynamicsCRM,Team FoundationServerandSystemCenterServiceManager.Inthese situationsthereamany
competingcomponentsforwebandreportingservicesandthe lastthingadministratorswantisSharePointhogging
resources. If database transactionlogsare swellingandhourlybackupsdon’thelpthese querieshelpidentifythe “top
offenders”andwhere versionscouldbe dumped. The screenshotsshow several waysthe allDocstable canbe utilizedto
showpatternsinuseractivityincludingversioning,recycle binusage ornon-usage andBLOBstores.
Total file size and count per type
Files Activity by Date
The group by belowcanshowa ramp up inuseruploadsinlibrariesandlistsdate rangeswhenexplosivegrowthmay
have begun.
2. Thiscouldbe modifiedandstoredina vieworfunctiontobe run regularlyalthoughitwasusedfora scenari owhere the
situationwasat a critical pitch.Note the Day columncouldalsobe groupedbymonthin the cast functionor by summing
the monthsusinga substringon‘2014-02’,’2014-03’, etc..
Document Version Review
The versioningfeature maybeturnedon onsiteswhere itsnotneededandusersare unaware.Lookingatthe Underthe
Major_MinorVersionfieldthe valueof 1 indicate versioningison.Notice the genericVersion_Numvalueof 512 isnot
useful;toelaborate onwhichsiteshave say20 versionsajoinwithAllDocVersionsmusthappen. Althoughataglance
showsmultiple versionsthatcouldpossiblybe dumpedorarchived. Filesbytype andloadedbydate toshowpatterns
overtime.
3. Recycle Bin monitoring
Identifyfilesinuserandorsecondaryrecycle bins usingDeleteTransactionID.Thisexample usessomeandleavesout
columnsforsimplification.The frequencyof dumpsmayneedtobe changedby settingnew quotas.
In the screenshotbelow vnotice there are twofilesbutthree are presentedinthe table.AlsomycalculationsinMBare a
bitoff and KB couldbe usedto get more details.a
Thissuggeststhata usermay have documentsintheirrecycle binthatiscloggingstorage while waitingtogoto
secondarystorage before itgoestoitsfinal restingplace.
Thisapproach to viewingfile sizesandtypeshelpsassessimpacts globallyinthe environmentanditalsoassistsin
projectingfuture growthandpossiblyarchivingdataintorepositoriesinothersite collectionswithorsubsites.
Effectivenessof SQLServerFile StreamandRemote BlobStorage pointingtoanetworkshare can alsobe reviewedwith
4. thisdata. Of course,no monitoringhelpsif bestpracticessuchusingseparate volumesordiskspindlesfordataandlog
filesandWSSLogging or breakinglarge ContentDBsdownintofile groups.
Other Resources
Othertoolsfor shiningalightinthe SQL Pitare the ULSviewerandsqlnexusthatcanbe foundat codeplex andcan
extendbeyondthe diagnosticloggingcircaSharePoint2007 and 2010. In additionthe SQL ServerIOtool can provide
insightintolatencies. The AllDocstableprovidesare greatoverview butthere are AllDocVersionsandAllDocStream
tablesthatcouldbe joinedwithitfora deep-dive;detailsare foundhere, https://msdn.microsoft.com/en-
us/library/cc704495.aspx.Here isa goodpostwitha graphic,
http://blogs.msdn.com/b/sowmyancs/archive/2012/06/29/alldocversions-amp-alldocstreams-table-size-after-
upgrading-to-sharepoint-2010.aspx
Typical Crawl statistics and issues
Othermaintenance that couldcompoundsluggishnessof the SharePointfarmare the crawl rulesandschedulesand
designof contentsourcesleadingtomiserable searchservices.Thisisanothertopicbutsome considerationsinbrief are
listed.
1) Breakout subsitesandidentifylargeronesfortimesafterhours
a. Incremental crawl schedules onlyonsubsites thatare heavilyupdated
2) Use incremental crawlseverycouple of hoursandnote timestocompletion
a. Log backupsshouldbe before crawls
b. Full crawlslaterbefore orafterbackups
i. Full filegroupbackupsforcontentDBswithadedicatedwindow(hopefully).
3) Lessfrequentforaccessedsites
a. Checkusage statisticsinsite settingsandsearchservicesand
b. Findupdate patternsforlibrarysearching