zuloobooth.blogg.se

Change data capture
Change data capture






See the Disable Database for change data capture template for an example of disabling a database.

change data capture

If a change data capture enabled database is dropped, change data capture jobs are automatically removed. To determine if a database is enabled, query the is_cdc_enabled column in the sys.databases catalog view. However, any gating roles created by change data capture will not be removed automatically and must be explicitly deleted. Disabling the database removes all associated change data capture metadata, including the cdc user and schema and the change data capture jobs. It is not necessary to disable individual tables before you disable the database.

change data capture

=Ī member of the sysadmin fixed server role can run the stored procedure sys.sp_cdc_disable_db (Transact-SQL) in the database context to disable change data capture for a database. There is also a Template Explorer icon on the SQL Server Management Studio toolbar. Under this folder, you will find all the templates referenced in this topic. To locate the templates in SQL Server Management Studio, go to View, click Template Explorer, and then select SQL Server Templates. See the Enable Database for change data capture template for an example of enabling a database. If either a schema or a database user named cdc currently exists in a database, the database cannot be enabled for change data capture until the schema and or user are dropped or renamed. The cdc schema also contains associated system functions used to query for change data.Ĭhange data capture requires exclusive use of the cdc schema and cdc user. The cdc schema contains the change data capture metadata tables and, after source tables are enabled for change data capture, the individual change tables serve as a repository for change data. When a database is enabled for change data capture, the cdc schema, cdc user, metadata tables, and other system objects are created for the database. To determine if a database is already enabled, query the is_cdc_enabled column in the sys.databases catalog view. This is done by running the stored procedure sys.sp_cdc_enable_db (Transact-SQL) in the database context. Enable for a databaseīefore a capture instance can be created for individual tables, a member of the sysadmin fixed server role (only in SQL Server / Azure SQL Managed Instance) or db_owner must first enable the database for change data capture.

CHANGE DATA CAPTURE HOW TO

This topic describes how to enable and disable change data capture for a database and a table. Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance






Change data capture