The difference between dbo and db_owner

Source: Internet
Author: User

The dbo is a user with implied permissions to perform all activities in the database. Maps any member of the sysadmin fixed server role to a particular user within each database called dbo. In addition, any objects created by any member of the sysadmin fixed server role automatically belong to the dbo.

For example, if the user Andrew is a member of the fixed server role sysadmin and creates the table T1, the table T1 belongs to the dbo and to the dbo. T1 instead of andrew.t1 to qualify. Conversely, if Andrew is not a member of the fixed server role sysadmin, but only a member of the db_owner database role, and the table T1 is created, T1 belongs to Andrew and is limited to ANDREW.T1. The table belongs to Andrew because the member does not qualify the table as dbo. T1.

The dbo user cannot be deleted, and this user always appears in each database.

Only objects created by members of the sysadmin fixed server role (or dbo users) belong to the dbo. An object created by any other user (including members of the db_owner fixed database role) that is not a member of the Syadmin fixed server role: The user who created the object, not the DBO, which is qualified with the user name that created the object

Users with the database db_owner role will be able to see and manipulate objects for all schemas under the database

If a user has db_owner permissions on the database, the user will be able to manipulate all of the schema objects under the database (that is, all tables, views, stored procedures, and so on in the database, which can be seen and manipulated by users with db_owner privileges), if a user does not have db_ Owner permission, the user will only see the database object that the user owns the schema for.

To illustrate this, let me cite an example where there is a user named Max in the database that does not have any schema for the database Dw_demo:

But he has the db_owner role permissions for the database:

After using Max to log into the database Dw_demo, he can see and manipulate objects such as tables of all schemas (you can see that in Max you can see all the tables in the db_owner schema and the DBO schema, but he does not own the two schemas):

Next we use the database administrator account to cancel user Max's permissions in the database Dw_demo db_owner:

And then use Max to log into the database Dw_demo, now found that he can see nothing, the reason is now he lost the database Dw_demo db_owner permissions:

The difference between dbo and db_owner

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.