all groups > sql server replication > august 2006 >
You're in the

sql server replication

group:

Alter View in Replicated Database


Alter View in Replicated Database EoRaptor013
8/30/2006 8:54:31 AM
sql server replication: Does anybody know of an example script to quiesce a peer-to-peer
replication, alter a view, make sure the alterations are propagated and
re-activate the replication?

I gather I have to execute sp_requestpeerresponse and
sp_helppeerresponse, then alter the table. Trying to build up to the
correct solution, I started by just executing the two stored
procedures:

declare
@rq_id int

exec sp_requestpeerresponse
@publication = 'EnduranceProd20060821',
@request_id = @rq_id

exec sp_helppeerresponses
@request_id = @rq_id

The result set from sp_helppeerresponses, however, is consistently
empty. As I read it, this means that I didn't get any responses from
the other servers in the peer-to-peer replication. Yet, replication is
working just fine, I have less than 5 seconds latency, and I can insert
trace tokens from SQL Management Studio with 5 second response or less.
So, what am I doing wrong?

Also, this is a very nasty table; there's a case statement with nearly
200 clauses in it to capture a set of business rules. A SQL query
created from the view definition runs in 10 or 15 seconds but the last
time I tried to alter this table, while it was included in replication,
timed out after 8 hours! Makes me think something is not right.

Any thoughts on either issues would be greatly appreciated.

Randy
Re: Alter View in Replicated Database Hilary Cotter
8/31/2006 10:08:58 PM
I've fought with this on and off for the past couple of days. I think you
need to replicate schema objects using snapshot replication as this type of
replication will replicate schema changes to schema objects each time the
agent runs.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

Re: Alter View in Replicated Database EoRaptor013
9/2/2006 10:34:06 AM
[quoted text, click to view]

Thank you for looking into it.

Does peer-to-peer replication even use snapshots? Seems like I read an
MS white paper that says peer-to-peer needs more info than available in
a snapshot and, because of the peer-to-peer topology, a snapshot isn't
useful. If I can track the paper down, I'll post it.

In any event. I was able to manage it through Management Studio but it
was waaay ugly. In the replication monitor, I stopped distribution for
each publisher. Then I opened the properties for each publisher and
dropped the view. I then re-enabled distribution and let the system run
until there were no more transactions listed in the monitor. Then I
altered the view on all three publishers -- manaully. I again stopped
distribution on all servers, added the view back into the publication,
and restarted the distributors. IMHO, this just isn't the way to do it!


I've been wrong in my interpretation of the BOL plenty of times before
but I'm convinced that it says you can directly make schema changes:
http://msdn2.microsoft.com/en-us/library/ms146867.aspx

Again, thanks.
Re: Alter View in Replicated Database Hilary Cotter
9/2/2006 3:48:22 PM
You can put it in place manually or restore the publisher from a backup.
Check out http://msdn2.microsoft.com/en-us/library/ms151196.aspx for more
info. Specifically -


I agree with your reading of BOL, but I could not get the alter view
statement to be propagated.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

Re: Alter View in Replicated Database Hilary Cotter
9/2/2006 3:48:54 PM
Sorry the reply posted prematurely - here is the section I was referring to.

a.. Subscriptions must be initialized using a backup or with the
'replication support only' option. For more information, see Initializing a
Transactional Subscription Without a Snapshot.


--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

AddThis Social Bookmark Button