首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > 1Z031第五章
【标  题】:1Z031第五章
【关键字】:1Z031
【来  源】:http://www.cublog.cn/u/17227/showart.php?id=111218

1Z031第五章

1Z031第五章数据字典的内容和使用

本章学习目标

理解data dictionary的关键组件。

理解data dictionary的内容和使用方法

查询data dictionary

一、数据字典

数据字典是在数据库创建的时候,ORACLE SERVER在数据文件中创建的附加对象结构。包括

数据字典表

动态性能表

数据字典是一系列只读的表和视图,记录、区分、和提供数据库相关信息。主要作用

记录数据库以及其对象

包括2种类型的对象

1、基本表

存放数据库的描述信息

create database 的同时创建的

2、数据字典视图

汇总基本表的信息

通过运行catalog.sql脚本创建

Base Tables: Underlying tables, which store information about the database. The base tables are the first objects created in any Oracle database. They are automatically created when the Oracle server runs the sql.bsq script at the time the database is created. Only the Oracle server should write to these tables. Users rarely access them directly, because most of the data is stored in a cryptic format. Never use DML commands to update the base tables directly, with the exception of the AUD$ table

Data Dictionary Views: Base table summaries, which provide for a more useful display of base table information. For example, in the data dictionary views, object names are used

instead of only object numbers. The data dictionary views are created using the catalog.sql script.

数据字典的内容包括

逻辑和物理的数据库结构

数据库对象定义和分配的空间

一致性的约束

用户

角色

权限

验证

 

 

如何使用数据字典、数据字典的作用

数据库使用它来查找以下信息:

   用户

   schema对象

   存储结构

oracle服务器当运行一个DDL语句的时候会修改相应的database dictionary

用户和DBA可以把数据字典当作只读的数据库信息的参考                     

 

数据字典视图目录

数据字典有三类主要视图类别分别是

DBA:包括所有的schema,数据库中所有对象

ALL: 普通用户可以使用的,包括所有当前用户可以访问的对象

USER:在某个用户schema内的,当前用户所有的对象

访问只需要和普通的表、视图一样访问就可以了。

SELECT owner, object_name, object_type

FROM dba_objects;

 

二、动态性能表

dynamic performance tables

记录当前数据库的活动,在数据库打开时连续地更新相关视图,信息从memory control file中采集。DBA使用动态视图查看、调整数据库。动态视图所有者是sys,对动态视图不容许使用DML语句。

The dynamic tables answer questions such as:

• Is the object online and available?

• Is the object open?

• What locks are being held?

• Is the session active?

查询数据字典和动态性能视图

数据字典和动态视图可以查询以下信息。

Querying the Data Dictionary

To get an overview of the data dictionary and dynamic performance views, the DICTIONARY view or its synonym DICT can be queried. For example:

SELECT * FROM dictionary;

Include the where clause to narrow your responses:

SELECT * FROM dictionary WHERE table_name like ‘sort%’

The V$FIXED_TABLE view can also be queried to get a listing of the views:

SELECT * FROM V$FIXED_TABLE;

To get a list of columns within a view, use the DESCRIBE keyword:

DESCRIBE V$INSTANCE;

To get an overview of the columns in the data dictionary and dynamic performance views,

the DICT_COLUMNS view can be queried.

To view the contents of the view use the SELECT command.

SELECT * from V$INSTANCE;

Data Dictionary Examples

General Overview

DICTIONARY, DICT_COLUMNS

Schema objects

DBA_TABLES, DBA_INDEXES, DBA_TAB_COLUMNS,

DBA_CONSTRAINTS

Space allocation

DBA_SEGMENTS, DBA_EXTENTS

Database structure

DBA_TABLESPACES, DBA_DATA_FILES

 

 

 

本章结束,数据字典和动态性能视图关键还是要多用才能熟练,多看oraclereference可以知道每个视图是干什么的。

 

如何增加ORACLE连接数:【上一篇】
如何扩大重做日志(redolog)文件的大小:【下一篇】
【相关文章】
  • 1Z031第四章
  • Oracle 1Z031学习笔记第三章
  • Oracle 1Z031学习笔记第二章
  • Oracle 1Z031学习笔记
  • 【随机文章】
  • 可视化思考
  • 改变控件的窗口样式
  • 上海,我的奋斗岁月(从2500到700万)----经典转载!
  • iptable中文学习文档 一
  • 蠕虫病毒“高波”变种分析报告(1)
  • VB中播放三维动画编程一例
  • Linux网络通信命令
  • vc6设定输入焦点
  • java解惑:Class.forName(String driverClassName)载入JDBC驱动程序的幕后(转载)
  • 在画板中打印
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.