Cannot alter the role ‘db_owner’, because it does not exist or you do not have permission

So as a quick fix for me to remember, while performing and on-premises upgrade to the latest cumulative update for SharePoint 2013, I kept getting a failure. The error was related to the “SUBSCRIPTION” database only.

The actual message being displayed was found a little further down.

So you would think I just needed to change the account I was using, but then I checked I was using an account that had all the right permissions. I tried this upgrade using the “Farm Account“, “Administrator” and the core “Setup” accounts, which all had the right permissions to SQL. My “Farm Service” is only set with “dbcreator“, “public” and “securityadmin” roles, whereas the setup account has “dbcreator“, “public” and “sysadmin“.

Surely one of these accounts should have worked but every time it failed. So I checked the “SUBSCRIPTION” database and my accounts were listed as expected.

The “dbo” one is actually my setup account, tied to a “Windows Account“. Looking further into the accounts within the “SUBSCRIPTION” database I noticed that the default schema I had associated to my setup account was “dbo” so at least it had one set.

Next I checked what schema it owned and to my surprise it did not own “dbo” for this database. If fact it didn’t own any of them. So I checked “db_owner” which is the one that the upgrade was complaining about. It kind of made sense really, it could not make changes to it as the account supposedly had no permission to it, which in reality it had more than enough permissions but did not own it.

Once I set this and re-ran the upgrade command it completed successfully.

So note to self really, make sure the permissions are set as needed and the database schemas are owned by the right accounts.


Liam Cleary

Liam began his career as a Trainer of all things computer-related. He quickly realized that programming, breaking, and hacking was a lot more fun. He spent the next few years working within core infrastructure and security services until he found SharePoint. He is the founder and owner of SharePlicity, a consulting company that focuses on all areas of Technology. His role within SharePlicity is to help organizations implement technology that will enhance internal and external collaboration, document and records management, automate business processes, and of course security controls and protection. He is also a Microsoft MVP focusing on Architecture but also crosses the boundary into Development. He is also a Microsoft Certified Trainer (MCT). His specialty over the past few years has been security in SharePoint and its surrounding platforms. He can often be found at user groups or conferences speaking, offering advice, spending time in the community, teaching his kids how to code, raspberry PI programming, hacking the planet or building Lego robots.

You may also like...