首页 > 代码库 > 数据字典和动态性能视图

数据字典和动态性能视图

 

Built-Indatabase Objects

Other objects created with the database:

·Data dictionary

·Performance tables

·PL/SQL packages

·Database event triggers

 

 

 

Data Dictionary

·Central toevery Oracle database

·Describes the database and it‘s objects

·Contains read-only tables and views

·Stored in the SYSTEM tablespace

·Owned by the user SYS

·Maintained by the Oracle server

·Accessed with SELECT

 

 

Base Tables & Data Dictionary Views

The data dictionary contains two parts:

·Base tables

  -Stores description of the database

  -Create with CREATE DATABASE

·Data dictionary views

  -Used to simplify the base table information

  -Accessed through public synonyms(同义词)

  -Create with the catalog.sql script

 

 

CreateData Dictionary Views

Script

Purpose

catalog.sql

Creates commonly used data dictionary views and  synonyms

catproc.sql

Runs scripts required for server-side PL/SQL

 

 

Data Dictionary Contents

The data dictionary provides information about:

·Logical and physical database structures

·Definitions and space allocations of objects

·Integrity constraints

·Users

·Roles

·Privileges

·Auditing

 

 

How the Data Dictionary Is Used?

Primary uses:

·Oracle server uses it to find information about:

  -Users

  -Schema objects

  -Storage structures

·Oracle server modifies it when a DDL statement is executed

·Users and DBAs use it as read-only reference for information about the database

 

 

Data Dictionary View Categories

·Three sets of static views

·Distinguished by their scope:

  -DBA: What is in the all the schemas

  -ALL: What the user can access

  -USER: What is in the user‘s schema

 

 

Data Dictionary tables 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.

 

 

 

 

Dynamic Perfomance Tables

·Virtual tables

·Record current database activity

·Continually updated while the database is operational

·Information is accessed from memory and control file

·Used to monitor and tune the database

·Owned by SYS user

·Synonyms begin with V$

·Listed inV$FIXED_TABLE

 

 

Dynamic PerformanceExamples

·v$controlfile

·v$database

·v$datafile

·v$instance

·v$parameter

·v$session

·v$sga

·v$spparameter

·v$tablespace

·v$thread

·v$version

 

 

Admin Script Naming

Convention

Description

cat*.sql

Catalog and data  dictionary information

dbms*.sql

Database package  specifications

prvt*.plb

Wrapped database  package code

utl*.sql

Views and tables  for database utilities

 

 

 


本文出自 “~Never” 博客,请务必保留此出处http://ospub.blog.51cto.com/6238506/1587751

数据字典和动态性能视图