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


当前回答

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

其他回答

对于大多数更熟悉MariaDB或MySQL的人来说,这似乎有点令人困惑,因为在MariaDB或MySQL中,它们有不同的模式(包括不同的表、视图、PLSQL块和DB对象等),而USERS是可以访问这些模式的帐户。因此,没有特定的用户可以属于任何特定的模式。权限必须被授予该模式,然后用户才能访问它。在MySQL和MariaDB等数据库中,用户和模式是分开的。

在Oracle模式中,用户几乎被视为相同的。要使用该模式,您需要有权限,因此您会觉得模式名只是用户名。可以跨模式授予权限,以便从不同模式访问不同的数据库对象。在oracle中,我们可以说一个用户拥有一个模式,因为当你创建一个用户时,你为它创建了DB对象,反之亦然。

模式是对象的容器。 它由用户拥有。

从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特权,那么它就是一个模式,否则它就是一个用户。

基于我对甲骨文的一点了解…USER和SCHEMA有些相似。但也有一个主要的区别。如果“USER”拥有任何对象,则可以将其称为SCHEMA,否则…它将只保留为“USER”。一旦USER拥有至少一个对象,那么根据上面的所有定义....USER现在可以称为SCHEMA。