Configuring SQL Server to use MS SQL Reader
MS SQL Reader reads SQL Server change data using the native SQL Server Agent utility. For more information, see About Change Data Capture (SQL Server) on msdn.microsoft.com.
If a table uses a SQL Server feature that prevents change data capture, MS SQL Reader can not read it. For examples, see the "SQL Server 2014 (12.x) specific limitations" section of CREATE COLUMNSTORE INDEX (Transact-SQL) and Unsupported SQL Server Features for In-Memory OLTP.
In Azure SQL Database managed instances, change data capture requires collation to be set to the default SQL_Latin1_General_CP1_CI_AS at the server, database, and table level. If you need a different collation, it must be set at the column level.
Before Striim applications can use the MS SQL Reader adapter, a SQL Server administrator with the necessary privileges must do the following:
If SQL Server is running in a virtual machine in Azure, follow the instructions in Configuring an Azure virtual machine running SQL Server.
If it is not running already, start SQL Server Agent (see Start, Stop, or Pause the SQL Server Agent Service; if the agent is disabled, see Agent XPs Server Configuration Option). This service must be running for MS SQL Reader to work. If it is not running, you will see an error similar to the following in striim.server.log:
2017-01-08 15:40:24,596 @ -ERROR cached5 com.webaction.source.tm.MSSqlTransactionManager.getStartPosition (MSSqlTransactionManager.java:389) 2522 : Could not position at EOF, its equivalent LSN is NULL
Enable change data capture on each database to be read using the following commands (for more information, see Learn / SQL / SQL Server / Enable and disable change data capture):
for Amazon RDS for SQL Server:
EXEC msdb.dbo.rds_cdc_enable_db '<database name>';
for all others:
USE <database name> EXEC sys.sp_cdc_enable_db
Create a SQL Server user for use by Striim. This user must use the SQL Server authentication mode, which must be enabled in SQL Server. (If only Windows authentication mode is enabled, Striim will not be able to connect to SQL Server.)
Grant the MS SQL Reader user the
db_owner
role for each database to be read using the following commands:USE <database name> EXEC sp_addrolemember @rolename=db_owner, @membername=<user name>
For example, to enable change data capture on the database mydb
, create a user striim
, and give that user the db_owner
role on mydb
:
USE mydb EXEC sys.sp_cdc_enable_db CREATE LOGIN striim WITH PASSWORD = 'passwd' CREATE USER striim FOR LOGIN striim EXEC sp_addrolemember @rolename=db_owner, @membername=striim
To confirm that change data capture is set up correctly, run the following command and verify that all tables to read are included in the output:
EXEC sys.sp_cdc_help_change_data_capture
Striim can capture change data from a secondary database in an Always On availability group. In that case, change data capture must be enabled on the primary database.
Configuring an Azure virtual machine running SQL Server
When SQL Server is running in an Azure virtual machine as described in How to provision a Windows SQL Server virtual machine in the Azure portal, do the following before following the steps in Configuring SQL Server to use MS SQL Reader.
Go to the virtual machine's Overview tab.
If there is no public IP address, enable it.
If there is no DNS name, specify one, and make a note of the full name (<DNS name>.<Azure region>.cloudapp.azure.com), as you will need it to configure MSSQLReader.
Go to the virtual machine's SQL Server configuration tab.
Set SQL connectivity to Public (Internet).
Enable SQL Authentication and and specify the login name and password MSSQLReader will use to connect to SQL Server.
Make note of the Port setting, as you will need it to configure MSSQLReader.
Go to the Overview tab and click Connect.
When prompted, download the .rdb file, open it in Remote Desktop Connection, and connect to the virtual machine using the resource group's user name and password (not the user name and password you specified for SQL Server authentication).
Open the SQL Server Configuration Manager and set the following as necessary:
Protocols: Shared Memory enabled, Named Pipes disabled, TCP/IP enabled
TCP/IP Properties IP Addresses tab: TCP Dynamic Ports empty, TCP Port matches the SQL Authentication setting
Log out of Remote Desktop Connection and continue with the instructions in Configuring SQL Server to use MS SQL Reader.