Warning: Constant WP_TEMP_DIR already defined in /var/www/html/blogs/joe/wp-config.php on line 93

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902
{"id":512,"date":"2012-01-25T01:36:00","date_gmt":"2012-01-25T01:36:00","guid":{"rendered":"\/blogs\/joe\/post\/When-is-the-Publication-Access-List-required.aspx"},"modified":"2013-01-02T20:36:33","modified_gmt":"2013-01-03T04:36:33","slug":"when-is-the-publication-access-list-required","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/","title":{"rendered":"When is the Publication Access List required?"},"content":{"rendered":"

\nUpdate: ** Make sure to check out the comments at the end of this post.  There are some interesting differences in behavior between transactional replication (pull\/push subscribers) versus merge replication's behavior.  **<\/em> <\/font><\/font>\n<\/p>\n

\nYesterday I was working on implementing transactional replication with the goal of limiting the permissions each replication account ran under.  <\/span>I created three separate domain accounts for the snapshot, log reader and distribution agents.  <\/span>These accounts had no other permissions before I began:<\/font><\/font>\n<\/p>\n

\n·<\/font><\/font>        <\/font><\/font><\/span><\/span><\/span>I created logins on the publisher and distributor (in this case, the same SQL Server instance) and I added the snapshot and log reader agent accounts to the db_owner role of the distribution and publisher databases.<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\n·<\/font><\/font>        <\/font><\/font><\/span><\/span><\/span>This was a push subscription, so I also added the distribution agent to the db_owner role for the distribution database, but I did not <\/em>grant it access to the publication database.  <\/span>I did make the distribution agent a member of db_owner for the subscription database (which was located on a separate server and default instance).<\/font><\/font>\n<\/p>\n

\n·<\/font><\/font>        <\/font><\/font><\/span><\/span><\/span>I gave the snapshot agent “write” permissions and the distribution agent “read” permissions to the snapshot share.<\/font><\/font>\n<\/p>\n

\nBy the way, all this talk of db_owner makes it sound like I wasn’t limiting permissions all that much; however this fixed database role membership is indeed a minimum requirement in this implementation.  <\/span>It’s also typically more restrained then what I’ve seen out in the field. Usually I’ll see the use of domain accounts with sysadmin used to manage everything<\/em> in the replication topology.  <\/span>I don’t usually see a separate set of accounts configured for each agent role, nor do I see them set up for each unique topology (for very large environments, the administrative overhead may not make this a practical choice – but that’s another discussion altogether).<\/font><\/font>\n<\/p>\n

\nI did leave out one step though – and I’ll get to that in a moment.  <\/span>After applying the permissions I described, I set up the new publication and new subscription, and the data flowed correctly with no issues and no sysadmin permissions required.<\/font><\/font>\n<\/p>\n

\nThe step I specifically left out was the adding of the distribution agent to the Publication Access List (PAL).  <\/span>According to Books Online, “Access to a publication is controlled by the publication access list (PAL)<\/em>.”  <\/span>Also according to Books Online, the distribution agent for a push subscription must “Be a member of the PAL<\/em>.”  <\/span>I wondered why? And if this is such a key area – why don’t we hear much discussion of the PAL?  <\/span>If you search the replication forums, you’ll find very few questions about it (searching today, I found 26 loosely related threads).  <\/span>Either this means that most shops use high privilege accounts and haven’t pushed further to find out the role of PAL – or the PAL role isn’t entirely what it seems to be (as its described, it seems to suggest that the distribution agent account needs membership in order to synchronize).<\/font><\/font>\n<\/p>\n

\nNow if it must<\/em> be a member, why was transaction replication working properly (rows were moving fine from publisher to distributor and distributor to subscriber).<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\nMy first assumption was that I missed something or that somehow the distribution agent account was getting implied permissions either through group membership.<\/font><\/font>\n<\/p>\n

\nThe first thing I validated was the current PAL list of accounts (looking explicitly for my distribution agent account – called SQLskills\\SQLskillsDistAGT).  <\/span>Looking at the PAL, this account had NOT been explicitly granted membership somehow through other activities:<\/font><\/font>\n<\/p>\n

\n\"clip_image002\"<\/a><\/span>\n<\/p>\n

\nPerhaps SQLskills\\SQLskillsDistAGT was gaining access through group membership?  <\/span>Seemed unlikely to me, but I checked nonetheless by using EXECUTE AS LOGIN and querying the sys.login_token to see the groups associated with that account:<\/font><\/font>\n<\/p>\n

\n\"clip_image004\"<\/a><\/span>\n<\/p>\n

\nI didn’t see any connections or group memberships that would map to the PAL.<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\nMy next thought was to examine the SQL Server Agent job and ensure it really was running under the context of SQLskills\\SQLskillsDistAGT. The SQL Server Agent Job for the distribution agent was owned by the Administrator account, but<\/em> the job step itself was running as the SQLskills\\SQLskillsDistAGT proxy:<\/font><\/font>\n<\/p>\n

\n\"clip_image006\"<\/a><\/span>\n<\/p>\n

\nThe proxy maps to a security credential, which in this case was my SQLskills\\SQLskillsDistAGT account.  <\/span>I validated the mapping by querying sys.credentials (checking the credential_identity column):<\/font><\/font>\n<\/p>\n

\n\"clip_image008\"<\/a><\/span>\n<\/p>\n

\nSo the mapping was what I expected.<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\nBut was the job really connected as that account?  <\/span>I ran a few test transactions at the publisher and again confirmed that rows were flowing to the subscriber.  <\/span>I then queried sys.dm_exec_sessions for the distribution agent session, checking the login name and running a few times to ensure it was incrementing the logical reads:<\/font><\/font>\n<\/p>\n

\n\"clip_image010\"<\/a><\/span>\n<\/p>\n

\nLogical reads were incrementing and the job was indeed running under the account.<\/font><\/font>\n<\/p>\n

\nSo where are we?  <\/span>Basically, I could find no connection whatsoever between the PAL membership and my distribution agent account.<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\nSo because I wanted to be absolutely sure (and because this was a test environment) I removed all <\/em>accounts from the PAL (including “sa”).  <\/span>I did so one-by-one, testing to see if it broke replication.  <\/span>And guess what?  <\/span>Replication just kept on working.  <\/span>I even restarted the agents to see if it would initiate some kind of challenge-response, and it did not.<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\nSo is PAL access required?  <\/span>And if so, what is the boundary of that requirement?<\/font><\/font>\n<\/p>\n

\nI logged off of my Administrator account and logged in to the publisher\/distributor SQL Server instance as the SQLskills\\SQLskillsDistAGT.  <\/span>I then opened up SSMS and looked to see if I could view the publication:<\/font><\/font>\n<\/p>\n

\n\"clip_image012\"<\/a><\/span>\n<\/p>\n

\nNo publications to be seen<\/font><\/em>, even though this account is actually responsible for running the distribution agent and is doing so successfully.<\/font><\/font>\n<\/p>\n

\nI then jumped back on my Administrator account and first added SQLskills\\SQLskillsDistAGT to the public role of the publication database (required in order to be seen in PAL) and then I added SQLskills\\SQLskillsDistAGT to the PAL:<\/font><\/font>\n<\/p>\n

\n\"clip_image014\"<\/a><\/span>\n<\/p>\n

\n\"clip_image016\"<\/a><\/span>\n<\/p>\n

\nAfter doing this, I logged aback in as the distribution agent account, and sure enough, I can now “see” the publication (and also launch a new subscription, more importantly).<\/font><\/font>\n<\/p>\n

\n\"clip_image018\"<\/a><\/span>\n<\/p>\n

\nSo this now made sense why PAL wasn’t the talk of the town.  <\/span>Most DBAs I’ve worked with set up replication with their own high privilege credentials – even when designating other credentials for the replication agents.  <\/span>Once they do, the agents work as advertised.  <\/span>It’s when the agent account wishes to participate independently of the DBA that the PAL helps restrict the visibility of available publications.<\/font><\/font>\n<\/p>\n

\nIf you’ve seen other variations or even contradictions related to the PAL – I’d love to hear about it.  <\/span>We can help flesh out some of the ambiguities around this feature on this post.<\/font><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"

Update: ** Make sure to check out the comments at the end of this post.  There are some interesting differences in behavior between transactional replication (pull\/push subscribers) versus merge replication's behavior.  **  Yesterday I was working on implementing transactional replication with the goal of limiting the permissions each replication account ran under.  I created three […]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-512","post","type-post","status-publish","format-standard","hentry","category-replication"],"yoast_head":"\nWhen is the Publication Access List required? - Joe Sack<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"When is the Publication Access List required? - Joe Sack\" \/>\n<meta property=\"og:description\" content=\"Update: ** Make sure to check out the comments at the end of this post.  There are some interesting differences in behavior between transactional replication (pull\/push subscribers) versus merge replication's behavior.  **  Yesterday I was working on implementing transactional replication with the goal of limiting the permissions each replication account ran under.  I created three […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/\" \/>\n<meta property=\"og:site_name\" content=\"Joe Sack\" \/>\n<meta property=\"article:published_time\" content=\"2012-01-25T01:36:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-01-03T04:36:33+00:00\" \/>\n<meta name=\"author\" content=\"Joseph Sack\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joseph Sack\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/\",\"name\":\"When is the Publication Access List required? - Joe Sack\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#website\"},\"datePublished\":\"2012-01-25T01:36:00+00:00\",\"dateModified\":\"2013-01-03T04:36:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Replication\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/category\/replication\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"When is the Publication Access List required?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/\",\"name\":\"Joe Sack\",\"description\":\"SQL Server Performance Tuning, High Availability and Disaster Recovery Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648\",\"name\":\"Joseph Sack\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g\",\"caption\":\"Joseph Sack\"},\"description\":\"Joe Sack is a Principal Consultant with SQLskills. He has worked as a SQL Server professional since 1997 and has supported and developed for SQL Server environments in financial services, IT consulting, manufacturing, retail and the real estate industry. Prior to joining SQLskills he worked at Microsoft as a Premier Field Engineer supporting very large enterprise customer environments. He was responsible for providing deep SQL Server advisory services, training, troubleshooting and ongoing solutions guidance. His areas of expertise include performance tuning, scalability, T-SQL development and high-availability. In 2006 Joe earned the \u201cMicrosoft Certified Master: SQL Server 2005\u201d certification and in 2008 he earned the \u201cMicrosoft Certified Master: SQL Server 2008\u201d certification. In 2009 he took over responsibility for the entire SQL Server Microsoft Certified Master program and held that post until 2011. He was given the SQL Server MVP award in 2013.\",\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/joe\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/josephsack\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/author\/joe\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"When is the Publication Access List required? - Joe Sack","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/","og_locale":"en_US","og_type":"article","og_title":"When is the Publication Access List required? - Joe Sack","og_description":"Update: ** Make sure to check out the comments at the end of this post.  There are some interesting differences in behavior between transactional replication (pull\/push subscribers) versus merge replication's behavior.  **  Yesterday I was working on implementing transactional replication with the goal of limiting the permissions each replication account ran under.  I created three […]","og_url":"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/","og_site_name":"Joe Sack","article_published_time":"2012-01-25T01:36:00+00:00","article_modified_time":"2013-01-03T04:36:33+00:00","author":"Joseph Sack","twitter_misc":{"Written by":"Joseph Sack","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/","url":"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/","name":"When is the Publication Access List required? - Joe Sack","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#website"},"datePublished":"2012-01-25T01:36:00+00:00","dateModified":"2013-01-03T04:36:33+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/when-is-the-publication-access-list-required\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/joe\/"},{"@type":"ListItem","position":2,"name":"Replication","item":"https:\/\/www.sqlskills.com\/blogs\/joe\/category\/replication\/"},{"@type":"ListItem","position":3,"name":"When is the Publication Access List required?"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/joe\/","name":"Joe Sack","description":"SQL Server Performance Tuning, High Availability and Disaster Recovery Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/joe\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648","name":"Joseph Sack","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g","caption":"Joseph Sack"},"description":"Joe Sack is a Principal Consultant with SQLskills. He has worked as a SQL Server professional since 1997 and has supported and developed for SQL Server environments in financial services, IT consulting, manufacturing, retail and the real estate industry. Prior to joining SQLskills he worked at Microsoft as a Premier Field Engineer supporting very large enterprise customer environments. He was responsible for providing deep SQL Server advisory services, training, troubleshooting and ongoing solutions guidance. His areas of expertise include performance tuning, scalability, T-SQL development and high-availability. In 2006 Joe earned the \u201cMicrosoft Certified Master: SQL Server 2005\u201d certification and in 2008 he earned the \u201cMicrosoft Certified Master: SQL Server 2008\u201d certification. In 2009 he took over responsibility for the entire SQL Server Microsoft Certified Master program and held that post until 2011. He was given the SQL Server MVP award in 2013.","sameAs":["http:\/\/3.209.169.194\/blogs\/joe","https:\/\/twitter.com\/https:\/\/twitter.com\/josephsack"],"url":"https:\/\/www.sqlskills.com\/blogs\/joe\/author\/joe\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts\/512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/comments?post=512"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts\/512\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/media?parent=512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/categories?post=512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/tags?post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}