Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Replicate a new table without taking a snapshot


Replicate a new table without taking a snapshot

Author
Message
sudonjn
sudonjn
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 220
I have a 350 GB table that is replicated, and I need to rename. This will require replication to be stopped on this table. Is it possible to add a table to a publication without requiring a snapshot? You can do this when setting up a new publication, but I cannot figure out how to do it when adding an article to an existing publication. I do not want to create another publication for only this table.
penu.v8
penu.v8
Grasshopper
Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)

Group: General Forum Members
Points: 20 Visits: 94
you can try adding newtable/ article to the existing publication by recreating the snapshot for that single article if you using transactional replication
sudonjn
sudonjn
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 220
You are correct in that if I remove the article from the publication and add it back once renamed, a snapshot of only that table will be taken. I am trying to avoid taking a 350GB snapshot, and more-so, I am trying to have as little downtime as possible. It will take too long to create the snapshot and move that data to the replicated table.
happycat59
happycat59
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3561 Visits: 3094
Easy, peasy. When you create the article, specify "None" for @pre_creation_cmd (when using the sproc sp_addarticle). If you are using the GUI, when adding the article, go into "Article Properties" and scroll down to "Action if name is in use" and select "Keep existing object unchanged"



sudonjn
sudonjn
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 220
Thank you. I will try that.
sudonjn
sudonjn
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 220
I could not get it to work through using the GUI. It would still prompt that a snapshot was needed. However, I was able to script it. I did have to make @pre_creation_cmd = 'none', but I also had to run the command sp_addsubscription with @sync_type = 'replication support only'. Here are the scripts with generic names.

USE [PublicationDB]
EXEC sp_addarticle @publication = N'Publication', @article = N'Table', @source_owner = N'dbo',
   @source_object = N'Table', @type = N'logbased', @description = N'', @creation_script = N'',
   @pre_creation_cmd = N'none', @schema_option = 0x000000000803509F, @identityrangemanagementoption = N'manual',
   @destination_table = N'Table', @destination_owner = N'dbo', @status = 24, @vertical_partition = N'false',
   @ins_cmd = N'CALL [dbo].[sp_MSins_Table]', @del_cmd = N'CALL [dbo].[sp_MSdel_Table]',
   @upd_cmd = N'SCALL [dbo].[sp_MSupd_Table]'
GO
USE [PublicationDB]
EXEC sp_addsubscription @publication = N'Publication', @subscriber = N'Subscriber',
   @destination_db = N'SubscriberDB', @subscription_type = N'Push', @sync_type = N'replication support only',
   @article = N'Table', @update_mode = N'read only', @subscriber_type = 0
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search