What is Metadata in Oracle and What is Data Dictionary | Oracle Shooter

Metadata

What is Metadata in Oracle and What is Data Dictionary | Oracle Shooter

–Definition — 
The Oracle data dictionary is one of the most important components of the Oracle DBMS. 
It contains all information about the structures and objects of the database 
such as. • tables, • columns, • users, • data files etc. 
The data stored in the data dictionary are also often called metadata.

–Introduction to the Data Dictionary
One of the most important parts of an Oracle database is its data dictionary, which is a read-only set of tables that provides information about the database. A data dictionary contains:
The definitions of all schema objects in the database (tables, views, indexes, clusters, synonyms, sequences, procedures, functions, packages, triggers, and so on)
How much space has been allocated for, and is currently used by, the schema objects
Default values for columns
Integrity constraint information
The names of Oracle users
Privileges and roles each user has been granted
Auditing information, such as who has accessed or updated various schema objects
Other general database information

—Structure of the Data Dictionary–
The data dictionary consists of the following:
–1. Base Tables
The underlying tables that store information about the associated database. Only Oracle should write to and read these tables. Users rarely access them directly because they are normalized, 
and most of the data is stored in a cryptic format.
–2. User-Accessible Views
The views that summarize and display the information stored in the base tables of the data dictionary. These views decode the base table data into useful information, 
such as user or table names, using joins and WHERE clauses to simplify the information. Most users are given access to the views rather than the base tables.
–3. SYS, Owner of the Data Dictionary
The Oracle user SYS owns all base tables and user-accessible views of the data dictionary. No Oracle user should ever alter (UPDATE, DELETE, or INSERT) 
any rows or schema objects contained in the SYS schema, because such activity can compromise data integrity. The security administrator must keep strict control of this central account.

—-How to Use the Data Dictionary—-
The views of the data dictionary serve as a reference for all database users. Access the data dictionary views with SQL statements. 
Some views are accessible to all Oracle users, and others are intended for database administrators only.
The data dictionary is always available when the database is open
The data dictionary base tables are the first objects created in any Oracle database. 
They are created in the SYSTEM tablespace and must remain there. 
The data dictionary base tables store information about all user-defined objects in the database.
The data dictionary consists of sets of views. In many cases, a set consists of three views containing similar information and distinguished from each other by their prefixes:

Prefix    Scope
USER   :- Users view (what is in the users schema)
ALL     :- Expanded users view (what the user can access)
DBA    :- Database administrators view (what is in all users schemas)

select * from tab  
select distinct TABTYPE ,count(*) from tab group by TABTYPE  

select COUNT(*) from USER_INDEXES  — 179655   
select COUNT(*) from ALL_INDEXES — 444073  
select COUNT(*) from DBA_INDEXES —  453301  

select OBJECT_TYPE ,COUNT(*) from ALL_OBJECTS  group by OBJECT_TYPE

select * from ALL_tables
select * from USER_tables
select * from DBA_tables

select * from dba_segments

select * from  sys.tab$
select * from sys.user$

select * from  sys.ts$
select * from sys.file$

select * from sys.seg$

select * from sys.obj$

Comments

Popular posts from this blog

E-Text Report In Fusion | Types of E-Text reports

Supplier API's

How to pass default Parameter in cursor