DBA Structure
DBA Structure
Architecture
File-based approach
Files
Customer
Files
Applications File
Applications Customer
Customer
Orders
Stock
File
File
Order
Customer
File Orders
Stock
Customer
File
File
Customer
Customer Stock Invoicing
Invoicing File
Order
Order
File
File
Purchase
Stock
File Orders
Purchase Supplier
Orders
Supplier File
File
2
Stock
File
Stock
Stock Control
Control
Order
File
Shared file approach
File-based Approach
Shared File Approach
Data (files) is shared between different applications
Data redundancy problem is alleviated
Data inconsistency problem across different versions of the same file is
solved
Other problems:
Rigid data structure: If applications have to share files, the file
structure that suits one application might not suit another
Physical data dependency: If the structure of the data file needs to
be changed in some way, this alteration will need to be reflected in
all application programs that use that data file
3
No support of concurrency control: While a data file is being
processed by one application, the file will not be available for other
applications or for ad hoc queries
Database Approach
4
Database Approach
Data
Known facts that can be recorded and that have implicit
meaning
Information? Knowledge?
Database: Shared collection of logically related data and a
description of this data, designed to meet the information
needs of an organization
5
Database Approach
System catalog (metadata) provides description of data to enable
program–data independence
6
Database Approach
DBMS components:
9
DDL Compiler:
Data Description Language compiler processes schema
definitions specified in the DDL.
It includes metadata information such as the name of the
files, data items, storage details of each file, mapping
information and constraints etc.
DML Compiler and Query optimizer:
The DML commands such as insert, update, delete,
retrieve from the application program are sent to the DML
compiler for compilation into object code for database
access.
The object code is then optimized in the best way to
execute a query by the query optimizer and then send to
the data manager.
Data Manager:The Data Manager is the central software
component of the DBMS also knows as Database Control
System.
The Main Functions Of Data Manager Are:
Convert operations in user's Queries coming from the
application programs or combination of DML Compiler
and Query optimizer which is known as Query Processor
from user's logical view to physical file system.
Controls DBMS information access that is stored on disk.
It also controls handling buffers in main memory.
Italso enforces constraints to maintain consistency and
integrity of the data.
Italso synchronizes the simultaneous operations
performed by the concurrent users.
It also controls the backup and recovery operations.
Data Dictionary:
Data Dictionary, which stores metadata about the
database, in particular the schema of the database.
names of the tables, names of attributes of each table,
length of attributes, and number of rows in each table.
Detailed information on physical database design such as
storage structure, access paths, files and record sizes.
Usage statistics such as frequency of query and
transactions.
Data dictionary is used to actually control the data
integrity, database operation and accuracy. It may be
used as a important part of the DBMS
Data Files:
Which store the database itself.
Compiled DML:
The DML complier converts the high level Queries into low level
file access commands known as compiled DML.
End Users:
The second class of users then is end user, who interacts with
system from online workstation or terminals.
Use the interface provided as an integral part of the database
system software.
User can request, in form of query, to access database either
directly by using particular language, such as SQL, or by using
some pre-developed application interface.
Such request are sent to query evaluation engine via DML pre-
compiler and DML compiler
The query evaluation engine accepts the query and analyses it.
It finds the suitable way to execute the compiled SQL
statements of the query.
Finally, the compiled SQL statements are executed to perform
the specified operation
Query Processor Unit: Interprets DDL statements into a set of tables
containing metadata.
Translates DML statements into low level instructions that the query
evaluation engine understands.
Converts DML statements embedded in an application program into
procedure calls in the host language.
Executes low level instructions generated by DML compiler.
DDL Interpreter
DML Compiler
Embedded DML Pre-compiler
Query Evalution Engine
Storage Manager Unit checks the authority of users to access data.
Checks for the satisfaction of the integrity constraints.
Preserves atomicity and controls concurrency.
Manages allocation of space on disk.
Three-Schema Architecture and
Data Independence
15
DBA should be able to change conceptual structure of database without
affecting all users
Three-level architecture and data independence
16
External Level
Users’ view of the database
Describes that part of database that is
relevant to a particular user
Conceptual Level
Community view of the database
Describes what data is stored in database
and relationships among the data
17
Internal Level
Physicalrepresentation of the database on the
computer.
Describes how the data is stored in the database
18
Three-Schema Architecture and
Data Independence
19
Data Independence is the capacity to change the schema at
one level of a database system without having to change the
schema at the next higher level
Logical Data Independence
Refersto immunity of external schemas to changes in
conceptual schema
Conceptual schema changes (e.g. addition/removal of
entities) should not require changes to external schema or
rewrites of application programs
20
Physical Data Independence
Refers to immunity of conceptual schema to changes
in the internal schema
Internal schema changes (e.g. using different file
organizations, storage structures/devices) should not
require changes to conceptual or external schemas
21
Three-Schema Architecture and
Data Independence
22
Database Languages
Data Definition Language (DDL) allows the DBA or user to
describe and name entities, attributes, and relationships
required for the application plus any associated integrity and
security constraints
23
granting privileges to users, and defining when proposed
changes to a databases should be irrevocably made