Oracle Database
Introduction
of
By
Puja Dhar
ORACLE HISTORY
Larry Ellison and his two friends and former co-workers, Bob Miner and
Ed Oates, started a consultancy called Software Development
Laboratories (SDL) in 1977. SDL developed the original version of the
Oracle software.
Developer
Usage
Oracle Database Architecture. An Oracle database is a collection of data treated
as a unit. The purpose of a database is to store and retrieve related
information. A database server is the key to solving the problems of information
management.
The i in oracle 8i and 9i stands for INTERNET and the g in 10g and 11g stands
for GRID, because from 10g onwards oracle supports grid architecture.
Meaning of i & g in Oracle databases
Oracle released Oracle Database 12c into general availability July 1, 2013.
According to Oracle, this is "the first database designed for the cloud.”
Meaning of Oracle 12c
ORACLE HISTORY
 1979 Oracle Release 2
 1986 client/server relational database
 1989 Oracle 6
 1997 Oracle 8 (object relational)
 1999 Oracle 8i (Java Virtual Machine)
 2000 Oracle Application Server
 2001 Oracle 9i database server
The major Oracle versions, with their latest patch-sets
are:
Oracle 7: ... - 7.3.4.5
Oracle 8: 8.0.3 - 8.0.6
Oracle 8i: 8.1.5.0 - 8.1.7.4
Oracle 9i (Release 1): 9.0.1.0 - 9.0.1.4
Oracle 9i (Release 2): 9.2.0.1 - 9.2.0.8
Oracle 10g (Release 1): 10.1.0.2 - 10.1.0.5
Oracle 10g (Release 2): 10.2.0.1 - 10.2.0.5
Oracle 11g (Release 1): 11.1.0.6 - 11.1.0.7
Oracle 11g (Release 2): 11.2.0.1 - 11.2.0.4
Oracle 12c (Release 1): 12.1.0.1 - 12.1.0.2.0
Note: If running on one of the above releases, it is
recommended to always install the latest patch-set.
OVERVIEW OF ORACLE GRID ARCHITECTURE
Grid computing is a new IT architecture that produces more resilient and lower
cost enterprise information systems. With grid computing, groups of independent,
modular hardware and software components can be connected and rejoined on
demand to meet the changing needs of businesses.
Benefits of Grid Computing
Compared to other models of computing, IT systems designed and implemented
in the grid style deliver
higher quality of service,
lower cost, and
greater flexibility.
Higher quality of service results from having no single point of failure,
a robust security infrastructure, and
centralized, policy-driven management.
Lower costs derive from increasing the utilization of resources and
dramatically reducing management and maintenance costs.
Rather than dedicating a stack of software and hardware to a specific
task, all resources are pooled and allocated on demand, thus eliminating under
utilized capacity and redundant capabilities.
Grid computing also enables the use of smaller individual hardware components,
thus reducing the cost of each individual component and providing more flexibility
to devote resources in accordance with changing needs.
ORACLE FAMILY
 Personal Oracle- for single users. Used to develop
systems
 Oracle Standard Edition- (Entry level Workgroup
server)
 Oracle Enterprise edition- Extended functionality
 Oracle Lite- (Oracle mobile) single users using
wireless devices.
SOME DEVELOPER TOOLS
 Oracle Forms Developer
 Oracle Reports Developer
 Oracle Jdeveloper
 Oracle Designer
FILE PROCESSING
Database
Processing
DATABASE STRUCTURE
 Logical structure - maps the data to the Physical
structure.
 Physical structure -part of the operating system’s file
structure.
 Memory structure - where all the processing takes
place.
THE LOGICAL STRUCTURES
 control how the data must be stored in the
database.
 five Logical structures:
 tablespaces
 segments
 extents
 data blocks
 schema objects
PHYSICAL STRUCTURES
 Parameter files
 Password files
 Datafiles
 Redo log files
 Control files
TABLESPACES
 A database is divided into logical storage units
called Tablespaces.
 logical construct for arranging different types
of data
 An Oracle database must have at least a
system tablespace.
 It is recommended to have different
tablespaces for user and system data.
SCHEMAS AND SCHEMA OBJECTS
 Collection of database objects
 Tables
 Views
 Sequences
 Indexes
 Procedures
 Functions
 Packages
 Triggers
DATA BLOCKS
 The smallest unit of Input/Output used by Oracle
database.
 The size of data block for any database is fixed at the
time of creation of the database;
 Some values of the data block size are 2KB, 8KB,
16KB, and 32KB.
 Oracle recommends a size of 8KB
EXTENTS
 The next level of data storage.
 One extent consists of a specific number of
data blocks
 One or more extents in turn make up a
segment.
 When the existing space in a segment is
completely used, Oracle allocates a new
extent for the segment.
SEGMENT
 A segment consists of a set of extents
 Each table’s data is stored in its own single
segment.
 Each index’s data is stored in a single
segment.
 More extents are automatically allocated by
Oracle to a segment if its existing extents
become full.
 The different types of segments are the data
segments, index segments,rollback segments,
and temporary segments.
PHYSICAL DATABASE STRUCTURE
 Password file - which contain the password
information for all users.
 Parameter file - which contains all the important
information necessary to start a database.
 Datafiles - which contain the application data
being stored, as well as any data necessary to
store user-IDs, passwords, and privileges.
 Redo log files - which store all the transactions
made to the database. These files are also called
transaction log files.
 Control files - which store information specifying
the structure of the database,such as the name
and time of creation of the database and the
name and location of the datafiles.
SECURITY MECHANISMS
 Database users and schemas
 Privileges
 Roles
 Storage settings and quotas
 Resource limits
 Auditing
DATA ACCESS: SQL
 Data definition language (DDL) statements
 Data manipulation language (DML)
statements
 Transaction control statements
 Session control statements
 System control statements
 Embedded SQL statements
TRANSACTIONS
 A transaction is a logical unit of work that comprises
one or more SQL statement executed by a single
user. According to the ANSI/ISO SQL standard, with
which Oracle is compatible, a transaction begins with
the user’s first executable SQL statement. A
transaction ends when it is explicitly committed or
rolled back.
TRANSACTION EXAMPLE
DATA ACCESS: SQL
Session Control Statements
These statements let a user control the properties of the current
session, including enabling and disabling roles and changing language
settings. The two session control statements are
ALTER SESSION and SET ROLE.
System Control Statements
These statements change the properties of the Oracle database
instance. The only system control statement is ALTER SYSTEM.
It lets users change settings, such as the minimum number of shared
servers, kill a session, and perform other tasks.
Embedded SQL Statements
These statements incorporate DDL, DML, and transaction control
statements in a procedural language program, such as those used with
the Oracle precompilers. Examples include OPEN,
CLOSE, FETCH, and EXECUTE
Overview of Data types
Each column value and constant in a SQL statement has a data
type, which is associated with a specific storage format,
constraints, and a valid range of values. When you create a table,
you must specify a datatype for each of its columns.
Oracle provides the following built-in data types:
Character datatypes
Numeric datatypes
DATE datatype
LOB datatypes
RAW and LONG RAW datatypes
Relational Model Concepts
 A Relation is a mathematical concept based on
the ideas of sets
 The model was first proposed by Dr. E.F. Codd of
IBM Research in 1970 in the following paper:
– "A Relational Model for Large Shared Data Banks," Communications of
the ACM (Association for Computing machinery), June 1970
 The above paper caused a major revolution in the
field of database management
FUNCTIONS OF A DBMS
 Data definition: SQL lets a user define the structure and organization
of the stored data and relationships among the stored data items.
 Data retrieval: SQL allows a user or an application program to retrieve
stored data from the database and use it.
 Data manipulation: SQL allows a user or an application program to
update the database by adding new data, removing old data, and
modifying previously stored data.
 Access control: SQL can be used to restrict a user’s ability to retrieve,
add, and modify data, protecting stored data against unauthorized
access.
 Data sharing: SQL is used to coordinate data sharing by concurrent
users, ensuring that they do not interfere with one another.
 Data integrity: SQL defines integrity constraints in the database,
protecting it from corruption due to inconsistent updates or system
failures.
 SQL is thus a comprehensive language for controlling and interacting
with a database management system.
Informal Definitions
 Informally, a relation looks like a table of values.
 A relation typically contains a set of rows.
 The data elements in each row represent certain facts
that correspond to a real-world entity or relationship
– In the formal model, rows are called tuples
 Each column has a column header that gives an
indication of the meaning of the data items in that column
– In the formal model, the column header is
called an attribute name (or just attribute)
Example of a Relation
Relational Integrity Constraints
 Constraints are conditions that must hold on all
valid relation states.
 There are three main types of constraints in the
relational model:
– Key constraints
– Entity integrity constraints
– Referential integrity constraints
 Another implicit constraint is the domain
constraint
– Every value in a tuple must be from the domain of its attribute (or it
could be null, if allowed for that attribute)
STRUCTURED QUERY LANGUAGE
 SQL (Structured Query Language) is a database sub-language for
querying and modifying relational databases.
 It was developed by IBM Research in the mid 70's and standardized by
ANSI in 1986.
 Relational Model defines two root languages for accessing a relational
database -- Relational Algebra and Relational Calculus.
REFERENCES
 https://docs.oracle.com/cd/B19306_01/server.102/b14220/i
ntro.htm
 Oracle 11g with PL/SQL Approach by Sham Tickoo and
Sunil Raina
PRACTICAL IMPLEMENTATION
OF
SQL COMMANDS AND ITS VARIOUS
TYPES
WILL BE PERFORMED IN LABS

Introduction to Oracle Database

  • 1.
  • 2.
    ORACLE HISTORY Larry Ellisonand his two friends and former co-workers, Bob Miner and Ed Oates, started a consultancy called Software Development Laboratories (SDL) in 1977. SDL developed the original version of the Oracle software. Developer Usage Oracle Database Architecture. An Oracle database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information. A database server is the key to solving the problems of information management. The i in oracle 8i and 9i stands for INTERNET and the g in 10g and 11g stands for GRID, because from 10g onwards oracle supports grid architecture. Meaning of i & g in Oracle databases Oracle released Oracle Database 12c into general availability July 1, 2013. According to Oracle, this is "the first database designed for the cloud.” Meaning of Oracle 12c
  • 3.
    ORACLE HISTORY  1979Oracle Release 2  1986 client/server relational database  1989 Oracle 6  1997 Oracle 8 (object relational)  1999 Oracle 8i (Java Virtual Machine)  2000 Oracle Application Server  2001 Oracle 9i database server
  • 4.
    The major Oracleversions, with their latest patch-sets are: Oracle 7: ... - 7.3.4.5 Oracle 8: 8.0.3 - 8.0.6 Oracle 8i: 8.1.5.0 - 8.1.7.4 Oracle 9i (Release 1): 9.0.1.0 - 9.0.1.4 Oracle 9i (Release 2): 9.2.0.1 - 9.2.0.8 Oracle 10g (Release 1): 10.1.0.2 - 10.1.0.5 Oracle 10g (Release 2): 10.2.0.1 - 10.2.0.5 Oracle 11g (Release 1): 11.1.0.6 - 11.1.0.7 Oracle 11g (Release 2): 11.2.0.1 - 11.2.0.4 Oracle 12c (Release 1): 12.1.0.1 - 12.1.0.2.0 Note: If running on one of the above releases, it is recommended to always install the latest patch-set.
  • 5.
    OVERVIEW OF ORACLEGRID ARCHITECTURE Grid computing is a new IT architecture that produces more resilient and lower cost enterprise information systems. With grid computing, groups of independent, modular hardware and software components can be connected and rejoined on demand to meet the changing needs of businesses. Benefits of Grid Computing Compared to other models of computing, IT systems designed and implemented in the grid style deliver higher quality of service, lower cost, and greater flexibility. Higher quality of service results from having no single point of failure, a robust security infrastructure, and centralized, policy-driven management. Lower costs derive from increasing the utilization of resources and dramatically reducing management and maintenance costs. Rather than dedicating a stack of software and hardware to a specific task, all resources are pooled and allocated on demand, thus eliminating under utilized capacity and redundant capabilities. Grid computing also enables the use of smaller individual hardware components, thus reducing the cost of each individual component and providing more flexibility to devote resources in accordance with changing needs.
  • 6.
    ORACLE FAMILY  PersonalOracle- for single users. Used to develop systems  Oracle Standard Edition- (Entry level Workgroup server)  Oracle Enterprise edition- Extended functionality  Oracle Lite- (Oracle mobile) single users using wireless devices.
  • 7.
    SOME DEVELOPER TOOLS Oracle Forms Developer  Oracle Reports Developer  Oracle Jdeveloper  Oracle Designer
  • 8.
  • 9.
  • 11.
    DATABASE STRUCTURE  Logicalstructure - maps the data to the Physical structure.  Physical structure -part of the operating system’s file structure.  Memory structure - where all the processing takes place.
  • 12.
    THE LOGICAL STRUCTURES control how the data must be stored in the database.  five Logical structures:  tablespaces  segments  extents  data blocks  schema objects
  • 13.
    PHYSICAL STRUCTURES  Parameterfiles  Password files  Datafiles  Redo log files  Control files
  • 14.
    TABLESPACES  A databaseis divided into logical storage units called Tablespaces.  logical construct for arranging different types of data  An Oracle database must have at least a system tablespace.  It is recommended to have different tablespaces for user and system data.
  • 15.
    SCHEMAS AND SCHEMAOBJECTS  Collection of database objects  Tables  Views  Sequences  Indexes  Procedures  Functions  Packages  Triggers
  • 16.
    DATA BLOCKS  Thesmallest unit of Input/Output used by Oracle database.  The size of data block for any database is fixed at the time of creation of the database;  Some values of the data block size are 2KB, 8KB, 16KB, and 32KB.  Oracle recommends a size of 8KB
  • 17.
    EXTENTS  The nextlevel of data storage.  One extent consists of a specific number of data blocks  One or more extents in turn make up a segment.  When the existing space in a segment is completely used, Oracle allocates a new extent for the segment.
  • 18.
    SEGMENT  A segmentconsists of a set of extents  Each table’s data is stored in its own single segment.  Each index’s data is stored in a single segment.  More extents are automatically allocated by Oracle to a segment if its existing extents become full.  The different types of segments are the data segments, index segments,rollback segments, and temporary segments.
  • 19.
    PHYSICAL DATABASE STRUCTURE Password file - which contain the password information for all users.  Parameter file - which contains all the important information necessary to start a database.  Datafiles - which contain the application data being stored, as well as any data necessary to store user-IDs, passwords, and privileges.  Redo log files - which store all the transactions made to the database. These files are also called transaction log files.  Control files - which store information specifying the structure of the database,such as the name and time of creation of the database and the name and location of the datafiles.
  • 20.
    SECURITY MECHANISMS  Databaseusers and schemas  Privileges  Roles  Storage settings and quotas  Resource limits  Auditing
  • 21.
    DATA ACCESS: SQL Data definition language (DDL) statements  Data manipulation language (DML) statements  Transaction control statements  Session control statements  System control statements  Embedded SQL statements
  • 22.
    TRANSACTIONS  A transactionis a logical unit of work that comprises one or more SQL statement executed by a single user. According to the ANSI/ISO SQL standard, with which Oracle is compatible, a transaction begins with the user’s first executable SQL statement. A transaction ends when it is explicitly committed or rolled back.
  • 23.
  • 24.
    DATA ACCESS: SQL SessionControl Statements These statements let a user control the properties of the current session, including enabling and disabling roles and changing language settings. The two session control statements are ALTER SESSION and SET ROLE. System Control Statements These statements change the properties of the Oracle database instance. The only system control statement is ALTER SYSTEM. It lets users change settings, such as the minimum number of shared servers, kill a session, and perform other tasks. Embedded SQL Statements These statements incorporate DDL, DML, and transaction control statements in a procedural language program, such as those used with the Oracle precompilers. Examples include OPEN, CLOSE, FETCH, and EXECUTE
  • 25.
    Overview of Datatypes Each column value and constant in a SQL statement has a data type, which is associated with a specific storage format, constraints, and a valid range of values. When you create a table, you must specify a datatype for each of its columns. Oracle provides the following built-in data types: Character datatypes Numeric datatypes DATE datatype LOB datatypes RAW and LONG RAW datatypes
  • 26.
    Relational Model Concepts A Relation is a mathematical concept based on the ideas of sets  The model was first proposed by Dr. E.F. Codd of IBM Research in 1970 in the following paper: – "A Relational Model for Large Shared Data Banks," Communications of the ACM (Association for Computing machinery), June 1970  The above paper caused a major revolution in the field of database management
  • 27.
    FUNCTIONS OF ADBMS  Data definition: SQL lets a user define the structure and organization of the stored data and relationships among the stored data items.  Data retrieval: SQL allows a user or an application program to retrieve stored data from the database and use it.  Data manipulation: SQL allows a user or an application program to update the database by adding new data, removing old data, and modifying previously stored data.  Access control: SQL can be used to restrict a user’s ability to retrieve, add, and modify data, protecting stored data against unauthorized access.  Data sharing: SQL is used to coordinate data sharing by concurrent users, ensuring that they do not interfere with one another.  Data integrity: SQL defines integrity constraints in the database, protecting it from corruption due to inconsistent updates or system failures.  SQL is thus a comprehensive language for controlling and interacting with a database management system.
  • 28.
    Informal Definitions  Informally,a relation looks like a table of values.  A relation typically contains a set of rows.  The data elements in each row represent certain facts that correspond to a real-world entity or relationship – In the formal model, rows are called tuples  Each column has a column header that gives an indication of the meaning of the data items in that column – In the formal model, the column header is called an attribute name (or just attribute)
  • 29.
    Example of aRelation
  • 30.
    Relational Integrity Constraints Constraints are conditions that must hold on all valid relation states.  There are three main types of constraints in the relational model: – Key constraints – Entity integrity constraints – Referential integrity constraints  Another implicit constraint is the domain constraint – Every value in a tuple must be from the domain of its attribute (or it could be null, if allowed for that attribute)
  • 31.
    STRUCTURED QUERY LANGUAGE SQL (Structured Query Language) is a database sub-language for querying and modifying relational databases.  It was developed by IBM Research in the mid 70's and standardized by ANSI in 1986.  Relational Model defines two root languages for accessing a relational database -- Relational Algebra and Relational Calculus.
  • 32.
  • 33.
    PRACTICAL IMPLEMENTATION OF SQL COMMANDSAND ITS VARIOUS TYPES WILL BE PERFORMED IN LABS