In SharePoint Server 2010, the profile synchronization database keeps growing after each sync. This seems to be expected behavior at the time of writing this post.
If you review the Database Types and Descriptions (http://technet.microsoft.com/en-us/library/cc678868.aspx) article on TechNet, it states the following for general size and growth factors: “Medium to large. Growth factors include the number of users and groups, and the ratio of users to groups.”
However, it does not state that the database will grow forever with no cleanup process that will clean up the database.
One workaround would be to delete your UPA (keeping the Social and Profile DB) and recreate the UPA with a new Sync DB once a month, thus not allowing the sync DB to grow too large.
The User Profile Synchronization database serves as a staging area for user profile information. User Profile information that is stored in the profile store and synchronization database is consumed by the User Profile service. By following the below steps, you can safely reset a User Profile Synchronization database without losing information in the profile store.
A few things to be careful about before you do this:
To reset profile synchronization by using Windows PowerShell:
Verify that you meet the following minimum requirements:
This is required to start the User Profile Synchronization service. After the User Profile Synchronization service is started you can remove the farm account from the Administrators group.
Net stop SPtimerv4
Copy the following code and paste it into a text editor, such as Notepad:
1: $SyncDB=Get-SPDatabase –Id <GUID of User Profile Sync DB> 2: $syncdb.Unprovision() 3: $syncdb.Status='Offline' 4: Get-SPServiceApplication 5: # Copy the GUID associated with the User Profile Service and paste it after "Id" in the next command 6: $UPA = Get-SPServiceApplication –Id <GUID of User Profile Service Application> 7: $UPA.ResetSynchronizationMachine() 8: $UPA.ResetSynchronizationDatabase() 9: $syncdb.Provision()
1: $SyncDB=Get-SPDatabase –Id <GUID of User Profile Sync DB>
2: $syncdb.Unprovision()
3: $syncdb.Status='Offline'
4: Get-SPServiceApplication
5: # Copy the GUID associated with the User Profile Service and paste it after "Id" in the next command
6: $UPA = Get-SPServiceApplication –Id <GUID of User Profile Service Application>
7: $UPA.ResetSynchronizationMachine()
8: $UPA.ResetSynchronizationDatabase()
9: $syncdb.Provision()
Replace the following placeholders with values where:
For more information, see Get-SPDatabase.
Note: This script does not show any status or progress.
1: ./ResetSyncDB.ps1
Perform the following steps to check whether you have granted the correct permissions to the database access account:
For more information about db_owner role, please refer to the following article:
> At the Windows PowerShell command prompt, type the following command to start the SharePoint 2010 Timer service:
Net start SPtimerv4
IISreset
For more information about how to Reset IIS , see the Reset IIS section of the "Configure profile synchronization" topic.
Note: After you reset IIS, pages of the Central Administration Web site will take several seconds to load.
Start Profile Synchronization Start profile synchronization manually (SharePoint Server 2010)
I would recommend a full crawl on your search service application as well to make sure all People results are accurate.