Last active
February 28, 2023 00:20
-
-
Save garystafford/d7fbcaa08d0d9f35f072524c1fcf0473 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- enable the database for CDC | |
EXEC msdb.dbo.rds_cdc_enable_db 'tickit' | |
USE tickit | |
GO | |
SELECT * FROM sys.filegroups; | |
SELECT * FROM sys.database_files; | |
-- add new filegroup to database | |
ALTER DATABASE tickit ADD FILEGROUP CDC_FG1; | |
-- add new file to filegroup | |
ALTER DATABASE tickit | |
ADD FILE | |
( | |
NAME = cdc_data1, | |
FILENAME = 'D:\rdsdbdata\DATA\sqldba_data1.ndf', | |
SIZE = 500 MB, | |
FILEGROWTH = 50 MB | |
) TO FILEGROUP CDC_FG1; | |
-- enabling cdc for a sql server table | |
EXEC sys.sp_cdc_enable_table | |
@source_schema = N'crm', | |
@source_name = N'user', | |
@role_name = N'admin', | |
@filegroup_name = N'CDC_FG1', | |
@supports_net_changes = 0 | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment