Managing a custom site with an availability group
To add a custom site:
- In EMS, enable multitenancy and create a new site as Enabling and configuring multitenancy describes.
- Do one of the following:
- For EMS 7.0.6 or an earlier version, do the following:
- You can see a new database, FCM_SiteA, on the primary SQL replica. You must manually add this database to the high availability group.
Perform the following prerequisites on the FCM_SiteA database. These are required to add a database to the availability group:
- Right-click FCM_SiteA. Go to Options, and select Full for Recovery Model.
- Execute the following queries for FCM_SiteA, using the same password that you used in .:
ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = '...';
- Right-click the database. Go to Tasks, and take a full backup.
- Under Always On High Availability, right-click Availability Databases, and select Add Database.
- On the Select Databases page, select FCM_SiteA, then enter the password that you created. Click Refresh, then select the checkbox for FCM_SiteA.
- On the Connect to Replicas tab, connect to the other SQL Server instance previously joined as nodes with the Windows Server failover cluster. Click Next.
- For Data Synchronization, select Full Database and Log backup. Enter the file share path. Click Next.
- Verify that the validated checks succeed. The FCM_SiteA database is added to the availability group.
- You can see a new database, FCM_SiteA, on the primary SQL replica. You must manually add this database to the high availability group.
- For EMS 7.0.7 or a later version, do the following:
- When you create a new site in EMS, new custom site database, FCM_SiteA, is added to the availability group and automatically synchronized. Log in to the primary replica.
- You must execute the following queries for the FCM_siteA database to set and apply the password for the master key. Right-click the database and execute
ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = '...';
, using the password that you configured in Installing EMS and configuring SQL always on HA (EMS 7.0.7 or newer). The following shows the command if the password is SQLHA123!:ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = 'SQLHA123!';
. - Execute
sp_control_dbmasterkey_password @db_name = N'db_name', @password = N'Password' , @action = N'add'
. The following shows an example of this command:sp_control_dbmasterkey_password @db_name = N'FCM_siteA', @password = N'SQLHA123!' , @action = N'add'
. - Log in to the DBSRV-2 instance using SSMS.
- Repeat step iii on DBSRV-2 to use the password created earlier to open the master key.
- For EMS 7.0.6 or an earlier version, do the following:
To delete a custom site:
- Do one of the following:
- For EMS 7.0.6 or an earlier version, do the following:
- Log in to the primary replica instance using SSMS.
- Go to Availability Groups > Availability Databases.
- Right-click the desired database, and select Remove Database from Availability Group.
- Delete the site from EMS.
- Log in to the secondary replica using SSMS. FCM_siteA is stuck in a restoring state. Delete the database.
- For EMS 7.0.6 or an earlier version, do the following:
-
For EMS 7.0.7 or a later version, do the following:
-
Delete the site from EMS. The site database is removed from the availability group and deleted from the primary replica.
-
Log in to the secondary replica using SSMS.
-
FCM_siteA is stuck in a restoring state. Delete the database.
-