When you have a replication in your environment what pre requesting we need to do.
1. Generate script out of subscriber database, include Trigger, indexes etc, useful for snapshot reapply.
2. Find which server is Distributor (Local same server or remote / different server), Publisher (All publication) And subscriber (All subscription)
3. Find out how replication topology designed. Ex: How many distributor, publisher and subscriber, one publication with many subscriptions or one publication with one subscription etc.
4. Script out all distributor, publication and subscription
Go to replication folder in SSMS -> generate script of Distributor alone and save it
Then choose generate script out of publication property and save it.
Then go to each publication click Generate script and script out and save it.
5. Note down all tables and objects are participated in replication
Copied from http://www.kendalvandyke.com/2013/01/transactional-replication-toolbox.html
/*********************************************************************************************
Transactional Replication Toolbox: Show Articles and Columns for All Publications
Description:
Shows articles and columns for each article for all transactional publications
(C) 2013, Kendal Van Dyke (mailto:kendal.vandyke@gmail.com)
Version History:
v1.00 (2013-01-29)
License:
This query is free to download and use for personal, educational, and internal
corporate purposes, provided that this header is preserved. Redistribution or sale
of this query, in whole or in part, is prohibited without the author's express
written consent.
Note:
Execute this query in the published database on the PUBLISHER
Because this query uses FOR XML PATH('') it requires SQL 2005 or higher
Address
AddressType
EmailAddress
Person
*********************************************************************************************/
use HDXDB
go
SELECT syspublications.name AS "Publication" ,
sysarticles.name AS "Article" ,
STUFF((
SELECT ', ' + syscolumns.name AS [text()]
FROM sysarticlecolumns WITH (NOLOCK)
INNER JOIN syscolumns WITH (NOLOCK) ON sysarticlecolumns.colid = syscolumns.colorder
WHERE sysarticlecolumns.artid = sysarticles.artid
AND sysarticles.objid = syscolumns.id
ORDER BY syscolumns.colorder
FOR
XML PATH('')
), 1, 2, '') AS "Columns"
FROM syspublications WITH (NOLOCK)
INNER JOIN sysarticles WITH (NOLOCK) ON syspublications.pubid = sysarticles.pubid
/*
WHERE
syspublications.name IN ('HDXDB_Replica')
AND sysarticles.name IN (
'Home Dynamix, LLC_$G_L Entry',--
'Home Dynamix, LLC_$Value Entry',--
'Home Dynamix, LLC_$EDI Message Line',
'Home Dynamix, LLC_$Sales Invoice Line',--
'Home Dynamix, LLC_$EDI Message Header',
'Home Dynamix, LLC_$Ledger Entry Dimension',
'Home Dynamix, LLC_$Posted Package',--
'Home Dynamix, LLC_$Sales Shipment Line',
'Home Dynamix, LLC_$Bill of Lading Summary Line',
'Home Dynamix, LLC_$Posted Package Line'
)
ORDER BY syspublications.name ,
sysarticles.name;
*/
--select @@version
6. Check any data filter applied. Document it.
7. Node down all table property configuration ex- Destination drop and create or truncate. FK true or false etc.
This will be useful to recreate, when we mess up the replication. (OR) in case of server corruption / migration etc.
