Oracle中的用户和模式有什么区别?


当前回答

从WikiAnswers:

A schema is collection of database objects, including logical structures such as tables, views, sequences, stored procedures, synonyms, indexes, clusters, and database links. A user owns a schema. A user and a schema have the same name. The CREATE USER command creates a user. It also automatically creates a schema for that user. The CREATE SCHEMA command does not create a "schema" as it implies, it just allows you to create multiple tables and views and perform multiple grants in your own schema in a single transaction. For all intents and purposes you can consider a user to be a schema and a schema to be a user.

此外,用户可以访问除自己的模式之外的模式中的对象,如果他们有权限这样做的话。

其他回答

我在某处读到,如果您的数据库用户拥有DDL特权,那么它就是一个模式,否则它就是一个用户。

从WikiAnswers:

A schema is collection of database objects, including logical structures such as tables, views, sequences, stored procedures, synonyms, indexes, clusters, and database links. A user owns a schema. A user and a schema have the same name. The CREATE USER command creates a user. It also automatically creates a schema for that user. The CREATE SCHEMA command does not create a "schema" as it implies, it just allows you to create multiple tables and views and perform multiple grants in your own schema in a single transaction. For all intents and purposes you can consider a user to be a schema and a schema to be a user.

此外,用户可以访问除自己的模式之外的模式中的对象,如果他们有权限这样做的话。

摘自《问汤姆》

您应该将模式视为用户帐户和其中所有对象的集合 作为所有意图和目的的模式。

SCOTT是一个包含EMP、DEPT和奖金表的模式,以及各种授权 其他的东西。

SYS是一个包含大量表、视图、授权等的模式。

SYSTEM是一个模式.....

从技术上讲——模式是数据库使用的元数据(数据字典)的集合, 通常使用DDL生成。模式定义数据库的属性,例如 表、列和属性。数据库模式是数据库中数据的描述 数据库。

这很简单。

If USER has OBJECTS
then call it SCHEMA
else
     call it USER
end if;

用户可以访问不同用户拥有的模式对象。

Schema是DB的封装。对象关于一个想法/感兴趣的领域,并拥有一个用户。然后,它将由具有抑制角色的其他用户/应用程序共享。所以用户不需要拥有一个模式,但是模式需要有一个所有者。