Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Reassigning the ownership of db_owner Expand / Collapse
Author
Message
Posted Wednesday, June 24, 2009 9:22 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, June 20, 2014 8:23 AM
Points: 738, Visits: 1,305
We're recently purchased some new software, which requires its own SQL Server database. Working with the vendor they also needed to have a new SQL account created which would be a part of the db_owner database role membership. Creating new SQL accounts isn't something we do often (I cannot remember when I last created a new SQL account), so I made a mistake when I set the new user up. Here's what happened:

First, I created the new database. After setting it up, assigning the .mdf and .ldf files to their appropriate places, I then created the new SQL account, and in the property page for creating the new user, I checked db_owner under the "Schemas owned by this user", rather than "Database role membership".

Later I realized my mistake, but I'm not sure how to fix it. First of all, what account normally has ownership of the db_owner schema? I would assume it would be the sa account, especially for a new database like this one, but I want to ask anyway.

Second, how do I reassign the db_owner schema from this new SQL account to the account it should really be owned by?


Kindest Regards,

Rod
Connect with me on LinkedIn.
Post #741135
Posted Wednesday, June 24, 2009 10:11 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 1:03 PM
Points: 4,064, Visits: 5,317
Usually, the fixed database roles are owned by dbo. Check the properties of some of the other roles in the database e.g. db_securityadmin, db_ddladmin, etc. You can change the owner of a role by opening the properties of the role in object browser and either typing in the new owner or clicking on the elipse and choosing the new owner from the list.

Greg
Post #741170
Posted Wednesday, June 24, 2009 10:20 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, July 30, 2014 9:45 AM
Points: 518, Visits: 1,013
The default owner of the db_owner Schema is dbo. Use this to change it back.
USE [DatabaseName]
GO
ALTER AUTHORIZATION ON SCHEMA::[db_owner] TO [dbo]
GO
Post #741181
Posted Wednesday, June 24, 2009 12:59 PM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, June 20, 2014 8:23 AM
Points: 738, Visits: 1,305
Thank you Greg and Kenneth, that did the trick for me.


Kindest Regards,

Rod
Connect with me on LinkedIn.
Post #741299
Posted Wednesday, May 7, 2014 7:55 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, May 12, 2014 3:44 PM
Points: 20, Visits: 65
Hi there. I have a user I could not delete because they were a db_owner. I used the following alter statement and after that was able to delete them. The statement was as follows:

ALTER AUTHORIZATION ON SCHEMA::db_owner TO dbo;

My question is should it be the following below:

ALTER AUTHORIZATION ON SCHEMA::db_owner TO dbo_owner;

Thanks for your help
Post #1568740
Posted Thursday, May 8, 2014 10:57 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, July 30, 2014 9:45 AM
Points: 518, Visits: 1,013
You are correct. It should be dbo not db_owner. I'll update my earlier post.

Thanks!
Post #1569026
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse