📄 diskrent (diskrent).sql
字号:
-- Enabling the replication database
use master
GO
exec sp_replicationdboption @dbname = N'diskrent', @optname = N'publish', @value = N'true'
GO
use [diskrent]
GO
-- Adding the transactional publication
exec sp_addpublication @publication = N'diskrent', @restricted = N'false', @sync_method = N'character', @repl_freq = N'continuous', @description = N'Transactional publication of diskrent database from Publisher JERRY.', @status = N'active', @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'true', @enabled_for_internet = N'false', @independent_agent = N'true', @immediate_sync = N'true', @allow_sync_tran = N'true', @autogen_sync_procs = N'true', @retention = 336, @allow_queued_tran = N'true', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21, @ftp_login = N'anonymous', @allow_dts = N'false', @allow_subscription_copy = N'false', @conflict_policy = N'pub wins', @centralized_conflicts = N'true', @conflict_retention = 14, @queue_type = N'sql', @add_to_active_directory = N'false', @logreader_job_name = N'JERRY-diskrent-1', @qreader_job_name = N'[JERRY].9'
exec sp_addpublication_snapshot @publication = N'diskrent',@frequency_type = 4, @frequency_interval = 1, @frequency_relative_interval = 1, @frequency_recurrence_factor = 0, @frequency_subday = 8, @frequency_subday_interval = 1, @active_start_date = 0, @active_end_date = 0, @active_start_time_of_day = 0, @active_end_time_of_day = 235959, @snapshot_job_name = N'JERRY-diskrent-diskrent-1'
GO
exec sp_grant_publication_access @publication = N'diskrent', @login = N'BUILTIN\Administrators'
GO
exec sp_grant_publication_access @publication = N'diskrent', @login = N'WWW\Administrator'
GO
exec sp_grant_publication_access @publication = N'diskrent', @login = N'distributor_admin'
GO
exec sp_grant_publication_access @publication = N'diskrent', @login = N'sa'
GO
-- Adding the transactional articles
exec sp_addarticle @publication = N'diskrent', @article = N'gpb', @source_owner = N'dbo', @source_object = N'gpb', @destination_table = N'gpb', @type = N'logbased', @creation_script = null, @description = null, @pre_creation_cmd = N'drop', @schema_option = 0x000000000000CEF3, @status = 16, @vertical_partition = N'true', @ins_cmd = N'CALL sp_MSins_gpb', @del_cmd = N'XCALL sp_MSdel_gpb', @upd_cmd = N'XCALL sp_MSupd_gpb', @filter = null, @sync_object = null, @auto_identity_range = N'false'
GO
-- Adding the article's partition column(s)
exec sp_articlecolumn @publication = N'diskrent', @article = N'gpb', @column = N'gph', @operation = N'add'
GO
exec sp_articlecolumn @publication = N'diskrent', @article = N'gpb', @column = N'gpmc', @operation = N'add'
GO
exec sp_articlecolumn @publication = N'diskrent', @article = N'gpb', @column = N'gpyy', @operation = N'add'
GO
exec sp_articlecolumn @publication = N'diskrent', @article = N'gpb', @column = N'gpcd', @operation = N'add'
GO
exec sp_articlecolumn @publication = N'diskrent', @article = N'gpb', @column = N'ghsbh', @operation = N'add'
GO
exec sp_articlecolumn @publication = N'diskrent', @article = N'gpb', @column = N'msrepl_tran_version', @operation = N'add'
GO
-- Adding the article synchronization object
EXEC sp_articleview @publication = N'diskrent', @article = N'gpb', @view_name = N'SYNC_diskrent_gpb'
GO
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -