`

Viewing Database Metadata

阅读更多
You've just taken on responsibility for a new database. New to you, that is -- the database has actually been running for some years. What's the first thing you want to do? If you're like me, you probably want to get a handle on just what it is that you have. What's in the database? How big is it? Who are the users and how many of them are there? The answers to all of these questions lie in the Oracle data dictionary.

Viewing Database Metadata

The data dictionary is the repository for database metadata, which is a fancy term for data describing the database. When you create a table, your description of that table is considered metadata, and Oracle stores that metadata in its data dictionary. Similarly, Oracle stores the definitions for other objects you create, such as views, PL/SQL packages, triggers, synonyms, indexes, and so forth. The database software uses this metadata to interpret and execute SQL statements, and to properly manage stored data. You can use the metadata as your window into the database. Whether you're a DBA or a developer, you need a way to learn about the objects and data within your database.

Codd's fourth rule for relational database systems states that database metadata must be stored in relational tables just like any other type of data. Oracle exposes database metadata through a large collection of data dictionary views. Does this violate Codd's rule? By no means! Oracle's data dictionary views are all based on tables, but the views provide a much more user-friendly presentation of the metadata. For example, to find out the names of all of the relational tables that you own, you can issue the following query:

SELECT table_name
FROM user_tables;

Note the prefix user_ in this example. Oracle divides data dictionary views into the three families, as indicated by the following prefixes:

    * USER_

      USER views return information about objects owned by the currently-logged-on database user. For example, a query to USER_TABLES returns a list of all of the relational tables that you own.
    * ALL_

      ALL views return information about all objects to which you have access, regardless of who owns them. For example, a query to ALL_TABLES returns a list not only of all of the relational tables that you own, but also of all relational tables to which their owners have specifically granted you access (using the GRANT command).
    * DBA_

      DBA views are generally accessible only to database administrators, and return information about all objects in the database, regardless of ownership or access privileges. For example, a query to DBA_TABLES will return a list of all relational tables in the database, whether or not you own them or have been granted access to them. Occasionally, database administrators will grant developers access to DBA views. Usually, unless you yourself are a DBA, you won't have access to the DBA views.

Many views have analogs in all three groups. For example, you have USER_TABLES, ALL_TABLES, and DBA_TABLES. A table is a schema object, and thus owned by a user, hence the need for USER_TABLES. Table owners can grant specific users access to their tables, hence the need for ALL_TABLES. Database administrators need to be aware of all tables in the database, hence the need for DBA_TABLES. In some cases, it doesn't make sense for a view to have an analog in all groups. There is no USER_DIRECTORIES view, for example, because directories are database objects not owned by any one user. However, you will find an ALL_DIRECTORIES view to show you the directories to which you have access, and you will find a DBA_DIRECTORIES view to show the database administrator a list of all directories defined in the database.

Oracle's data dictionary views are mapped onto underlying base tables, but the views form the primary interface to Oracle's metadata. Unless you have specific reasons to go around the views directly to the underlying base tables, you should use the views. The views return data in a much more understandable format than you'll get from querying the underlying tables. In addition, the views make up the interface that Oracle documents and supports. Using an undocumented interface, i.e. the base tables, is a risky practice.
分享到:
评论

相关推荐

    Database explorer for viewing all tables and queries in a da

    Database explorer for viewing all tables and queries in a database. Also includes an SQL editor similar to SQL Query Analyzer.

    database viewer

    Universal database tool with report builder. Viewing, editing, and printing data; building SQL queries; building reports; sorting and filtering; viewing and printing structure; searching and replacing...

    Oracle Database 11g Oracle In-Memory Database Installation Guide

    Oracle Database 11g Oracle In-Memory Database Installation Guide 和 Oracle System Monitoring Plug-in for Oracle TimesTen In-Memory Database Installation Guide 提供了关于如何安装、配置和监控Oracle ...

    Flexible Camera Calibration By Viewing a Plane From Unknown Orientations课件

    在"Flexible Camera Calibration By Viewing a Plane From Unknown Orientations"中,主要探讨了相机模型的灵活性以及在不同未知方向下对相机进行校准的方法。 1. **透视变换** 摄像头模型基于透视原理,即三维...

    flexible camera calibration by viewing a plane from unknown orientations_张正友

    《Flexible Camera Calibration by Viewing a Plane from Unknown Orientations》是由微软研究院的张正友博士发表的一篇关于摄像机标定的重要论文。该方法是一种新颖且灵活的技术,旨在简化摄像机标定的过程。与传统...

    Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix.pdf

    本文档介绍了一种快速准确地从世界、视图与投影(World-View-Projection, WVP)矩阵中提取视锥体(Viewing Frustum)平面的方法。这种方法在游戏开发和其他三维图形应用领域非常实用,能够有效提高渲染效率,减少...

    Database.Tour.Pro.v.6.5.4.1201

    convenient viewing and editing data; using SQL with support of multi-statement scripts; exporting data from open table or query to large number of file formats like text, CSV, HTML, XLS, XML, RTF, ...

    The Art of SQL

    Faroult's approach takes a page from Sun Tzu's classic treatise by viewing database design as a military campaign. You need knowledge, skills, and talent. Talent can't be taught, but every strategist...

    Wide-viewing-angle integral three-dimensional imaging

    ### 宽视角积分三维成像技术 #### 一、引言与背景 本文介绍了一种通过弯曲屏幕和透镜阵列实现的宽视角积分三维(3D)成像系统。该技术采用柔性屏幕和曲面透镜阵列代替传统的平面显示面板和平面透镜阵列。...

    Spectral Core Full Convert Enterprise v6.11.0.1683

    Migrate your database effortlesly. Copy all your table data, indexes, foreign keys - and more. When you need the power: migration of huge tables (> 500 GB) unmatched customization features ...

    Flexible Camera Calibration By Viewing a Plane From Unknown Orientations

    ### 灵活相机校准方法:通过观察未知方向的平面 #### 摘要与背景 本文介绍了一种灵活的新型相机校准技术,该技术仅需相机观测到一个处于不同位置(至少两个)的平面图案即可实现。无论是移动相机还是平面图案本身...

    DataBase Viewer is a program that lets you to look at your d

    DataBase Viewer is a program that lets you to look at your database files. It opens the recordsets in a table for easy viewing and also has a percents and progress bar to show the exact loading ...

    Viewing e.Reports

    根据提供的文件信息,我们可以推断出“Viewing e.Reports”是关于如何查看或操作名为e.Reports的软件产品中的报告。尽管文档中没有提供具体的使用指南或技术细节,但可以基于上下文推测出一些关键知识点。 ### 一、...

    postman parsing data viewing

    在“Postman parsing data viewing”这个主题中,我们将深入探讨如何使用Postman解析和查看数据。解析数据是理解API响应的关键步骤,它允许我们有效地处理和分析返回的信息。 1. **数据解析的基本概念** - 数据...

    Uploading and Viewing Files the Easy Way

    "Uploading and Viewing Files the Easy Way" 这个主题聚焦于简化这一过程的技术和最佳实践。我们将探讨如何实现高效、安全且用户体验良好的文件上传与查看功能。 首先,上传功能的核心在于前端和后端的交互。前端...

    react-native-image-viewing:用于查看图像的微小的纯TS模式组件:cityscape:

    React本机图像查看React Native模态组件,用于以滑动画廊的形式查看图像。...viewing 要么npm install --save react-native-image-viewing用法import ImageView from " react-native-image-viewing " ;co

    Viewing_Image:来自相机目录的应用程序视图图像

    "Viewing Image: 来自相机目录的应用程序视图图像"这个标题暗示了我们要讨论的是如何在Android应用中显示从相机目录获取的图片。在描述中提到了"android application tugas",这可能是印尼语中的"任务"或"作业",...

    Viewing angle-enhanced integral imaging system using three lens arrays

    Compared with the conventional integral imaging system, the proposed system can remarkably enhance the viewing angle. The maximum viewing angle can be enlarged to 48o, which is 4.8 times wider than ...

    Viewing PCX files查看PCX文件(69KB)

    标题中的“Viewing PCX files”指的是学习如何查看或处理PCX格式的图像文件。PCX,全称为Paintbrush File Format,是由ZSoft Corporation开发的一种早期的位图图像格式,广泛用于DOS时代。现在虽然不如JPEG、PNG等...

Global site tag (gtag.js) - Google Analytics