Yesterday I got a chance to work with one of the customer who was facing issue with Profile Synchronization service in hung state as 'Starting' status in his SharePoint 2013 environment.
In the ULS viewer OWSTIMER.EXE process were throwing below error.
"UserProfileApplication.SynchronizeMIIS: Failed to configure MIIS post database, will attempt during next rerun. Exception: System.Configuration.ConfigurationErrorsException: ERR_CONFIG_DB at Microsoft.Office.Server.UserProfiles.Synchronization.ILMPostSetupConfiguration.ValidateConfigurationResult(UInt32 result) at Microsoft.Office.Server.UserProfiles.Synchronization.ILMPostSetupConfiguration.ConfigureMiisStage2() at Microsoft.Office.Server.Administration.UserProfileApplication.SetupSynchronizationService(ProfileSynchronizationServiceInstance profileSyncInstance)"
Based on above error I made action plan which directed to resolution.
1) Ran 'Get-SPServiceInstance' in Sharepoint Powershell to get the status of Profile Synchronization and found its in 'Provisioning' status.
2) Stopped Profile Synchronization service by running the command 'Stop-SPServiceInstance'.
3) Database was running on SQL2012 and checked SQL Native client in C:\Windows\System32 and found it was version11 (sqlncli11.dll).
4) Next step was to check the SharePoint box and found there are no SQL Native client deployed which is one of prerequisite for SharePoint 2013 deployment.
5) After deploying SQL Server 2008 R2 SP1 Native Client in all SharePoint boxes, clicked on Start 'User Profile Synchronisation Service' and it Started successfully.