During a recent deployment I ran into a snag attempting to deploy the Monitoring Server role in Lync Server 2010. The scenario was that during the initial topology publishing the process failed and there was no way to reattempt the same process using Topology Builder. I attempted to move the process along further using the Management Shell but some of the processes for creating the databases in SQL are actually handled by Visual Basic scripts in the background.
Clearly this was getting too complicated for something which should have been a quick fix.
During the topology publishing process the error log pointed to additional errors in the Create-MonitoringStore log file. I tracked it down to a permissions issue as the AD domain account I was using was not the same as the original administrator account which deployed Lync and was missing a few permissions to the SQL instance.
In order to reattempt the database creation process the Monitoring server had to be completely removed from the topology and be published, then re-added and re-published. This approach triggered a new database creation attempt, but the process again failed. The error in the Create-MonitoringStore log file was different this time, and was not permissions related.
Running script: C:\Windows\system32\cscript.exe //Nologo "C:\Program Files\Common Files\Microsoft
Lync Server 2010\DbSetup\RtcCdrDbSetup.wsf" /sqlserver:sql.schertz.local\lync
lync\dbpath /logpath:C:\CsData\MonitoringStore\lync\logpath /logsize:1024 /verbose
Installed SQL Server 2005 Backward Compatibility version is 8.05.2312
Connecting to SQL Server on sql.schertz.local\lync
SqlMajorVersion : 10
SqlMinorVersion : 0
SqlBuildNo : 2531
SQL version is acceptable: 10.0.2531.0
Opened database LcsCDR
Db version unknown. Clean install required.
(Major upgrade of database required.)
Due to schema changes this database cannot be re-used. It must be dropped and a new one created.
To preserve data, you must use this product’s backup/export restore/import solution. Examine the product documentation for instructions.
Exit code: ERROR_NEED_MAJOR_UPGRADE_USE_IMP_EXP (-50)
The error above is due to the fact that even after cleaning up the topology the original SQL database for the new server role is sitting in the SQL server from the original, failed attempt. The .wsf script is failing to create the new database they already exist.
The resolution is actually as simple as just manually deleting the existing databases and then reattempting the deployment.
- Remove the server role from Topology Builder and publish the changes.
- Connect to the SQL server and using SQL Management Studio access the targeted SQL instance and then delete the specific databases (LcsCDR and QoEMetrics in this scenario).
- Reconfigure the server role (e.g. Monitoring) in Topology Builder and then publish the changes again. This time the process should advance past the SQL ‘Db server unknown’ error.
This clean-up process should work for any failed database installation attempt and is not specific to just the Monitoring databases.