Creating a new Deep Security Manager tenant connected to SQL Server Always On Availability Group
- Follow the standard instructions to create new tenant in Deep Security Manager web console. After the new tenant has been created, proceed with subsequent instructions below.
- Open SQL Server Management Studio (SSMS) and connect to the SQL Availability Group listener using database administrator credential. Notice that there is a new database created but it is not marked as synchronized. In this example, the new database is dsm_1.
- Change recovery model of the tenant database from default Simple to Full.
Right click the tenant database and select Properties. Then, click Options and find the Recovery Model field. Change to Full.
Always On Availability Group only supports the Full recovery model. - Perform full back up on database.
Right click the tenant database and select Tasks → Back Up.
- Add database to Availability Groups.
Right click your Availability Groups and select Add Database.
Choose the tenant database and click Next.
Connect to all existing replica to sync data.
Select your preferred synchronization method. After the validation is successful, click Finish.
Alternatively, you may use SQL command below to add database to Availability Group:
ALTER AVAILABILITY GROUP [YourAvailabilityGroupName] ADD DATABASE [TenantDatabaseName];
- Verify that tenant database is now tagged as synchronized.
Deleting existing Deep Security Manager tenant connected to SQL Server Always On Availability Group
- Begin by following the standard procedure to delete an existing tenant using the Deep Security Manager web console. Once the tenant status is marked as pending deletion, proceed with the steps outlined below.
Identify the corresponding tenant database name that will be used in subsequent instructions.
You can find the database name in Administration page → Tenants → Database Name column.
It is critical to verify the accuracy of the database name to prevent accidental deletion of the wrong tenant data.Open SQL Server Management Studio (SSMS) and connect to the SQL Availability Group listener using database administrator credential.
- Expand the Always On High Availability tree. Right click the tenant database that you want to delete then choose Remove Database from Availability Group. In this example, the database to delete is dsm_2.
- Deep Security Manager will periodically check for tenant database that has status of pending-for-deletion. After soft deletion time exceeds 7 days, DSM will automatically delete the database in primary replica.
- After the tenant database is deleted from the primary replica, it may still exist in the secondary replica.
Connect to secondary replica and manually delete the replica database.
Notes and Best Practices
- Always perform backups before adding/removing databases from the Availability Group.
- Ensure all replicas are healthy before making changes.
