all groups > sql server replication > july 2004 >
You're in the

sql server replication

group:

Updateable Subscriptions - I'm a little confused


Updateable Subscriptions - I'm a little confused Mike
7/14/2004 11:10:45 AM
sql server replication:
Hello.

According to BOL:

"With snapshot replication or transactional replication, replicated data is
by default read only; however, you have the ability to modify replicated
data at the Subscriber by using updateable subscriptions. If you need to
modify data at the Subscriber using snapshot or transactional replication,
you can choose one of the following options depending on your requirements."

I'm a little confused as to what "read only" really means.

Using transactional replication, I have a publication that does not "Allow
immediate updating subscriptions."

I opened up a table on the subscriber server using EM and I CAN make changes
to the replicatied tables. So does "read only" really just mean that the
changes won't be pushed back to the Publisher?

The answer is important because I am using the second, subscribing, server
as a backup server (in the event the primary server goes down). My thinking
was that I would just point my apps to the second server while the primary
server is being worked on. When the primary is fixed I planned on DTS'ing
the data back from the second server to the primary and reinitialize
replication.

All this "read only" talk is making me think that my solution won't work.

Thanks in advance,

Mike

Re: Updateable Subscriptions - I'm a little confused Mike
7/14/2004 11:28:39 AM
Hi, Paul. Thanks for responding.

I'm not sure what you mean by a couple of things you said:

1) What has to be maintained manually using permissions/roles
2) I'm not sure what you mean by "catering for deletes and updates is no
mean feat"

Could you please elaborate a little.

Thanks again,

Mike

[quoted text, click to view]

Re: Updateable Subscriptions - I'm a little confused Mike
7/14/2004 12:37:10 PM
Yes, that clears it up.

Thanks again,

Mike

[quoted text, click to view]

Re: Updateable Subscriptions - I'm a little confused Mike
7/14/2004 1:08:08 PM
Actually, Paul, I should clarify what I meant by DTS'ing.

I planned on Exporting/Importing all the data from the tables, then turning
replication back on.

[quoted text, click to view]

Re: Updateable Subscriptions - I'm a little confused Paul Ibison
7/14/2004 4:15:43 PM
Mike,
it is to be treated as Read-Only but this is not enforced by the replication
setup and has to be maintained 'manually' using permissions/roles instead.
Your methodology will work, but catering for deletes and updates is no mean
feat. An easier solution would be to use queued updating subscribers and
then run the queue reader after the problem with the primary server is
fixed. This also makes dealing with identity columns far easier.
HTH,
Paul Ibison

Re: Updateable Subscriptions - I'm a little confused Paul Ibison
7/14/2004 4:59:34 PM
Mike,

(1) the subscriber is to be treated as read-only. If a user is allowed to
access this data, he might be put into the db_datareader role and the
db_denydatawriter role to prevent him from doing anything naughty. There
have been several posts in this newsgroup where transactions fail on the
subscriber because records have been 'accidentally' modified/deleted even
though it was ostensibly used for reporting purposes etc.

(2) consider if you use "Server B" as a failover server. On failover your
users start deleting, updating and inserting records. You mentioned that you
would like to use DTS to synchronize the data with the "publisher" (server
A) when it has been fixed. On B, you'll need to find new records, and
records which have been deleted. Admittedly, this is not too difficult using
outer joins or subqueries and a linked server to A. How are you going to
know which records have been updated though? You could use binary checksums
for this, again with subqueries and the A linked server. So you'll have a
few DTS tasks for each table, which are also particular to the table. This
has to be repeated for each table in the publication.

If you use queued updating subscribers, all of this is done for you in the
replication setup - it doesn't use this methodology but results in the same
functionality though.

HTH,

Paul Ibison

Re: Updateable Subscriptions - I'm a little confused Paul Ibison
7/14/2004 7:49:23 PM
Mike,
faire enough - this is simpler. It might mean a lot of extra data which
hasn't changed will be brought back, but it is definitely more
straightforward to set up.
Cheers,
Paul

Re: Updateable Subscriptions - I'm a little confused ChrisR
7/16/2004 2:33:56 PM
[quoted text, click to view]

This of course means that you have a small enough set of
data for this to be an option? If you have lots of data
this may be tough. Plus, if you've just recovered from a
disaster, can you tell users "Yes, the Publisher is back
up, but you cant use it until I re-import ALL of the data
again"? Perhaps you can but I just thought Id throw it out
there?


[quoted text, click to view]
AddThis Social Bookmark Button