find the replications and articles from distribution server
--according old upatedb replication, you may check the publication, then use the fllowing sql to find out these articles.
select * from MSpublications --check the publication
--according to publication, find out that these article.
select * from MSarticles where publication_id=1
select 'exec sp_addarticle @publication = N''analysis2_coredb_04'', @article = N'''+article+''', @source_owner = N''dbo'', @source_object = N'''+article+''', @destination_table = N'''+article+''', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''drop'', @schema_option = 0x00000000000000F3, @status = 16, @vertical_partition = N''false'', @ins_cmd = N''SQL'', @del_cmd = N''SQL'', @upd_cmd = N''SQL'', @filter = null, @sync_object = null, @auto_identity_range = N''false'' GO'
from MSarticles where publication_id=40
///All creation produre
-- Enabling the replication database
use master
GO
exec sp_replicationdboption @dbname = N'analysis2', @optname = N'publish', @value = N'true'
GO
use [analysis2]
GO
-- Adding the transactional publication
exec sp_addpublication @publication = N'analysis2_intranetdb', @restricted = N'false', @sync_method = N'character', @repl_freq = N'continuous', @description = N'Transactional publication of newjoyo2 database from Publisher DB-SELECT01.', @status = N'active', @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'false', @enabled_for_internet = N'false', @independent_agent = N'false', @immediate_sync = N'false', @allow_sync_tran = N'false', @autogen_sync_procs = N'false', @retention = 336, @allow_queued_tran = N'false', @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', @add_to_active_directory = N'false'
exec sp_addpublication_snapshot @publication = N'analysis2_intranetdb',@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
GO
exec sp_grant_publication_access @publication = N'analysis2_intranetdb', @login = N'BUILTINAdministrators'
GO
exec sp_grant_publication_access @publication = N'analysis2_intranetdb', @login = N'distributor_admin'
GO
exec sp_grant_publication_access @publication = N'analysis2_intranetdb', @login = N'sa'
GO
-- Adding the transactional articles
exec sp_addarticle @publication = N'analysis2_intranetdb', @article = N'TD007', @source_owner = N'dbo', @source_object = N'TD007', @destination_table = N'TD007', @type = N'logbased', @creation_script = null, @description = null, @pre_creation_cmd = N'drop', @schema_option = 0x00000000000000F3, @status = 16, @vertical_partition = N'false', @ins_cmd = N'SQL', @del_cmd = N'SQL', @upd_cmd = N'SQL', @filter = null, @sync_object = null, @auto_identity_range = N'false' GO
-- Adding the transactional subscription
exec sp_addsubscription @publication = N'analysis2_intranetdb', @article = N'all', @subscriber = N'DB-BO', @destination_db = N'bo2', @sync_type = N'automatic', @update_mode = N'read only', @offloadagent = 0, @dts_package_location = N'distributor'
GO
exec sp_addsubscription @publication = N'analysis2_intranetdb', @article = N'all', @subscriber = N'DB-BO02-R1', @destination_db = N'bo2', @sync_type = N'automatic', @update_mode = N'read only', @offloadagent = 0, @dts_package_location = N'distributor'
GO
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-242470/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MapStruct-plus cannot find converter fromStruct
- Generate Distribution Model from SAP ERP to SAP EWM in SAP S/4Hana
- PSQLException: ERROR: failed to find conversion function from unknown to charSQLExceptionErrorAIFunction
- [Javascript] Find Items from the end of the JavaScript Array using at, findLast and findLastIndexJavaScriptASTIndex
- how to move a MediaWiki wiki from one server to anotherServer
- SciTech-Mathmatics-Probability+Statistics: Distribution : The Uniform DistributionORM
- Could not find a version that satisfies the requirement py4j (from versions: ) No matching distributUIREM
- Standard Functions Used in SAP Retail with ArticlesFunctionAI
- SAP Retail Differences Between Articles and MaterialsAI
- MySQL5.7 Unable to find a match: MySQL-community-serverMySqlUnityServer
- Connect SQL Server from Linux Client using Windows Authentication and troubleshoot stepsSQLServerLinuxclientWindows
- Generalized Pareto Distribution (GPD)Zed
- Procedure to create Distribution model
- SAP Distribution Model初探
- MySQL報錯Slave: received end packet from server, apparent master shutdownMySqlServerAPPAST
- tomcat新增專案報錯:There are no resources that can be added or removed from the serverTomcatREMServer
- The last packet successfully received from the server was 2,625 milliseconds ago.ASTServerGo
- Exchange - Add Owner of Distribution Group
- 備忘錄:SQL SERVER2014 出現:“Cannot find one or more components”SQLServer
- [kubernetes]Error from server (BadRequest):container install-cni is not valid for pod kube-dnsErrorServerAIDNS
- 解決angular安裝 unable to access 'https:github...' Empty reply from serverAngularHTTPGithubServer
- Unable to execute SonarScanner analysis: Fail to get bootstrap index from server: Host is unreachable(Host unreachable)AIbootIndexServer
- COMM5000 Sandbox PwC Distribution
- Unknown initial character set index ‘255‘ received from server. Initial client character set can beIndexServerclient
- cURL error 52: Empty reply from server GitHub 三方登入報錯ErrorServerGithub
- MySQL異常刨析:ata source rejected establishment of connection, message from server: “Too many connectionMySqlServer
- Error response from daemon: user declined directory sharing G:Config-Centerconfig acos-server.propertiesErrorServer
- 遠端備份MySQL二進位制日誌--read-from-remote-serverMySqlREMServer
- https://www.zoho.com.cn/creator/articles/kuaisu2.htmlHTTPAIHTML
- MySQL案例04:Cause: java.sql.SQLException: Could not retrieve transaction read-only status from serverMySqlJavaExceptionServer
- Apache資源(Apache Software Foundation Distribution Directory)Apache
- find命令
- Hello,find!
- ThinkCMF製作文章列表 <portal:articles 標籤報錯 Undefined variable $voUndefined
- From now on
- AT_dwacon6th_prelims_c Cookie Distribution 題解Cookie
- 解決 The ‘supervisor==3.2.0‘ distribution was not found and is required by the application錯誤UIAPP
- 【問題解決】java.sql.SQLException: null, message from server: “Host ‘xxx.xx.xx.xxx‘ is blocked because ofJavaSQLExceptionNullServerBloC