Beruflich Dokumente
Kultur Dokumente
Module - 1
Transaction management:
Concurrency Control: Recovery Management: Security Management: Language Interface: Storage Management:
Page 2
Transaction management
A transaction is a sequence of database operations that represents a logical unit of work and that accesses a database and transforms it from one state to another. For e.g. consider a database that holds information about airline reservations
Several travel agents look up information about available seats on various flights and make new seat reservation When several users access a database concurrently, DBMS must order their requests carefully to avoid conflicts. DBMS must protect users from the effects of system failures by ensuring that all data is restored to a consistent state
Page 3
Concurrency Control
This is the database management activity of coordinating the actions of database manipulation processes that operate concurrently that access shared data and potentially interfere with one another
To schedule concurrent accesses to data so that each user can safely ignore the fact that others are accessing the data concurrently
DBMS allows users to think of their programs as if they were executing in isolation Locking protocol a set of rules to be followed by each transaction Lock mechanism used to control access to database objects Shared LOCK - Data item can only be read
Page 4
Recovery Management
This in a database ensures the aborted or failed transactions (system crash) create no adverse effects on the database or the other transactions
DBMS must ensure that the changes made by such incomplete transactions are removed from the database
DBMS maintains a log of all writes to the database. Each write action must be recorded in the log before the corresponding change is reflected in the database itself. Property is called Write-Ahead Log or WAL
Page 6
Structure of a DBMS
Page 7
Application programmers
Application Programs Embedded DML pre compiler
users
DDL interpreter
Query processor
Transaction manager
Buffer manager
Storage manager
Disk storage
Page 8
Page 9
Page 10
DML compiler
Translates DML statements in a query language into low level instructions that the query evaluation engine understands.
Page 11
DDL interpreter
Interprets DDL statements and records them in a set of tables containing metadata
Page 12
Transaction manager
Ensures that the database remains in a consistent state despite system failures.
Page 13
File manager
Manages the allocation of space on disk storage and the data structures used to represent information stored on disks.
Buffer manager
Responsible for fetching data from disk storage into main memory and deciding what data to cache in memory.
Page 14
Statistical data- stores statistical information about the data in the database.
Page 15
Database languages
DDL (Data definition language) DML (Data manipulation language) SDL (Storage Definition Language) VDL (View Definition Language)
Page 16
Database schema is specified by a set of definitions which are expressed by a special language called DDL.
Result of compilation of DDL statements is a set of tables which are stored in a special file called data dictionary.
Page 17
create table branch (branch-name char(15) not null, branch-city char(30), assets integer) DROP TABLE employees; ALTER TABLE sink ADD bubbles INTEGER; ALTER TABLE sink DROP COLUMN bubbles;
Page 18
Data Dictionary
It is a file that contains metadata.
i.e. data about data includes the names and descriptions of various tables and fields in each database, plus additional details, like the type and length of each data element
Page 19
select A1, A2, ..., An from r1, r2, ..., rm where P Insert into table tablename values (d1,d2..); Delete from table tablename where condition ; Update command
Page 20
Page 21
Page 22
VDL (View Definition Language): is used to specify user views and their mappings to the conceptual schema.
Most DBMSs use DDL to specify both conceptual and external schema
Page 23
Query language
The portion of a DML that involves information retrieval Data sublanguage: DML & DDL when embedded within a host language (e.g C or COBOL)
Page 24
Page 25
unsophisticated users interacting with system by invoking one of the application programs that ve been written previously. e.g bank teller transfers $50 from account A to B by invoking a program called transfer
Page 26
Application programmers computer professionals who write application programs like transfer. Sophisticated users interact without writing programs. They form their requests in query language. Specialized users sophisticated users who write specialized database applications. E.g CAD systems and Expert systems
Page 27
Database Administrator
A person who has a central control over the system is called a DBA
Page 28
Functions of DBA
Schema Definition
DBA creates the original database schema by executing data definition statements in DDL
Page 29
DBA makes changes to the schema and physical organization to reflect the changing needs of the organization
To ensure adequate performance as requirements change Also known as database tuning
Page 30
DBA is responsible for ensuring that unauthorized data access is not permitted DBA grants different types of authorization by which DBA regulates which parts of the database various users can access.
Page 31
Routine maintenance
Periodically backing up the database
Maintains logs of system activity To facilitate recovery from a crash Ensuring that enough free disk space is available for normal operations Monitoring jobs running on the database and ensuring its performance
Page 32
END
Page 33