I had to deploy a Lync Server 2010 Enterprise Pool about a month ago and while I thought it would take just a few hours to complete, it ended up taking a good day and a half. The problem I ran into was for some odd reason the installation would only create the lis and xds database during the install:
It took me 10 reinstall attempts while cleaning out the settings in the configuration container of Active Directory and uninstalling the binaries to get the databases installed properly. I took a good few hours performing post mortem on what I did differently but failed to figure out what was the problem. Although I wasn’t able to figure out what caused my installs to fail, I did learn something about the installation while I was troubleshooting and that was how the databases were created. Unfortunately, I just realized that I only had the logs for the RTCLocal SQL instance install for the front-end server and since I’m at the JFK airport with no free wireless access, I’ll spend the the time I have as I wait for my next flight to write about the local SQL RTCLocal instance and will retrieve the logs for the actual SQL install at a later time for another post.
The LCSSetup_Commands.txt file
Upon a successful Lync Server 2010 front-end server install, a text file named LCSSetup_Commands.txt actually gets created in the AppData folder of the account that you used to install the front-end server:
C:UserssomeAccountNameAppDataLocalTemp
If we open that log file, we’ll see that it contains a verbose log of the installation:
I won’t paste all the log entries in this post but what I’ll do is copy and paste the ones that are of interest for seeing what actually gets executed to create the databases for the local SQL instance named RTCLocal located on the front-end server.
Browsing through the log will show that the install actually uses the CScript.exe command to execute prewritten .wsf scripts which are copied to the C:Program FilesCommon FilesMicrosoft Lync Server 2010DbSetup folder when you run the Install Local Configuration Store step:
When the installer executes these scripts, parameters are also passed to customize the install for a local SQL install or a back-end server. The following are the databases and the corresponding scripts that are found in the log file:
rtc
CScript.exe //U //Nologo DBSetup.wsf /sqlserver:localhostrtclocal /serveracct:”SVR-LYNC-01RTC Server Local Group;SVR-LYNC-01RTC Component Local Group” /adminacct:”SVR-LYNC-01RTC Local Administrators” /roacct:”SVR-LYNC-01RTC Local Read-only Administrators” /role:se /verbose
——————————————————————————————–
Installed SQL Server 2005 Backward Compatibility version is 8.05.2312
Connecting to SQL Server on localhostrtclocal
SqlMajorVersion : 10
SqlMinorVersion : 0
SqlBuildNo : 2531
SQL version is acceptable: 10.0.2531.0
Default database data file path is c:Program FilesMicrosoft SQL ServerMSSQL10.RTCLOCALMSSQLData
Default database data file path is c:Program FilesMicrosoft SQL ServerMSSQL10.RTCLOCALMSSQLData
Default database log file path is c:Program FilesMicrosoft SQL ServerMSSQL10.RTCLOCALMSSQLData
(Database rtcdyn doesn’t exist.)
Creating database rtcdyn
DbFile : PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldatartcdyn.mdf
LogFile: PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldatartcdyn.ldf
Executing resource SetDbOptions on rtcdyn
Executing batch dbcommon.sql on rtcdyn
Executing batch types.sql on rtcdyn
Executing batch roles.sql on rtcdyn
Executing batch dbrtcdyn.sql on rtcdyn
(Database doesn’t exist. Performing clean install.)
Creating database rtc
DbFile : PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldatartc.mdf
LogFile: PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldatartc.ldf
Executing resource SetDbOptions on rtc
Executing batch dbcommon.sql on rtc
Executing batch types.sql on rtc
Executing batch roles.sql on rtc
Executing batch dbrtc.sql on rtc
Executing resource LinkStaticAndDynamicDatabases on rtc
Executing resource DbReIndex on rtc
Setting security in rtc
DbOwner is now sa
SVR-LYNC-01RTC Component Local Group has a Win32_Account instance of SIDType 4
Refreshing existing SVR-LYNC-01RTC Component Local Group SQL login
Adding SVR-LYNC-01RTC Component Local Group SQL login
Adding SVR-LYNC-01RTC Component Local Group db user in rtc
SVR-LYNC-01RTC Local Administrators has a Win32_Account instance of SIDType 4
Refreshing existing SVR-LYNC-01RTC Local Administrators SQL login
Adding SVR-LYNC-01RTC Local Administrators SQL login
Adding SVR-LYNC-01RTC Local Administrators db user in rtc
SVR-LYNC-01RTC Local Read-only Administrators has a Win32_Account instance of SIDType 4
Refreshing existing SVR-LYNC-01RTC Local Read-only Administrators SQL login
Adding SVR-LYNC-01RTC Local Read-only Administrators SQL login
Adding SVR-LYNC-01RTC Local Read-only Administrators db user in rtc
SVR-LYNC-01RTC Server Local Group has a Win32_Account instance of SIDType 4
Refreshing existing SVR-LYNC-01RTC Server Local Group SQL login
Adding SVR-LYNC-01RTC Server Local Group SQL login
Adding SVR-LYNC-01RTC Server Local Group db user in rtc
Adding user SVR-LYNC-01RTC Server Local Group to role ServerRole
Adding user SVR-LYNC-01RTC Component Local Group to role ServerRole
Adding user SVR-LYNC-01RTC Local Read-only Administrators to role ReadOnlyRole
Adding user SVR-LYNC-01RTC Local Administrators to role AdminRole
Successfully added logins and db users to the specified database roles in rtc
Setting Db schema version to 59
Setting Db sproc version to 35
Setting security in rtcdyn
Opened database rtc
Db owner is sa
Adding SVR-LYNC-01RTC Component Local Group db user in rtcdyn
DataBaseRole.AddMember succeeded for SVR-LYNC-01RTC Component Local Group ( )
Adding SVR-LYNC-01RTC Server Local Group db user in rtcdyn
DataBaseRole.AddMember succeeded for SVR-LYNC-01RTC Server Local Group ( )
Adding SVR-LYNC-01RTC Local Administrators db user in rtcdyn
DataBaseRole.AddMember succeeded for SVR-LYNC-01RTC Local Administrators ( )
Successfully assigned security to rtcdyn from rtc
rtcdyn
CScript.exe //U //Nologo DBSetup.wsf /sqlserver:localhostrtclocal /serveracct:”SVR-LYNC-01RTC Server Local Group;SVR-LYNC-01RTC Component Local Group” /adminacct:”SVR-LYNC-01RTC Local Administrators” /roacct:”SVR-LYNC-01RTC Local Read-only Administrators” /role:se /verbose
——————————————————————————————–
Installed SQL Server 2005 Backward Compatibility version is 8.05.2312
Connecting to SQL Server on localhostrtclocal
SqlMajorVersion : 10
SqlMinorVersion : 0
SqlBuildNo : 2531
SQL version is acceptable: 10.0.2531.0
Default database data file path is c:Program FilesMicrosoft SQL ServerMSSQL10.RTCLOCALMSSQLData
Default database data file path is c:Program FilesMicrosoft SQL ServerMSSQL10.RTCLOCALMSSQLData
Default database log file path is c:Program FilesMicrosoft SQL ServerMSSQL10.RTCLOCALMSSQLData
(Database rtcdyn doesn’t exist.)
Creating database rtcdyn
DbFile : PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldatartcdyn.mdf
LogFile: PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldatartcdyn.ldf
Executing resource SetDbOptions on rtcdyn
Executing batch dbcommon.sql on rtcdyn
Executing batch types.sql on rtcdyn
Executing batch roles.sql on rtcdyn
Executing batch dbrtcdyn.sql on rtcdyn
(Database doesn’t exist. Performing clean install.)
Creating database rtc
DbFile : PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldatartc.mdf
LogFile: PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldatartc.ldf
Executing resource SetDbOptions on rtc
Executing batch dbcommon.sql on rtc
Executing batch types.sql on rtc
Executing batch roles.sql on rtc
Executing batch dbrtc.sql on rtc
Executing resource LinkStaticAndDynamicDatabases on rtc
Executing resource DbReIndex on rtc
Setting security in rtc
DbOwner is now sa
SVR-LYNC-01RTC Component Local Group has a Win32_Account instance of SIDType 4
Refreshing existing SVR-LYNC-01RTC Component Local Group SQL login
Adding SVR-LYNC-01RTC Component Local Group SQL login
Adding SVR-LYNC-01RTC Component Local Group db user in rtc
SVR-LYNC-01RTC Local Administrators has a Win32_Account instance of SIDType 4
Refreshing existing SVR-LYNC-01RTC Local Administrators SQL login
Adding SVR-LYNC-01RTC Local Administrators SQL login
Adding SVR-LYNC-01RTC Local Administrators db user in rtc
SVR-LYNC-01RTC Local Read-only Administrators has a Win32_Account instance of SIDType 4
Refreshing existing SVR-LYNC-01RTC Local Read-only Administrators SQL login
Adding SVR-LYNC-01RTC Local Read-only Administrators SQL login
Adding SVR-LYNC-01RTC Local Read-only Administrators db user in rtc
SVR-LYNC-01RTC Server Local Group has a Win32_Account instance of SIDType 4
Refreshing existing SVR-LYNC-01RTC Server Local Group SQL login
Adding SVR-LYNC-01RTC Server Local Group SQL login
Adding SVR-LYNC-01RTC Server Local Group db user in rtc
Adding user SVR-LYNC-01RTC Server Local Group to role ServerRole
Adding user SVR-LYNC-01RTC Component Local Group to role ServerRole
Adding user SVR-LYNC-01RTC Local Read-only Administrators to role ReadOnlyRole
Adding user SVR-LYNC-01RTC Local Administrators to role AdminRole
Successfully added logins and db users to the specified database roles in rtc
Setting Db schema version to 59
Setting Db sproc version to 35
Setting security in rtcdyn
Opened database rtc
Db owner is sa
Adding SVR-LYNC-01RTC Component Local Group db user in rtcdyn
DataBaseRole.AddMember succeeded for SVR-LYNC-01RTC Component Local Group ( )
Adding SVR-LYNC-01RTC Server Local Group db user in rtcdyn
DataBaseRole.AddMember succeeded for SVR-LYNC-01RTC Server Local Group ( )
Adding SVR-LYNC-01RTC Local Administrators db user in rtcdyn
DataBaseRole.AddMember succeeded for SVR-LYNC-01RTC Local Administrators ( )
Successfully assigned security to rtcdyn from rtc
xds
CScript.exe //U //Nologo xdssetup.wsf /clean /publisheracct:”RTC Local Administrators” /replicatoracct:”NT SERVICEREPLICA;RTC Local Config Replicator” /consumeracct:”RTC Server Local Group;RTC Component Local Group;RTC Local Read-only Administrators” /role:replica /verbose
——————————————————————————————–
Installed SQL Server 2005 Backward Compatibility version is 8.05.2312
Connecting to SQL Server on SVR-LYNC-01rtclocal
SqlMajorVersion : 10
SqlMinorVersion : 0
SqlBuildNo : 2531
SQL version is acceptable: 10.0.2531.0
Default database data file path is c:Program FilesMicrosoft SQL ServerMSSQL10.RTCLOCALMSSQLData
Default database data file path is c:Program FilesMicrosoft SQL ServerMSSQL10.RTCLOCALMSSQLData
Default database log file path is c:Program FilesMicrosoft SQL ServerMSSQL10.RTCLOCALMSSQLData
(Database xds doesn’t exist.)
Creating database xds
DbFile : PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldataxds.mdf
LogFile: PhysicalName = c:program filesmicrosoft sql servermssql10.rtclocalmssqldataxds.ldf
Executing batch dbcommon.sql on xds
Executing resource SetDbRoles on xds
Executing batch xds.sql on xds
Setting replica role
Executing resource SetReplica on xds
Executing resource DbReIndex on xds
Setting security in xds
DbOwner is now sa
NT SERVICEREPLICA is not a valid SQL login. A SQL login with this name will be created.
NT SERVICEREPLICA doesn’t have a Win32_Account instance
Adding NT SERVICEREPLICA SQL login
Adding NT SERVICEREPLICA db user in xds
SVR-LYNC-01RTC Component Local Group is not a valid SQL login. A SQL login with this name will be created.
SVR-LYNC-01RTC Component Local Group has a Win32_Account instance of SIDType 4
Adding SVR-LYNC-01RTC Component Local Group SQL login
Adding SVR-LYNC-01RTC Component Local Group db user in xds
SVR-LYNC-01RTC Local Administrators is not a valid SQL login. A SQL login with this name will be created.
SVR-LYNC-01RTC Local Administrators has a Win32_Account instance of SIDType 4
Adding SVR-LYNC-01RTC Local Administrators SQL login
Adding SVR-LYNC-01RTC Local Administrators db user in xds
SVR-LYNC-01RTC Local Config Replicator is not a valid SQL login. A SQL login with this name will be created.
SVR-LYNC-01RTC Local Config Replicator has a Win32_Account instance of SIDType 4
Adding SVR-LYNC-01RTC Local Config Replicator SQL login
Adding SVR-LYNC-01RTC Local Config Replicator db user in xds
SVR-LYNC-01RTC Local Read-only Administrators is not a valid SQL login. A SQL login with this name will be created.
SVR-LYNC-01RTC Local Read-only Administrators has a Win32_Account instance of SIDType 4
Adding SVR-LYNC-01RTC Local Read-only Administrators SQL login
Adding SVR-LYNC-01RTC Local Read-only Administrators db user in xds
SVR-LYNC-01RTC Server Local Group is not a valid SQL login. A SQL login with this name will be created.
SVR-LYNC-01RTC Server Local Group has a Win32_Account instance of SIDType 4
Adding SVR-LYNC-01RTC Server Local Group SQL login
Adding SVR-LYNC-01RTC Server Local Group db user in xds
Adding user SVR-LYNC-01RTC Local Administrators to role PublisherRole
Adding user SVR-LYNC-01RTC Server Local Group to role ConsumerRole
Adding user SVR-LYNC-01RTC Component Local Group to role ConsumerRole
Adding user SVR-LYNC-01RTC Local Read-only Administrators to role ConsumerRole
Adding user NT SERVICEREPLICA to role ReplicatorRole
Adding user SVR-LYNC-01RTC Local Config Replicator to role ReplicatorRole
Adding user NT SERVICEREPLICA to role PublisherRole
Adding user SVR-LYNC-01RTC Local Config Replicator to role PublisherRole
Successfully added logins and db users to the specified database roles in xds
Setting Db schema version to 10
Setting Db sproc version to 8
——————————————————————————————————————————————————————-
There you have it, the scripts and parameters used to install and configure the 3 databases found in the local SQL instance on the front-end server.
A word of caution that although these commands can be used to install the databases for the local instance, I wouldn’t recommend manually installing these databases in any situation. There is too much room for mistakes and as most of us know, we are all prone to errors.
One Response
The problem I was having is the Lync Server Replica Replication Agent wouldn't start. I was getting errors that related to a database issue, (it was previously fine). Using ocslogger and snooper I was able to see that the Replica service was reporting "a schema or sproc version mismatch was detected". Actual = 0.0, Expected = 10.13
But I'm using Lync Server 2013. Your post pointed me in the right direction, but the scripts you mentioned do not seem to exist anymore.
But, Under Program Files > Common Files -> Microsoft Lync Server 2013 -> DBSetup. There is a file called InstallCsDatabase.exe
If you run that you'll get examples of what command line options you can set.
For exmaple,
InstallCsDatabase.exe /Clean /Feature:RtcDatabaseStore /SqlServer:your.fqdn.herertclocal
Will rebuild the rtc + rtcdyn databases.
And,
InstallCsDatabase.exe /Clean /Feature:CentralMgmtStore /SqlServer:your.fqdb.herertclocal
Will rebuild the xds database.