关系数据库中的目录和模式有什么区别? [英] What's the difference between a catalog and a schema in a relational database?

查看:21
本文介绍了关系数据库中的目录和模式有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经认为架构是数据库本身之前的上层包装"对象.我的意思是 DB.schema..

I used to think schema were the "upper wrapper" object before the database itself. I mean DB.schema.<what_ever_object_name_under_schema>.

嗯,目录包装器"现在很混乱.为什么我们需要目录?目录究竟应该用于什么目的?

Well, the catalog "wrapper" is now quite confusing. Why should we need a catalog? For what purpose, precisely should the catalog be used?

推荐答案

从关系的角度来看:

目录是保存所有各种模式(外部、概念、内部)和所有相应映射(外部/概念、概念/内部)的地方.

The catalog is the place where--among other things--all of the various schemas (external, conceptual, internal) and all of the corresponding mappings (external/conceptual, conceptual/internal) are kept.

换句话说,目录包含有关系统本身感兴趣的各种对象的详细信息(有时称为描述符信息元数据).

In other words, the catalog contains detailed information (sometimes called descriptor information or metadata) regarding the various objects that are of interest to the system itself.

例如,优化器使用有关索引和其他物理存储结构的目录信息以及许多其他信息来帮助它决定如何实现用户请求.同样,安全子系统首先使用有关用户和安全约束的目录信息来授予或拒绝此类请求.

For example, the optimizer uses catalog information about indexes and other physical storage structures, as well as much other information, to help it decide how to implement user requests. Likewise, the security subsystem uses catalog information about users and security constraints to grant or deny such requests in the first place.

数据库系统简介,第 7 版,C.J. Date,第 69-70 页.<小时>从SQL标准来看:

An Introduction to Database Systems, 7th ed., C.J. Date, p 69-70.


From the SQL standard point of view :

目录是 SQL 环境中模式的命名集合.一个SQL 环境包含零个或多个目录.一个目录包含一个或多个模式,但总是包含一个名为INFORMATION_SCHEMA 包含视图和域信息架构.

Catalogs are named collections of schemas in an SQL-environment. An SQL-environment contains zero or more catalogs. A catalog contains one or more schemas, but always contains a schema named INFORMATION_SCHEMA that contains the views and domains of the Information Schema.

数据库语言 SQL,(建议修订文本DIS 9075),第 45 页<小时>从 SQL 的角度来看:

Database Language SQL, (Proposed revised text of DIS 9075), p 45


From the SQL point of view :

目录通常与数据库同义.在大多数 SQL dbms 中,如果您查询 information_schema 视图,您会发现table_catalog"列中的值映射到数据库的名称.

A catalog is often synonymous with database. In most SQL dbms, if you query the information_schema views, you'll find that values in the "table_catalog" column map to the name of a database.

如果您发现您的平台使用目录比这三个定义中的任何一个都更广泛,那么它可能指的是比数据库更广泛的东西——数据库集群、服务器或服务器簇.但我对此表示怀疑,因为您很容易在平台的文档中找到这一点.

If you find your platform using catalog in a broader way than any of these three definitions, it might be referring to something broader than a database--a database cluster, a server, or a server cluster. But I kind of doubt that, since you'd have found that easily in your platform's documentation.

这篇关于关系数据库中的目录和模式有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆