M. Ashad Baloch 1
Three Level ANSI-SPARC
Architecture
The model provides the basis for
understanding some of the functionality of
a DBMS.
Provide guideline for venders of database
management system.
In 1975 American National Standards
Institute (ANSI) Standards Planning and
Requirement Committee (SPARC)
recognized the need for three level
architecture.
• The design of a DBMS depends on its
architecture. It can be centralized or
decentralized or hierarchical.
• The architecture of a DBMS can be seen as
either single tier or multi-tier.
• An n-tier architecture divides the whole system
into related but independent n modules, which
can be independently modified, altered,
changed, or replaced
M. Ashad Baloch 2
M. Ashad Baloch 3
Three Level ANSI-SPARC
Architecture-I
Three level architecture
consist of:
1) External Level
2) Conceptual Level
3) Internal Level
M. Ashad Baloch 4
External Level
The users view of the database. This level
describes that part of the database that is
relevant to each user.
The external level consists of a number of
different external views of the database.
Different views may have different
representation of same data.
M. Ashad Baloch 5
External Level-II
For example, one user may view dates in
the form (day, month, year), while another
may view dates as (year, month, day).
Some views might include derived or
calculated data. (Example DOB  Age)
M. Ashad Baloch 6
Conceptual Level
The middle level in the three level
architecture is the conceptual level.
This level describes what data is stored in
the database and the relationships among
the data.
The conceptual level provides both the
mapping and the desired independence
between the external and internal levels.
M. Ashad Baloch 7
Conceptual Level-I
The conceptual level represents:
1. All entities, their attributes and their
relationships.
2. The constraints on the data.
3. Security and integrity information.
M. Ashad Baloch 8
Conceptual Level-II
The conceptual level supports each external
view, in that any data available to a user
must be contained in or derivable from the
conceptual level.
However this level must not contain any
storage-dependent details.
M. Ashad Baloch 9
Conceptual Level-II
• control how the data must be stored in the
database.
• five Logical structures:
table spaces
segments
extents
data blocks
schema objects
M. Ashad Baloch 10
External and conceptual layers
M. Ashad Baloch 11
tablespaces
• A database is divided into logical storage units
called Tablespaces.
• Oracle stores data logically in tablespace and
physically in datafiles
• 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
M. Ashad Baloch 12
SCHEMAS AND SCHEMA
OBJECTS
• Collection of database objects
• Tables
• Views
• Sequences
• Indexes
• Procedures
• Functions
• Packages
• Triggers
M. Ashad Baloch 13
DATA BLOCKS
• The smallest unit of Input/Output used by Oracle
database.
• Or smallest unit of storage in oracle
• 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
M. Ashad Baloch 14
EXTENTS
• The next level of data storage.
• One extent consists of a specific number of
data blocks
• An extents consist of one or more database
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.
M. Ashad Baloch 15
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
M. Ashad Baloch 16
Internal Level
The physical representation of the database
on the computer. This level describes how
the data is stored in the database.
It covers the data structure and file
organizations used to store data on storage
devices.
17
Internal Level-I
The internal level is concerned:
•Storage space allocation for data and
indexes.
•Record descriptions for storage (with stored
sizes for data items).
•Record placement.
•Data compression and data encryption
techniques.
M. Ashad Baloch 18
Representation of data at different levels of data base
Architecture and at the physical level at bottom
M. Ashad Baloch 19
Database Schemas
The overall description of the database is
called the database schema.
• A database schema is the skeleton
structure that represents the logical view
of the entire database. It defines how the
data is organized and how the relations
among them are associated. It formulates
all the constraints that are to be applied on
the data.
The schema is specified during the
database design process and is not
expected to change frequently.
There are three different types of schema in
the database. These are defined according
to three level of architecture.
20
M. Ashad Baloch 21
External Schema
At the highest level we have multiple
external schemas (also called subschemas)
that correspond to different views of data.
M. Ashad Baloch 22
Conceptual Schema
At the conceptual level we have conceptual
schema, which describe all the entities,
attributes and relationships together with
integrity constraints.
M. Ashad Baloch 23
Internal Schema
At lowest level we have internal schema
which is the complete description of internal
model.
Containing the definition of stored record,
the methods of representation, the data
fields and indexes.
There is only one conceptual schema and
one internal schema per database.
M. Ashad Baloch 24
Mappings
Mapping is the process of converting one level
to another level.
In this process the data at one level is related to
data at another level.
The DBMS is responsible for mapping between
these three types of schema.
It must also check schemas for consistency.
Each external schema is derivable from the
conceptual schema and it must use the
information in the conceptual schema to map
between each external schema and the internal
schema
M. Ashad Baloch 25
Mappings-I
The conceptual schema
related to the internal schema
through a conceptual/internal
mapping.
External schema is related to
the conceptual schema by the
external/conceptual mapping.
Naeem Aslam 26
Naeem Aslam 27
28
Three Level Architecture Objectives
•Each user should be able to access the same
data but have a different customize view of the
data.
•User should not have to deal directly with physical
database storage detail.
•The DBA should be able to change the database
storage structure without affecting the users views.
M. Ashad Baloch 29
Three Level Architecture Objectives
•The internal structure of the database
should be unaffected by changes to the
physical aspects of storage.
•The DBA should be able to change the
conceptual structure of the database without
affecting all users.
M. Ashad Baloch 30
Database Instance
The data in the database at any particular point in
time is called a database instance.
Actual data in database may change frequently.
Therefore many database instances correspond to
the same database schema.
The schema is sometimes called the intension of
the database while an instance is called and
extension or state of the database.
M. Ashad Baloch 31
Oracle Database Instance
• When database is started on database server
– Oracle allocates a memory area called system Global
Area (SGA) and start one or more processes.
– This combination of the SGA and the ORACLE
Processes is called an Oracle instance.
• Every running Oracle database is associated with at
least one Oracle database instance. Because an
instance exists in memory and a database exists on disk,
an instance can exist without a database and a database
can exist without an instance.
M. Ashad Baloch 32
Single instance vs Multiple
Instance
• A single instance (set of processes) can
mount at most one database (set of files).
If you need to access multiple databases,
you will need multiple instances.
M. Ashad Baloch 33
Oracle Memory Structures
• Oracle uses memory to store various information:
• program code being executed
• information about a connected session, even if it is not
currently active
• information needed during program execution (for example,
the current state of a query from which rows are being fetched)
• information that is shared and communicated among Oracle
processes (for example, locking information)
• cached data that is also permanently stored on peripheral
memory (for example, data blocks and redo log entries)
M. Ashad Baloch 34
Oracle Memory Structures
• The basic memory structures associated with Oracle include:
• Software Code Areas
• System Global Area (SGA)
• the database buffer cache
• the redo log buffer
• the shared pool
• Program Global Areas (PGA):
• the stack areas
• the data areas
• Sort Areas
M. Ashad Baloch 35
System Global Area
• A system global area (SGA) is a group of shared memory
structures that contain data and control information for one Oracle
database instance. If multiple users are concurrently connected to
the same instance, the data in the instance's SGA is "shared"
among the users. Consequently, the SGA is sometimes referred to
as the "shared global area“.
• The SGA contains the following data structures:
• the database buffer cache
• the redo log buffer
• the shared pool
• the data dictionary cache
• other miscellaneous information
M. Ashad Baloch 36
Database Buffer Cache
• The database buffer cache is the portion of the SGA that
holds copies of data blocks read from datafiles.
M. Ashad Baloch 37
Redo log buffer
• The redo log buffer is a circular buffer in the SGA that holds
information about changes made to the database. This information
is stored in redo entries. Redo entries contain the information
necessary to reconstruct, or redo, changes made to the database by
INSERT, UPDATE, DELETE, CREATE, ALTER, or DROP
operations. Redo entries are used for database recovery, if
necessary.
• Redo entries are copied by Oracle server processes from the user's
memory space to the redo log buffer in the SGA. The redo entries
take up continuous, sequential space in the buffer. The
background process LGWR(Log writer) writes the redo log buffer
to the active online redo log file (or group of files) on disk.
M. Ashad Baloch 38
Shared Pool
• The shared pool portion of the SGA contains three major
areas: library cache, dictionary cache, and control
structures.
• The total size of the shared pool is determined by the
initialization parameter SHARED_POOL_SIZE. The
default value of this parameter is 3,500,000 bytes.
Increasing the value of this parameter increases the
amount of memory reserved for the shared pool, and
therefore increases the space reserved for shared SQL
areas.
M. Ashad Baloch 39
Library Cache
• The library cache includes the shared SQL areas, private
SQL areas, PL/SQL procedures and packages, and
control structures such as locks and library cache
handles.
• Dictionary Cache: The data dictionary is a collection of
database tables and views containing reference
information about the database, its structures, and its
users. Oracle accesses the data dictionary frequently
during the parsing of SQL statements.
M. Ashad Baloch 40
Program Global Area
• A program global area (PGA) is a memory region containing data
and control information for a single process (server or
background). Consequently, a PGA is sometimes called a
"process global area."
• A PGA is nonshared memory area to which a process can write.
One PGA is allocated for each server process; the PGA is
exclusive to that server process and is read and written only by
Oracle code acting on behalf of that process.
• A PGA is allocated by Oracle when a user connects to an Oracle
database and a session is created, though this varies by operating
system and configuration
M. Ashad Baloch 41
Program Global Area
• Stack Space: A PGA always contains a stack space,
which is memory allocated to hold a session's variables,
arrays, and other information.
• Sort Areas: Sorting requires space in memory.
Portions of memory in which Oracle sorts data are
called sort areas. A sort area exists in the memory of an
Oracle user process that requests a sort.
M. Ashad Baloch 42
Software Code Areas
• Software code areas are portions of memory used to
store code that is being executed or may be executed.
Oracle code is stored in a software area that is typically
at a different location from users' programs - a more
exclusive or protected location.
M. Ashad Baloch
43
Process Structure
• A process is a "thread of control" or a mechanism in an operating
system that can execute a series of steps. Some operating systems
use the terms job or task. A process normally has its own private
memory area in which it runs. The process structure of Oracle is
important because it defines how multiple activities can occur and
how they are accomplished.
• For example, two goals of a process structure might be to simulate a
private environment for multiple processes to work simultaneously,
as though each process has its own private environment to allow
multiple processes to share computer resources, which each process
needs, but no process needs for long periods of time
• The Oracle's process architecture is designed to maximize
performance.
M. Ashad Baloch 44
Data Independence
A major objective for three-level architecture
is to provide data independence.
Which means that upper levels are
unaffected by changes to lower levels.
Two kinds of data independence:
1)Logical Data Independence
2)Physical Data Independence
M. Ashad Baloch 45
Logical Data Independence
Logical data independence refers to the immunity
(protection) of the external schemas to changes in
the conceptual schema.
Changes to the conceptual schema such as the
addition or removal of new entities, attributes or
relationships should be possible without having to
change existing external schemas or having
rewrite the application programs.
M. Ashad Baloch 46
Physical Data Independence
Physical data independence refers to the
immunity of the conceptual schema to
changes in the internal schema.
Changes to the internal schema such as
using different file organizations or storage
structures, using different storage devices,
modifying indexes or hashing algorithms
should be possible without having to change
the conceptual or external schema.
47
Database Languages
A data sublanguage consists of two parts:
1)Data Definition Language (DDL)
2)Data Manipulation Language (DML)
These languages are called data
sublanguages because they do not include
constructs (conditional or iterative
statements) for all computing needs, which
are provided by HLL.
M. Ashad Baloch 48
The levels where the Conceptual and Physical data independence are effective
M. Ashad Baloch 49
Database Languages-I
Many DBMS have a facility for embedding
the sublanguage in a high level
programming language such as COBOL,
Fortran, PASCAL, C, C++, Java, Visual
Basic.
In this case high level language refer to as
the host language.
M. Ashad Baloch 50
The Data Definition Language
(DDL)
A language that allows the DBA or user to
describe and name the:
Entities
Attributes
Relationships
Integrity and Security Constraints.
M. Ashad Baloch 51
The Data Manipulation Language
(DML)
Data manipulation operations usually
include the following:
•Insertion of new data into the database
•Modification of data stored in the database
•Retrieval of data contained in the database
•Deletion of data from the database
52
DML Types
Two Types of DML:
1)Procedural DML
2)Non Procedural DML
Procedural language specify how the output of
DML statement must be obtained.
While the non-procedural DMLs describe only
what output to be obtained.
Procedural language treat records individually,
while non-procedural languages operate on set of
records.
M. Ashad Baloch 53
Functions of DBMS
1) Data Storage, retrieval and update
A DBMS must furnish users with the ability
to store, retrieve and update data in the
database.
2) A user accessible catalog
A DBMS must furnish a catalog in which
descriptions of data items are stored and
which is accessible to users.
M. Ashad Baloch 54
Functions of DBMS-I
3) Transaction Support
A DBMS must furnish a mechanism which will
ensure that all the updates corresponding to a
given transaction are made or that none of them is
made.
4) Concurrency control services
A DBMS must furnish a mechanism to ensure that
the database is update correctly when multiple
users are updating the database concurrently.
M. Ashad Baloch 55
Functions of DBMS-II
5) Recovery Services
A DBMS must furnish a mechanism for
recovering the database in the event that the
database is damaged in any way.
6) Authorization Services
A DBMS must furnish a mechanism to
ensure that only authorized users can
access the database.
M. Ashad Baloch 56
Functions of DBMS-III
7) Support for data communication
A DBMS must be capable of integrating with
communication software.
8) Integrity services
A DBMS must furnish a means to ensure
that both the data in the database and
changes to the data follow certain rules.
M. Ashad Baloch 57
Functions of DBMS-IV
9) Services to support data independence
A DBMS must include facilities to support
the independence of programs from the
actual structure of the database.
M. Ashad Baloch 58
Functions of DBMS-V
10) Utility Services
A DBMS should provide a set of utility
services.
•Import and Export facilities
•Monitoring database facilities
•Examine database performance
M. Ashad Baloch 59
DBMS Environments
Single User Database Environment
The database environment which supports
only one user accessing the database at a
specific time.
The DBMS might have a number of users
but at a certain time only one user can log
into the database system and use it.
This type of DBMS systems are also called
Desktop Database systems.
M. Ashad Baloch 60
DBMS Environments-I
Multi-User Database systems
The DBMS which can support a number of
users simultaneously interacting with the
database indifferent ways. A number of
environments exist for such DBMS.
– Teleprocessing
– File Servers
– Client-Server
M. Ashad Baloch 61
Teleprocessing
This type of Multi user database systems
processes the user requests at a central
computer, all requests are carried to the
central computer where the database is
residing, transactions are carried out and the
results transported back to the terminals
(literally dumb terminals). It has become
obsolete now.
M. Ashad Baloch
62
File Servers
• This type of multi-user database environment assumes another
approach for sharing of data for different users.
• A file server is used to maintain a connection between the
users of the database system.
• Each client of the network runs its own copy of the DBMS and
the database resides on the file server.
• Now whenever a user needs data from the file server it makes
a request the whole file containing the required data was
sent to the client.
• At this stage it is important to see that the user has requested
one or two records from the database but the server sends a
complete file, which might contain hundreds of records.
• Now if the client after making the desired operation on the
desired data wants to write back the data on the database he
will have to send the whole file back to the server, thus
causing a lot of network overhead.
• The Good thing about this approach is that the server does not
have lots of actions to do.
M. Ashad Baloch 63
Client-Server
This type of multi-user environment is the best
implementation of the network and DBMS environments.
It has a DBMS server machine which runs the DBMS and
to this machine are connected the clients having
application programs running for each user.
Once a users wants to perform a certain operation on data
in the database it sends its requests to the DBMS through
its machine’s application software; the request is
forwarded to the DBMS server which performs the
required operation on data in the database stored in the
computer and then passes back the result to the user
intending the result.
This environment is best suited for large enterprises
where bulk of data is processed and requests are very
much frequent.

Database architecture, SCHEMAS AND SCHEMA OBJECTS

  • 1.
    M. Ashad Baloch1 Three Level ANSI-SPARC Architecture The model provides the basis for understanding some of the functionality of a DBMS. Provide guideline for venders of database management system. In 1975 American National Standards Institute (ANSI) Standards Planning and Requirement Committee (SPARC) recognized the need for three level architecture.
  • 2.
    • The designof a DBMS depends on its architecture. It can be centralized or decentralized or hierarchical. • The architecture of a DBMS can be seen as either single tier or multi-tier. • An n-tier architecture divides the whole system into related but independent n modules, which can be independently modified, altered, changed, or replaced M. Ashad Baloch 2
  • 3.
    M. Ashad Baloch3 Three Level ANSI-SPARC Architecture-I Three level architecture consist of: 1) External Level 2) Conceptual Level 3) Internal Level
  • 4.
    M. Ashad Baloch4 External Level The users view of the database. This level describes that part of the database that is relevant to each user. The external level consists of a number of different external views of the database. Different views may have different representation of same data.
  • 5.
    M. Ashad Baloch5 External Level-II For example, one user may view dates in the form (day, month, year), while another may view dates as (year, month, day). Some views might include derived or calculated data. (Example DOB  Age)
  • 6.
    M. Ashad Baloch6 Conceptual Level The middle level in the three level architecture is the conceptual level. This level describes what data is stored in the database and the relationships among the data. The conceptual level provides both the mapping and the desired independence between the external and internal levels.
  • 7.
    M. Ashad Baloch7 Conceptual Level-I The conceptual level represents: 1. All entities, their attributes and their relationships. 2. The constraints on the data. 3. Security and integrity information.
  • 8.
    M. Ashad Baloch8 Conceptual Level-II The conceptual level supports each external view, in that any data available to a user must be contained in or derivable from the conceptual level. However this level must not contain any storage-dependent details.
  • 9.
    M. Ashad Baloch9 Conceptual Level-II • control how the data must be stored in the database. • five Logical structures: table spaces segments extents data blocks schema objects
  • 10.
    M. Ashad Baloch10 External and conceptual layers
  • 11.
    M. Ashad Baloch11 tablespaces • A database is divided into logical storage units called Tablespaces. • Oracle stores data logically in tablespace and physically in datafiles • 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
  • 12.
    M. Ashad Baloch12 SCHEMAS AND SCHEMA OBJECTS • Collection of database objects • Tables • Views • Sequences • Indexes • Procedures • Functions • Packages • Triggers
  • 13.
    M. Ashad Baloch13 DATA BLOCKS • The smallest unit of Input/Output used by Oracle database. • Or smallest unit of storage in oracle • 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
  • 14.
    M. Ashad Baloch14 EXTENTS • The next level of data storage. • One extent consists of a specific number of data blocks • An extents consist of one or more database 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.
  • 15.
    M. Ashad Baloch15 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
  • 16.
    M. Ashad Baloch16 Internal Level The physical representation of the database on the computer. This level describes how the data is stored in the database. It covers the data structure and file organizations used to store data on storage devices.
  • 17.
    17 Internal Level-I The internallevel is concerned: •Storage space allocation for data and indexes. •Record descriptions for storage (with stored sizes for data items). •Record placement. •Data compression and data encryption techniques.
  • 18.
    M. Ashad Baloch18 Representation of data at different levels of data base Architecture and at the physical level at bottom
  • 19.
    M. Ashad Baloch19 Database Schemas The overall description of the database is called the database schema. • A database schema is the skeleton structure that represents the logical view of the entire database. It defines how the data is organized and how the relations among them are associated. It formulates all the constraints that are to be applied on the data.
  • 20.
    The schema isspecified during the database design process and is not expected to change frequently. There are three different types of schema in the database. These are defined according to three level of architecture. 20
  • 21.
    M. Ashad Baloch21 External Schema At the highest level we have multiple external schemas (also called subschemas) that correspond to different views of data.
  • 22.
    M. Ashad Baloch22 Conceptual Schema At the conceptual level we have conceptual schema, which describe all the entities, attributes and relationships together with integrity constraints.
  • 23.
    M. Ashad Baloch23 Internal Schema At lowest level we have internal schema which is the complete description of internal model. Containing the definition of stored record, the methods of representation, the data fields and indexes. There is only one conceptual schema and one internal schema per database.
  • 24.
    M. Ashad Baloch24 Mappings Mapping is the process of converting one level to another level. In this process the data at one level is related to data at another level. The DBMS is responsible for mapping between these three types of schema. It must also check schemas for consistency. Each external schema is derivable from the conceptual schema and it must use the information in the conceptual schema to map between each external schema and the internal schema
  • 25.
    M. Ashad Baloch25 Mappings-I The conceptual schema related to the internal schema through a conceptual/internal mapping. External schema is related to the conceptual schema by the external/conceptual mapping.
  • 26.
  • 27.
  • 28.
    28 Three Level ArchitectureObjectives •Each user should be able to access the same data but have a different customize view of the data. •User should not have to deal directly with physical database storage detail. •The DBA should be able to change the database storage structure without affecting the users views.
  • 29.
    M. Ashad Baloch29 Three Level Architecture Objectives •The internal structure of the database should be unaffected by changes to the physical aspects of storage. •The DBA should be able to change the conceptual structure of the database without affecting all users.
  • 30.
    M. Ashad Baloch30 Database Instance The data in the database at any particular point in time is called a database instance. Actual data in database may change frequently. Therefore many database instances correspond to the same database schema. The schema is sometimes called the intension of the database while an instance is called and extension or state of the database.
  • 31.
    M. Ashad Baloch31 Oracle Database Instance • When database is started on database server – Oracle allocates a memory area called system Global Area (SGA) and start one or more processes. – This combination of the SGA and the ORACLE Processes is called an Oracle instance. • Every running Oracle database is associated with at least one Oracle database instance. Because an instance exists in memory and a database exists on disk, an instance can exist without a database and a database can exist without an instance.
  • 32.
    M. Ashad Baloch32 Single instance vs Multiple Instance • A single instance (set of processes) can mount at most one database (set of files). If you need to access multiple databases, you will need multiple instances.
  • 33.
    M. Ashad Baloch33 Oracle Memory Structures • Oracle uses memory to store various information: • program code being executed • information about a connected session, even if it is not currently active • information needed during program execution (for example, the current state of a query from which rows are being fetched) • information that is shared and communicated among Oracle processes (for example, locking information) • cached data that is also permanently stored on peripheral memory (for example, data blocks and redo log entries)
  • 34.
    M. Ashad Baloch34 Oracle Memory Structures • The basic memory structures associated with Oracle include: • Software Code Areas • System Global Area (SGA) • the database buffer cache • the redo log buffer • the shared pool • Program Global Areas (PGA): • the stack areas • the data areas • Sort Areas
  • 35.
    M. Ashad Baloch35 System Global Area • A system global area (SGA) is a group of shared memory structures that contain data and control information for one Oracle database instance. If multiple users are concurrently connected to the same instance, the data in the instance's SGA is "shared" among the users. Consequently, the SGA is sometimes referred to as the "shared global area“. • The SGA contains the following data structures: • the database buffer cache • the redo log buffer • the shared pool • the data dictionary cache • other miscellaneous information
  • 36.
    M. Ashad Baloch36 Database Buffer Cache • The database buffer cache is the portion of the SGA that holds copies of data blocks read from datafiles.
  • 37.
    M. Ashad Baloch37 Redo log buffer • The redo log buffer is a circular buffer in the SGA that holds information about changes made to the database. This information is stored in redo entries. Redo entries contain the information necessary to reconstruct, or redo, changes made to the database by INSERT, UPDATE, DELETE, CREATE, ALTER, or DROP operations. Redo entries are used for database recovery, if necessary. • Redo entries are copied by Oracle server processes from the user's memory space to the redo log buffer in the SGA. The redo entries take up continuous, sequential space in the buffer. The background process LGWR(Log writer) writes the redo log buffer to the active online redo log file (or group of files) on disk.
  • 38.
    M. Ashad Baloch38 Shared Pool • The shared pool portion of the SGA contains three major areas: library cache, dictionary cache, and control structures. • The total size of the shared pool is determined by the initialization parameter SHARED_POOL_SIZE. The default value of this parameter is 3,500,000 bytes. Increasing the value of this parameter increases the amount of memory reserved for the shared pool, and therefore increases the space reserved for shared SQL areas.
  • 39.
    M. Ashad Baloch39 Library Cache • The library cache includes the shared SQL areas, private SQL areas, PL/SQL procedures and packages, and control structures such as locks and library cache handles. • Dictionary Cache: The data dictionary is a collection of database tables and views containing reference information about the database, its structures, and its users. Oracle accesses the data dictionary frequently during the parsing of SQL statements.
  • 40.
    M. Ashad Baloch40 Program Global Area • A program global area (PGA) is a memory region containing data and control information for a single process (server or background). Consequently, a PGA is sometimes called a "process global area." • A PGA is nonshared memory area to which a process can write. One PGA is allocated for each server process; the PGA is exclusive to that server process and is read and written only by Oracle code acting on behalf of that process. • A PGA is allocated by Oracle when a user connects to an Oracle database and a session is created, though this varies by operating system and configuration
  • 41.
    M. Ashad Baloch41 Program Global Area • Stack Space: A PGA always contains a stack space, which is memory allocated to hold a session's variables, arrays, and other information. • Sort Areas: Sorting requires space in memory. Portions of memory in which Oracle sorts data are called sort areas. A sort area exists in the memory of an Oracle user process that requests a sort.
  • 42.
    M. Ashad Baloch42 Software Code Areas • Software code areas are portions of memory used to store code that is being executed or may be executed. Oracle code is stored in a software area that is typically at a different location from users' programs - a more exclusive or protected location.
  • 43.
    M. Ashad Baloch 43 ProcessStructure • A process is a "thread of control" or a mechanism in an operating system that can execute a series of steps. Some operating systems use the terms job or task. A process normally has its own private memory area in which it runs. The process structure of Oracle is important because it defines how multiple activities can occur and how they are accomplished. • For example, two goals of a process structure might be to simulate a private environment for multiple processes to work simultaneously, as though each process has its own private environment to allow multiple processes to share computer resources, which each process needs, but no process needs for long periods of time • The Oracle's process architecture is designed to maximize performance.
  • 44.
    M. Ashad Baloch44 Data Independence A major objective for three-level architecture is to provide data independence. Which means that upper levels are unaffected by changes to lower levels. Two kinds of data independence: 1)Logical Data Independence 2)Physical Data Independence
  • 45.
    M. Ashad Baloch45 Logical Data Independence Logical data independence refers to the immunity (protection) of the external schemas to changes in the conceptual schema. Changes to the conceptual schema such as the addition or removal of new entities, attributes or relationships should be possible without having to change existing external schemas or having rewrite the application programs.
  • 46.
    M. Ashad Baloch46 Physical Data Independence Physical data independence refers to the immunity of the conceptual schema to changes in the internal schema. Changes to the internal schema such as using different file organizations or storage structures, using different storage devices, modifying indexes or hashing algorithms should be possible without having to change the conceptual or external schema.
  • 47.
    47 Database Languages A datasublanguage consists of two parts: 1)Data Definition Language (DDL) 2)Data Manipulation Language (DML) These languages are called data sublanguages because they do not include constructs (conditional or iterative statements) for all computing needs, which are provided by HLL.
  • 48.
    M. Ashad Baloch48 The levels where the Conceptual and Physical data independence are effective
  • 49.
    M. Ashad Baloch49 Database Languages-I Many DBMS have a facility for embedding the sublanguage in a high level programming language such as COBOL, Fortran, PASCAL, C, C++, Java, Visual Basic. In this case high level language refer to as the host language.
  • 50.
    M. Ashad Baloch50 The Data Definition Language (DDL) A language that allows the DBA or user to describe and name the: Entities Attributes Relationships Integrity and Security Constraints.
  • 51.
    M. Ashad Baloch51 The Data Manipulation Language (DML) Data manipulation operations usually include the following: •Insertion of new data into the database •Modification of data stored in the database •Retrieval of data contained in the database •Deletion of data from the database
  • 52.
    52 DML Types Two Typesof DML: 1)Procedural DML 2)Non Procedural DML Procedural language specify how the output of DML statement must be obtained. While the non-procedural DMLs describe only what output to be obtained. Procedural language treat records individually, while non-procedural languages operate on set of records.
  • 53.
    M. Ashad Baloch53 Functions of DBMS 1) Data Storage, retrieval and update A DBMS must furnish users with the ability to store, retrieve and update data in the database. 2) A user accessible catalog A DBMS must furnish a catalog in which descriptions of data items are stored and which is accessible to users.
  • 54.
    M. Ashad Baloch54 Functions of DBMS-I 3) Transaction Support A DBMS must furnish a mechanism which will ensure that all the updates corresponding to a given transaction are made or that none of them is made. 4) Concurrency control services A DBMS must furnish a mechanism to ensure that the database is update correctly when multiple users are updating the database concurrently.
  • 55.
    M. Ashad Baloch55 Functions of DBMS-II 5) Recovery Services A DBMS must furnish a mechanism for recovering the database in the event that the database is damaged in any way. 6) Authorization Services A DBMS must furnish a mechanism to ensure that only authorized users can access the database.
  • 56.
    M. Ashad Baloch56 Functions of DBMS-III 7) Support for data communication A DBMS must be capable of integrating with communication software. 8) Integrity services A DBMS must furnish a means to ensure that both the data in the database and changes to the data follow certain rules.
  • 57.
    M. Ashad Baloch57 Functions of DBMS-IV 9) Services to support data independence A DBMS must include facilities to support the independence of programs from the actual structure of the database.
  • 58.
    M. Ashad Baloch58 Functions of DBMS-V 10) Utility Services A DBMS should provide a set of utility services. •Import and Export facilities •Monitoring database facilities •Examine database performance
  • 59.
    M. Ashad Baloch59 DBMS Environments Single User Database Environment The database environment which supports only one user accessing the database at a specific time. The DBMS might have a number of users but at a certain time only one user can log into the database system and use it. This type of DBMS systems are also called Desktop Database systems.
  • 60.
    M. Ashad Baloch60 DBMS Environments-I Multi-User Database systems The DBMS which can support a number of users simultaneously interacting with the database indifferent ways. A number of environments exist for such DBMS. – Teleprocessing – File Servers – Client-Server
  • 61.
    M. Ashad Baloch61 Teleprocessing This type of Multi user database systems processes the user requests at a central computer, all requests are carried to the central computer where the database is residing, transactions are carried out and the results transported back to the terminals (literally dumb terminals). It has become obsolete now.
  • 62.
    M. Ashad Baloch 62 FileServers • This type of multi-user database environment assumes another approach for sharing of data for different users. • A file server is used to maintain a connection between the users of the database system. • Each client of the network runs its own copy of the DBMS and the database resides on the file server. • Now whenever a user needs data from the file server it makes a request the whole file containing the required data was sent to the client. • At this stage it is important to see that the user has requested one or two records from the database but the server sends a complete file, which might contain hundreds of records. • Now if the client after making the desired operation on the desired data wants to write back the data on the database he will have to send the whole file back to the server, thus causing a lot of network overhead. • The Good thing about this approach is that the server does not have lots of actions to do.
  • 63.
    M. Ashad Baloch63 Client-Server This type of multi-user environment is the best implementation of the network and DBMS environments. It has a DBMS server machine which runs the DBMS and to this machine are connected the clients having application programs running for each user. Once a users wants to perform a certain operation on data in the database it sends its requests to the DBMS through its machine’s application software; the request is forwarded to the DBMS server which performs the required operation on data in the database stored in the computer and then passes back the result to the user intending the result. This environment is best suited for large enterprises where bulk of data is processed and requests are very much frequent.