MongoDB/SQL Server???????????
???????????? ???????[ 2016/5/25 10:40:13 ] ????????SQL Server ?????
????????SQL Server???????????????????г??????SQL Server/MongoDB???????????з???????????????д???????????ù??????????У????3????з????????????????????????·??????????????????????????????????????????SQL Server???е?CDC(change data capture)??????????????????????????????????????????3?????????????????????п??е?????????
????1?????????
????· ????
?????ο????????е?????????Σ??????????ж??????????μ?MongoDB??????????????????С???????????????????????м????????????Ρ??????????????????????????и????????Σ??????и??????????????????????????Ρ?
????· ??????
??????????????????????????????????????MongoDB???????????????????????????????????????Ρ??????????????????????????????????????????????????д?????????????????????????
????· ??????
??????????????????CDC?????MongoDB??????cdc?????л?????????????????????С????迪????????SQL Server???е???????????????????????ù?????????????????????д?????????????????????????????????
?????????????????CDC???????????????С????????????????÷?????????????
????2??CDC????????
????????????????CDC????????????±????SQL Server?????????ɡ?MongoDB(Data warehouse??)?????????????????????????????????Nodejs???????ɡ? ??????alarmos??????aaaaaabbbbbb???????????CDC??????????
????· ????CDC????
????CDC??????????SQL Server?????T-SQL???
????USE alarmos
????GO
????EXEC sys.sp_cdc_enable_db
????GO
??????г????????????????3????cdc?????(schema?cdc)??
????· ?????????
????????????????????????????
????USE alarmos
????GO
????EXEC sys.sp_cdc_enable_table
????@source_schema = 'dbo'??
????@source_name = 'aaaaaabbbbbb'??
????@role_name = 'sa'
????GO
????@source schema??@source name???????????????@role_name????????CDC???????????????????ж????????????г?????????
????· ???????????
??????????????????????????????????????????????T-SQL?????????????fn cdc get all changes dbo aaaaaabbbbbb()???????????????????(??????????????????)????????ú??????????????????
????USE alarmos
????select @begin_lsn = sys.fn_cdc_get_min_lsn('dbo_aaaaaabbbbbb)
????select @end_lsn = sys.fn_cdc_get_max_lsn()
????select * from cdc.fn_cdc_get_all_changes_dbo_Customer(@begin_lsn?? @end_lsn?? 'all');
??????????????????????2???????????2??????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11