当前位置:网站首页>SQL Server enable CDC
SQL Server enable CDC
2022-06-29 08:01:00 【A_ single_ cat】
SQL Server 2008 Turn on cdc
1. Turn on cdc
-- Check to see if it's on cdc
SELECT name,is_cdc_enabled FROM sys.databases WHERE name = 'CDCTEST'
-- Turn on database level cdc
exec sys.sp_cdc_enable_db
-- Open table level cdc
-- Tables must have primary keys or unique constraints , Adding a primary key to a table :
ALTER TABLE CDCTEST.prices
ADD CONSTRAINT PK_CDCTEST_PRICES PRIMARY KEY CLUSTERED (ID);
2. Database Mail properties -》 Filegroups -> add to

3. file -》 add to


4. Need to start agent , The link needs to be set to the computer name
In the control panel -》 Systems and security -》 System -> View computer information view computer name
5. Right click the database -》 Security -》 Check enable server proxy account , Add user name to object name

6. determine . Right click SQL Server agent , Turn it on
7. Under the current database , Execute the following script to open the table level cdc
–CDC Is the name of the database filegroup
EXEC sys.sp_cdc_enable_table
@source_schema = 'dbo', -- source_schema
@source_name = 'table_name', -- table_name
@capture_instance = NULL, -- capture_instance
@supports_net_changes = 1, -- supports_net_changes
@role_name = NULL, -- role_name
@index_name = NULL, -- index_name
@captured_column_list = NULL, -- captured_column_list
@filegroup_name = 'cdctest_cdc' -- filegroup_name
SQL Server 2017 Turn on cdc
1. Enable agent
# Enable SQL Server agent
/opt/mssql/bin/mssql-conf set sqlagent.enabled true
# restart SQL Server service , docker Deploy , restart docker that will do
2. Turn on cdc
-- Turn on database level cdc
use she111 ;
EXEC sys.sp_cdc_enable_db;
go
-- Open table level cdc
EXEC sys.sp_cdc_enable_table @source_schema = 'dbo', @source_name = 'prices', @role_name = NULL, @supports_net_changes = 0;
go
边栏推荐
- 4 years of working experience, and you can't tell the five communication modes between multithreads. Can you believe it?
- ROS当中的仿真时间以及Bag包操作
- 【深度之眼吴恩达机器学习作业班第四期】逻辑回归编程实现
- Electric check code configuration
- Django - installing mysqlclient error: mysqlclient 1.4.0 or newer is required; you have 0.9.3
- Reflection - project management thinking of small and medium-sized companies - make the products first and the functions first
- 【kerberos】kerberos 认证浅析
- pycharm的虚拟环境如何共享到jupyter-lab
- 4年工作经验,多线程间的5种通信方式都说不出来,你敢信?
- SizeBalanceTree
猜你喜欢
![[industrial control old horse] detailed explanation of design principle of pattern fountain based on PLC](/img/28/690f9985f32675f5d50d196c293abe.jpg)
[industrial control old horse] detailed explanation of design principle of pattern fountain based on PLC

AI deep dive of Huawei cloud

jsp学习部分

Vulnhub's dc6 target

Prompt during packaging: property 'sqlsessionfactory' or 'sqlsessiontemplate'‘

【深度之眼吴恩达第四期作业班】多元线性回归Linear Regression with multiple variables总结

After crossing, she said that the multiverse really exists

呕心沥血总结出来的MySQL常见错误以及解决方法(一)

打包时提示: Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘

Protobuf 二进制文件学习及解析
随机推荐
关于组织2021-2022全国青少年电子信息 智能创新大赛西北赛区(陕西)复赛的通知
编程能力提升方向
[industrial control old horse] detailed explanation of design principle of pattern fountain based on PLC
Vulnhub's dc6 target
DataTables screen error Popup
[repair collection function, update login interface] knowledge payment applet, blog applet, full version open source code, resource realization applet, with 299 whole station resource data
Vulnhub's dc7 target
自动化测试 - uiautomator2框架应用 - 自动打卡
C # import CSV into MySQL database
Some examples.
pycharm的虚拟环境如何共享到jupyter-lab
指针引用数组元素
498. diagonal traversal (simulation)
After crossing, she said that the multiverse really exists
小白大战指针 (上)
ROS当中的仿真时间以及Bag包操作
Protobuf binary file learning and parsing
SQL SERVER 2008 发布订阅到SQL Server 2017避坑指南
[量化投资系统]Django从数据库中实现筛选及分页
C#Mqtt订阅消息