Friday, July 1, 2011
Avoid losing Permissions When Subscription is REINITIALIZED
You must have experienced this scenario several times that whenever a snapshot is reinitialized it loses all the granted permissions.
So what can be done to avoid this? Well there are two ways you can handle this scenario:
Please note: By default, all the objects in the subscription database are dropped and recreated whenever subscription is reinitialized.
1) You can re-apply all the permissions after the re-initialization. I recommend that when you setup the permissions manually, you script out all the object/statement level permissions and store it separately so that you can use it right after you reinitialize subscription.
2) You can configure your subscription so that it does not drop any objects whenever you reinitialize subscription.
You can use SP_CHANGEARTICLE system stored procedure to configure the value of PRE_CREATION_CMD for the parameter @PROPERTY and a value of 'NONE','DELETE' or 'TRUNCATE' for the parameter @Value.
Also, in the Article Properties dialog box in the destination object section, select a value of "KEEP EXISTING OBJECT UNCHANGED, DELETE DATA"
"IF ARTICLE HAS A ROW FILTER, DELETE ONLY THAT MATCHES THE FILTER"
"TRUNCATE ALL DATA IN THE EXISTING OBJECT"
You much test this in your test environment and go thru the latest BOL for up-to-date information.
Credits to H.S our SQL Hero.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment