Oracle Data Dictionary



Similar documents
Managing Objects with Data Dictionary Views. Copyright 2006, Oracle. All rights reserved.

Part 12. SQL for Oracle System Tables

Introduction to the Oracle DBMS

Objectives. Oracle SQL and SQL*PLus. Database Objects. What is a Sequence?

Oracle/SQL Tutorial 1

Oracle Database 11g SQL

Oracle Database 10g Express

Dictionary (catálogo)

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

CS143 Notes: Views & Authorization


Database 10g Edition: All possible 10g features, either bundled or available at additional cost.

Chapter 14. Outline. Database Support for Decision Making. Data and Database Administration

Introduction to SQL and database objects

A basic create statement for a simple student table would look like the following.

Oracle USF

2. Oracle SQL*PLUS Winter Some SQL Commands. To connect to a CS server, do:

Databases What the Specification Says

Oracle Database 12c: Introduction to SQL Ed 1.1

Oracle 11gR2 : Recover dropped tablespace using RMAN tablespace point in time recovery

Oracle Database: Introduction to SQL

Oracle Database 10g: Introduction to SQL

In This Lecture. Security and Integrity. Database Security. DBMS Security Support. Privileges in SQL. Permissions and Privilege.

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL

How To Create A Table In Sql (Ahem)

Review: Participation Constraints

5. CHANGING STRUCTURE AND DATA

Geodatabase Programming with SQL

Basic Concepts of Database Systems

Chapter 9 Joining Data from Multiple Tables. Oracle 10g: SQL

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

Virtual Private Database Features in Oracle 10g.

Oracle For Beginners Page : 1

DBA101: A Refresher Course

SQL Simple Queries. Chapter 3.1 V3.0. Napier University Dr Gordon Russell

ICAB4136B Use structured query language to create database structures and manipulate data

3.GETTING STARTED WITH ORACLE8i

Introduction This document s purpose is to define Microsoft SQL server database design standards.

Displaying Data from Multiple Tables. Chapter 4

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. The Relational Model. The relational model

CHAPTER 2 DATABASE MANAGEMENT SYSTEM AND SECURITY

Oracle 10g PL/SQL Training

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

CSC 443 Data Base Management Systems. Basic SQL

Displaying Data from Multiple Tables

Oracle SQL. Course Summary. Duration. Objectives

TIM 50 - Business Information Systems

Chapter 9, More SQL: Assertions, Views, and Programming Techniques

March 9 th, Oracle Total Recall

Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1

In This Lecture. SQL Data Definition SQL SQL. Notes. Non-Procedural Programming. Database Systems Lecture 5 Natasha Alechina

DATABASE MANAGEMENT SYSTEMS. Question Bank:

JEFFERSON COLLEGE COURSE SYLLABUS CIS-236 SQL AND DATABASE DESIGN. 3 Credit Hours. Prepared by: Chris DeGeare CIS Instructor. Revised: 3/11/2013

types, but key declarations and constraints Similar CREATE X commands for other schema ëdrop X name" deletes the created element of beer VARCHARè20è,

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

Fine Grained Auditing In Oracle 10G

PeopleTools Tables: The Application Repository in the Database

AUTHENTICATION... 2 Step 1:Set up your LDAP server... 2 Step 2: Set up your username... 4 WRITEBACK REPORT... 8 Step 1: Table structures...

More SQL: Assertions, Views, and Programming Techniques

Part A: Data Definition Language (DDL) Schema and Catalog CREAT TABLE. Referential Triggered Actions. CSC 742 Database Management Systems

ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT

Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC

Oracle(PL/SQL) Training

The Relational Model. Why Study the Relational Model? Relational Database: Definitions. Chapter 3

Database Management. Technology Briefing. Modern organizations are said to be drowning in data but starving for information p.

SQL Data Definition. Database Systems Lecture 5 Natasha Alechina

Oracle Architecture, Concepts & Facilities

Embedded SQL. Unit 5.1. Dr Gordon Russell, Napier University

OLH: Oracle Loader for Hadoop OSCH: Oracle SQL Connector for Hadoop Distributed File System (HDFS)

SQL. by Steven Holzner, Ph.D. ALPHA. A member of Penguin Group (USA) Inc.

Programming with SQL

SQL NULL s, Constraints, Triggers

Using Temporary Tables to Improve Performance for SQL Data Services

Transactional Updates to Enterprise GIS data sets. Presented by: Kelly Ratchinsky PBC Countywide GIS Coordinator

Database System Architecture & System Catalog Instructor: Mourad Benchikh Text Books: Elmasri & Navathe Chap. 17 Silberschatz & Korth Chap.

Chapter 2: Security in DB2

RDBMS Using Oracle. Lecture Week 7 Introduction to Oracle 9i SQL Last Lecture. kamran.munir@gmail.com. Joining Tables

There are five fields or columns, with names and types as shown above.

EECS 647: Introduction to Database Systems

Lab # 5. Retreiving Data from Multiple Tables. Eng. Alaa O Shama

Using Multiple Operations. Implementing Table Operations Using Structured Query Language (SQL)

An Introduction to PL/SQL. Mehdi Azarmi

Instant SQL Programming

Developing SQL and PL/SQL with JDeveloper

JDBC (Java / SQL Programming) CS 377: Database Systems

USING MYWEBSQL FIGURE 1: FIRST AUTHENTICATION LAYER (ENTER YOUR REGULAR SIMMONS USERNAME AND PASSWORD)

Programa de Actualización Profesional ACTI Oracle Database 11g: SQL Tuning Workshop

MySQL for Beginners Ed 3

Subqueries Chapter 6

LiTH, Tekniska högskolan vid Linköpings universitet 1(7) IDA, Institutionen för datavetenskap Juha Takkinen

A Generic Model for Querying Multiple Databases in a Distributed Environment Using JDBC and an Uniform Interface

HP Quality Center. Upgrade Preparation Guide

REPORT GENERATION USING SQL*PLUS COMMANDS

1 File Processing Systems

Oracle Database 10g: Program with PL/SQL

Relational Databases and SQLite

MOC 20461C: Querying Microsoft SQL Server. Course Overview

Transcription:

Oracle Data Dictionary 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. Although it is usually the domain of database administrators (DBAs), the data dictionary is a valuable source of information for end users and developers. The data dictionary consists of two levels: The internal level contains all base tables that are used by the various DBMS software components and they are normally not accessible by end users. The external level provides numerous views on these base tables to access information about objects and structures at different levels of detail. 1

Data Dictionary Tables An installation of an Oracle database always includes the creation of three standard Oracle users: SYS This is the owner of all data dictionary tables and views. This user has the highest privileges to manage objects and structures of an Oracle database such as creating new users. SYSTEM is the owner of tables used by different tools such SQL*Forms, SQL*Reports etc. This user has less privileges than SYS. PUBLIC This is a dummy user in an Oracle database. All privileges assigned to this user are automatically assigned to all users known in the database. 2

Data Dictionary Contains... The tables and views provided by the data dictionary contain information about users and their privileges, tables, table columns and their data types, integrity constraints, indexes, statistics about tables and indexes used by the optimizer, privileges granted on database objects, storage structures of the database. 3

Viewing the data dictionary The SQL command select * from DICT[IO ARY]; select * from DICT; _NAME COMMENTS USER_RESOURCE_LIMITS Display resource limit of the user USER_PASSWORD_LIMITS Display password limits of the user USER_CATALOG Tables, Views, Synonyms and Sequences owned by the user ALL_CATALOG All tables, views, synonyms, sequences accessible to the user USER_CLUSTERS Descriptions of user's own clusters ALL_CLUSTERS Description of clusters accessible to the user lists all tables and views of the data dictionary that are accessible to the user. The selected information includes the name and a short description of each table and view. Before issuing this query, check the column definitions of DICT[IONARY] using desc DICT[IONARY] and set the appropriate values for column using the format command. 4

The query select * from TAB; retrieves the names of all tables owned by the user who issues this command. select * from TAB; TNAME TABTYPE CLUSTERID DEPT EMP BONUS SALGRADE DUMMY DENEME EMPLOYEE EMPINFO STORE_INFO GEO 10 rows selected. 5

The query select * from COL; TNAME CO LN O CNAME COLTYPE WI DT H SC ALE PRECISIO N NULL S DEFAULTV AL GEO 2 STORE_NAME VARCHAR2 15 NULL CHAR_CS GEO 1 REGION_NAME VARCHAR2 10 NULL CHAR_CS STORE_INFO 3 DDATE DATE 7 NULL STORE_INFO 2 SALES NUMBER 22 0 5 NULL STORE_INFO 1 STORE_NAME VARCHAR2 15 NULL CHAR_CS EMPINFO 6 STATE VARCHAR2 20 NULL CHAR_CS EMPINFO 5 CITY VARCHAR2 20 NULL CHAR_CS EMPINFO 4 AGE NUMBER 22 0 3 NULL EMPINFO 3 SICIL NUMBER 22 0 5 NULL EMPINFO 2 LAST VARCHAR2 20 NULL CHAR_CS CHARACTER_SET_NA ME 6

Data Dictionary Views The views provided by the data dictionary are divided into three groups: USER, ALL, and DBA. The group name builds the prefix for each view name. For some views, there are associated synonyms as given in brackets below. USER : Tuples in the USER views contain information about objects owned by the account performing the SQL query (current user) USER S USER CATALOG USER COL COMMENTS USER CONSTRAINTS USER INDEXES USER OBJECTS USER TAB COLUMNS USER TAB COMMENTS USER TRIGGERS USER USERS USER VIEWS all tables with their name, number of columns, storage information, statistical information etc. (TABS) tables, views, and synonyms (CAT) comments on columns constraint definitions for tables all information about indexes created for tables (IND) all database objects owned by the user (OBJ) columns of the tables and views owned by the user (COLS) comments on tables and views triggers defined by the user information about the current user views defined by the user 7

ALL : Rows in the ALL views include rows of the USER views and all information about objects that are accessible to the current user. The structure of these views is analogous to the structure of the USER views. ALL CATALOG owner, name and type of all accessible tables, views, and synonyms ALL S owner and name of all accessible tables ALL OBJECTS owner, type, and name of accessible database objects ALL TRIGGERS... ALL USERS... ALL VIEWS... Retreiving Data Dictionaries: select * from USER_S ; select * from USER_COL_COMMENTS; select * from USER_OBJECTS ;.. select * from ALL_CATALOG ;. 8

DBA : The DBA views encompass information about all database objects, regardless of the owner. Only users with DBA privileges can access these views. DBA_S DBA_CATALOG DBA_OBJECTS DBA_DATA_FILES DBA_USERS tables of all users in the database tables, views, and synonyms defined in the database object of all users information about data files information about all users known in the database Retrieving database objects (requires dba privilages): select * from DBA_S ; select * from DBA_USERS ; 9