简体   繁体   English

SQL Server 2012 - 将模式的所有权分配给用户的目的是什么?

[英]SQL Server 2012 - What is the purpose of assigning ownership of a schema to a user?

Microsoft's docs on schema ownership don't go beyond saying "Schemas can be owned by any database principal, and a single principal can own multiple schemas." 微软关于模式所有权的文档不仅仅是说“模式可以由任何数据库主体拥有,而且单个主体可以拥有多个模式。” ( MSDN doc ) MSDN doc

I get that schemas are a way of containing different security permissions, but what is the purpose of assigning an owner to a schema and what special privileges does that user who owns the schema receive as opposed to simply being a member of the schema? 我得到的模式是一种包含不同安全权限的方式,但是将所有者分配给模式的目的是什么,拥有模式的用户接收哪些特权而不是简单地成为模式的成员?

An owner of a schema is like the sysadmin within that schema, can create , drop, select , update, delete , alter objects, give permissions to other users , revoker permissions of other users and pretty much everything . 模式的所有者就像该模式中的sysadmin,可以创建,删除,选择,更新,删除,更改对象,为其他用户授予权限,其他用户的revoker权限以及几乎所有内容。

On the other hand a user with in a schema can only do the operations according to what database role was given to them , for example will be assigned these permission as Permission to create objects, db_datareader can only issue select statements against tables, db_datawriter can do inserts/updates and the list goes on. 另一方面,具有模式的用户只能根据给予他们的数据库角色来执行操作,例如将这些权限分配为创建对象的权限,db_datareader只能对表发出select语句,db_datawriter可以做插入/更新,列表继续。

You dont want every user who has access to database to do all sorts of operations, some people will have less access some will requires more access, hence the different roles to suit user specific needs. 您不希望每个有权访问数据库的用户执行各种操作,有些人访问较少,有些人需要更多访问权限,因此不同的角色可以满足用户的特定需求。

Ownership of schema has it roots with the problem we had in past before sql server 2005 when there were no schemas and objects were owned by users. 架构的所有权源于我们在sql server 2005之前遇到的问题,当时没有架构和对象归用户所有。 To separate users from objects schemas were introduced and the concept of "Schema Ownership" was introduced, it is just another way of saying that this user has all the permissions in a schema. 为了将用户与对象分开,引入了模式并引入了“模式所有权”的概念,这只是另一种说法,即该用户拥有模式中的所有权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM