创建数据库时 使用到的 Data Dictionary

The Data Dictionary
The most important part of the Oracle database is the data dictionary.
The data dictionary is a set of tables and views that hold the database’s metadata
information. You cannot update the dictionary directly; Oracle updates
the dictionary when you issue any Data Definition Language (DDL) commands.
The dictionary is provided as read-only for users and administrators.
The contents of the data dictionary and obtaining information from the dictionary
are discussed in the section “Querying the Dictionary.”

 

The data dictionary consists of base tables and user-accessible views. The
base tables are normalized and contain cryptic, version-specific information.
You use the views to query the dictionary and extract meaningful information.
To create the views, install the additional Oracle-supplied scripts after
the database is created.
The base tables contain information such as the users of the database and
their permissions, the amount of the used and unused space for database
objects, constraint information, and so on. Users and administrators rarely,
if ever, need to access the base tables, with the exception of tables such as
AUD$, which contains auditing information for objects in the database.
When the database is created, Oracle creates two users, SYS and SYSTEM.
SYS is the owner of the data dictionary, and SYSTEM is a DBA account. The
initial password for SYS is CHANGE_ON_INSTALL; the initial password for
SYSTEM is MANAGER. Change these passwords once the database is created.

Creating the Dictionary
The Oracle database is functional only when you create the dictionary
views and additional tablespaces, rollback segments, users, and so on. Creating
the dictionary views is the next step after you create the database by
using the CREATE DATABASE command. Running certain Oracle-supplied
scripts creates the dictionary views. We’ll discuss all these topics in this section
as well as give you some basics of how PL/SQL packages are created and
maintained in the data dictionary.

Data Dictionary Scripts
The data dictionary base tables are created under the SYS schema in the
SYSTEM tablespace when you issue the CREATE DATABASE command. Oracle
automatically creates the tablespace and tables using the sql.bsq script found
under the $ORACLE_HOME/rdbms/admin directory. This script creates the
following:
The SYSTEM tablespace by using the data file(s) specified in the CREATE
DATABASE command
A rollback segment named SYSTEM in the SYSTEM tablespace
The SYS and SYSTEM user accounts
The dictionary base tables and clusters
Indexes on dictionary tables and sequences for dictionary use
The roles PUBLIC, CONNECT, RESOURCE, DBA, DELETE_CATALOG_ROLE,
EXECUTE_CATALOG_ROLE, and SELECT_CATALOG_ROLE
The DUAL table
Don’t modify the definitions in the sql.bsq script—for example, by
adding columns, removing columns, or changing the data types or width.
You can change these storage parameters: INITIAL, NEXT, MINEXTENTS,
MAXEXTENTS, PCTINCREASE, FREELISTS, FREELIST GROUPS, and OPTIMAL.

The DUAL table is a dummy table owned by SYS and accessible to all users of
the database. The table has only one column, named DUMMY, and only one row.
Do not add more rows to this table.

Running the script catalog.sql creates the data dictionary views. This
script creates synonyms on the views to allow users easy access to the views.
Before running any data dictionary script, connect to the database as SYS.
The dictionary creation scripts are under the $ORACLE_HOME/rdbms/admin
directory on most platforms.
The script catproc.sql creates the dictionary items necessary for PL/SQL
functionality. The other scripts necessary for creating dictionary objects
depend on the operating system and the functionality you want in the database.
For example, if you are not using Real Application Clusters (RACs),
you need not install any RAC-related dictionary items. At a minimum, run
the catalog.sql and catproc.sql scripts after creating the database.
The dictionary creation scripts all begin with cat. Many of the scripts call
other scripts. For example, when you execute catalog.sql, it calls the following
scripts:
standard.sql Creates a package called STANDARD, which contains the
SQL functions to implement basic language features
cataudit.sql Creates data dictionary views to support auditing
Oracle
Objective
Identify the contents and uses of the data dictionary

The dictionary creation scripts all begin with cat. Many of the scripts call
other scripts. For example, when you execute catalog.sql, it calls the following
scripts:

standard.sql
Creates a package called STANDARD, which contains the
SQL functions to implement basic language features

cataudit.sql Creates data dictionary views to support auditing

catexp.sql Creates data dictionary views to support import/export

catldr.sql Creates data dictionary views to support direct-path load
of SQL*Loader

catpart.sql Creates data dictionary views to support partitioning

catadt.sql Creates data dictionary views to support Oracle objects
and types

catsum.sql Creates data dictionary views to support Oracle summary
management
From the name of a script, you can sometimes identify its purpose. The
following list indicates the categories of scripts.

cat*.sql Catalog and data dictionary scripts

dbms*.sql PL/SQL administrative package definitions

prvt*.plb PL/SQL administrative package code, in wrapped
(encrypted) form

uNNNNNN.sql Database upgrade/migration scripts

dNNNNNN.sql Database downgrade scripts

utl*.sql Additional tables and views needed for database utilities

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值