Home
%3CLINGO-SUB%20id%3D%22lingo-sub-333249%22%20slang%3D%22en-US%22%3EUser%20profiles%2C%20database%20sizes%20and%20DaysWorthOfActivityFeedsToKeep%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-333249%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Mar%2026%2C%202012%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EYou%20may%20have%20noticed%20a%20large%20spike%20in%20your%20User%20Profile%20Service%20Database%20size%2C%20or%20just%20wondered%20why%20it%E2%80%99s%20so%20large.%20After%20doing%20some%20investigation%2C%20you%20realize%20that%20the%20ActivityEventsConsolidated%20and%20ActivityEventsPublished%20table%20are%20fairly%20large%20and%20consuming%20the%20most%20space.%20You%E2%80%99d%20like%20to%20know%20how%20to%20shrink%20these.%20Fortunately%2C%20there%E2%80%99s%20now%20a%20way.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ELet%E2%80%99s%20start%20with%20an%20explanation%20of%20what%E2%80%99s%20happening.%20You%E2%80%99re%20populating%20user%20profiles%20with%20attributes%20from%20AD%20or%20some%20other%20user%20information%20source.%20This%20populates%20the%20newsfeeds%20with%20memberships%2C%20which%20is%20stored%20in%20these%20tables.%20This%20process%20fills%20up%20the%20profile%20DB%20and%20delays%20your%20profile%20population%20process.%20The%20Activity%20Feed%20Cleanup%20job%20removes%20data%20from%20these%20tables%20based%20on%20a%20expiration%20value.%20Out%20of%20the%20box%2C%20we%20set%20this%20value%20to%2014%20days%2C%20with%20no%20way%20to%20change%20it.%20In%20the%20August%202011%20CU%20for%20SP2010%2C%20we%20expose%20a%20way%20to%20change%20that%20value.%20There%E2%80%99s%20a%20new%20property%20called%20DaysWorthOfActivityFeedsToKeep%20for%20the%20UPSA%20object.%20Below%20is%20a%20sample%20PS%20script%20that%20shows%20how%20to%20change%20that%20value.%3C%2FP%3E%3CBR%20%2F%3E%3CCODE%3E%0A%20%20%20%24ups%20%3D%20Get-SPServiceApplication%20%3CGUID%20of%3D%22%22%20upsa%3D%22%22%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%24ups.DaysWorthOfActivityFeedsToKeep%20%3D%204%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%24ups.Update()%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%24ups.DaysWorthOfActivityFeedsToKeep%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%3C%2FGUID%3E%3C%2FCODE%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-333249%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Mar%2026%2C%202012%20You%20may%20have%20noticed%20a%20large%20spike%20in%20your%20User%20Profile%20Service%20Database%20size%2C%20or%20just%20wondered%20why%20it%E2%80%99s%20so%20large.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-333249%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Edatabase%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Epatching%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharepoint%202010%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Euser%20profiles%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft
First published on MSDN on Mar 26, 2012

You may have noticed a large spike in your User Profile Service Database size, or just wondered why it’s so large. After doing some investigation, you realize that the ActivityEventsConsolidated and ActivityEventsPublished table are fairly large and consuming the most space. You’d like to know how to shrink these. Fortunately, there’s now a way.


Let’s start with an explanation of what’s happening. You’re populating user profiles with attributes from AD or some other user information source. This populates the newsfeeds with memberships, which is stored in these tables. This process fills up the profile DB and delays your profile population process. The Activity Feed Cleanup job removes data from these tables based on a expiration value. Out of the box, we set this value to 14 days, with no way to change it. In the August 2011 CU for SP2010, we expose a way to change that value. There’s a new property called DaysWorthOfActivityFeedsToKeep for the UPSA object. Below is a sample PS script that shows how to change that value.


$ups = Get-SPServiceApplication <GUID of UPSA>
$ups.DaysWorthOfActivityFeedsToKeep = 4
$ups.Update()
$ups.DaysWorthOfActivityFeedsToKeep