How To Configure Standalone SQL Server, Database Mirroring, and Always on High Availability.

For the Standalone SQL Server Connection String: “Server=SQLServerName; Initial Catalog=DBName ; Integrated=True ”

User-added image

For the Database Mirroring Connection String: “Server=PrimarySQLServerName; Initial Catalog=DBName ; Integrated=True ; Failover Partner=SecondSQLServer”

User-added image

For Always on High Availability: “Server=ListenerName; Initial Catalog=XDdb;Integrated Security=True; MultiSubnetFailover=True”

User-added image

Steps to Update the Connection Strings:

  1. Take the Backup of the Databases and snapshot of all the Controllers.

  2. Only on 1st Controller, stop and clear the Datastore connections:

    Set-LogSite -State “Disabled”

    Set-MonitorConfiguration -DataCollectionEnabled $False

    Set-MonitorDBConnection -DataStore Monitor -DBConnection $null -AdminAddress $Localhost

    Set-LogDBConnection -Datastore Logging -DBConnection $null -AdminAddress $Localhost

  3. On all the other Controllers, reset their datastore configuration (which reads the cleared setting above)

    Reset-MonitorDataStore –DataStore Monitor –AdminAddress $Localhost

    Reset-LogDataStore –DataStore Logging –AdminAddress $Localhost

  4. On every Controller you need to disconnect all the services from the database, note that the order here is important, the last two cmdlets must be at the end:

    Set-SfDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-EnvTestDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-MonitorDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-BrokerDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-ProvDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-HypDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-AcctDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-ConfigDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-AnalyticsDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-LogDBConnection -DBConnection $null -AdminAddress $Localhost

    Set-AppLibDBConnection -DBConnection $null -AdminAddress $Localhost (For 7.15)

    Set-OrchDBConnection -DBConnection $null -AdminAddress $Localhost (For 7.15)

    Set-TrustDBConnection -DBConnection $null -AdminAddress $Localhost (For 7.15)

    Set-AdminDBConnection –Force -DBConnection $null -AdminAddress $Localhost

  5. At this stage your site will have no db connectivity. The next step is to hook all the services back up to the site database:

  6. $csSite =” Server=<ListenerName>; Initial Catalog=<DBName>; Integrated Security=True; MultiSubnetFailover=True”

    $csMonitor =” Server=<ListenerName>; Initial Catalog=<Monitor_DBName>; Integrated Security=True; MultiSubnetFailover=True”

    $csLog =” Server=<ListenerName>; Initial Catalog=<Log_DBName>; Integrated Security=True; MultiSubnetFailover=True”

    Set-AdminDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-LogDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-AnalyticsDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-ConfigDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-AcctDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-HypDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-ProvDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-BrokerDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-MonitorDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-EnvTestDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-SfDBConnection -DBConnection $csSite -AdminAddress $Localhost

    Set-AppLibDBConnection -DBConnection $csSite -AdminAddress $Localhost (For 7.15)

    Set-OrchDBConnection -DBConnection $csSite -AdminAddress $Localhost (For 7.15)

    Set-TrustDBConnection -DBConnection $csSite -AdminAddress $Localhost (For 7.15)

  7. Then on one Controller only, set the datastore connections and enable them:

    Set-MonitorDBConnection -DataStore Monitor -DBConnection $csMonitor -AdminAddress $Localhost

    Set-LogDBConnection -Datastore Logging -DBConnection $csLog -AdminAddress $Localhost

    Set-LogSite -State “Enable”

    Set-MonitorConfiguration -DataCollectionEnabled $True

  8. And on all the other Controller, reset their datastore configuration

    Reset-MonitorDataStore –DataStore Monitor –AdminAddress $Localhost

    Reset-LogDataStore –DataStore Logging –AdminAddress $Localhost

Related:

  • No Related Posts

Leave a Reply