Azure SQL Managed Instance as Source - DSS 6 | Data Source Solutions Documentation
Documentation: Azure SQL Managed Instance as Source - DSS 6 | Data Source Solutions Documentation
Azure SQL Managed Instance as Source
Capture
Data Source Solutions DSS allows you to Capture changes from Azure SQL Managed Instance. DSS uses SQL Server ODBC driver to capture changes from an Azure SQL Managed Instance location. This section describes the configuration requirements for capturing changes from Azure SQL Managed Instance location.
Table Types
DSS supports capture from the following table types in Azure SQL Managed Instance:
- clustered (row/page compressed and uncompressed)
- heap (row/page compressed and uncompressed)
DSS does not support capture from memory optimized tables and trigger-based capture from temporal tables.
Capture Methods
DSS allows only the SQL Access method (Capture_Method=SQL) for capturing (Capture) changes from Azure SQL Managed Instance.
SQL Access
In this capture method, DSS captures changes over an SQL connection. This method uses stored database function calls to retrieve incremental log fragments.
Grants for Log-Based Capture
This section lists the grants/permissions required for capturing changes from Azure SQL Managed Instance. Based on your requirement, either of the permissions listed in this section can be used.
For simplicity, we have categorized the required permissions into the following three models:
SysAdmin
The DSS database User must be granted sysadmin role in this permission model.
DbOwner
The DSS database User must be granted db_owner role for the source database.
Following are the configuration requirements that must be met/performed for this permission model:
DSS must already be installed before performing the following steps.
-
Create a special 'wrapper' SQL procedure:
This step is needed once when DSS is installed for an Azure SQL Managed Instance. But if Always On AG is installed, then this step is needed on each Always On AG node.
For [**SQL Access**](/docs/dss6-requirements-source-and-target-requirements-sql-server-requirements-sql-server-as-source-capture-from-sql-server-using-sql-access) capture method, a user with a **sysadmin** privilege must create a special 'wrapper' SQL procedures called **sp_dss_dblog** (replaced with **sp_dss_dblog2** in `v6.1.5/5` and later) and **sp_dss_dbtable** so that the DSS can call the SQL Server's read-only function **fn_dump_dblog**. This must be done inside the SQL Server database's special database **msdb**, not the actual capture database. The SQL query to create these procedures is available in the file **dsscapsysadmin.sql** in directory **DSS_HOME\\sql\\sqlserver**. The DSS database **User** must then be allowed to execute this procedure. For this, the DSS database **User** must be added to the special **msdb** database and the following grants must be provided: <div class="callout callout-important">For v6.1.5/5 and later, replace sp_dss_dblog with sp_dss_dblog2.
use msdb;
create user <em>username</em> for login <em>username</em>;
grant execute on sp_dss_dblog to <em>username</em>;
grant execute on sp_dss_dbtable to <em>username</em>;
-
Grant special read-only privilege:
This step is needed once when DSS is installed for an Azure SQL Managed Instance. But if Always On AG is installed, then this step is needed on each Always On AG node.
A **sysadmin** user must grant the DSS user login a special read-only privilege in the **master** database. ```shell use master; grant view server state to <em>username</em>; ```- Perform special SQL statements:
When Activate Replication is performed, it may need to perform special SQL statements that would require sysadmin or db_owner privilege. One example is that it may need to create an Article on a replicated table to track its changes. In that case, Activate Replication will write the necessary SQL statements into a script file in directory DSS_CONFIG\hubs\hub_name\channels\channel_name\locs\location_name\initsql on the capture machine. An error message will be displayed, which will list the name of the script file and the necessary permission level. The first time when Activate Replication displays this message, a user with sysadmin privilege must perform these SQL statements on the capture database. Subsequently, these SQL statements can be performed by the DSS database User with db_owner privilege.
Minimal
The DSS database User is not granted or does not require sysadmin or db_owner roles at runtime.
Following are the configuration requirements that must be met/performed for this permission model:
DSS must already be installed before performing the following steps.
-
Create a special 'wrapper' SQL procedure:
This step is needed once when DSS is installed for an SQL Server instance. But if Always On AG is installed, then this step is needed on each Always On AG node.
For [**SQL Access**](/docs/dss6-requirements-source-and-target-requirements-sql-server-requirements-sql-server-as-source-capture-from-sql-server-using-sql-access) capture method, a user with a **sysadmin** privilege must create a special 'wrapper' SQL procedures called **sp_dss_dblog** (replaced with **sp_dss_dblog2** in `v6.1.5/5` and later) and **sp_dss_dbtable** so that the DSS can call the SQL Server's read-only function **fn_dump_dblog**. This must be done inside the SQL Server database's special database **msdb**, not the actual capture database. The SQL query to create these procedures is available in the file **dsscapsysadmin.sql** in the **DSS_HOME\\sql\\sqlserver** directory. The DSS database **User** must then be allowed to execute this procedure. For this, the DSS database **User** must be added to the special **msdb** database and the following grants must be provided: <div class="callout callout-important">For v6.1.5/5 and later, replace sp_dss_dblog with sp_dss_dblog2.
- Perform special SQL statements: