Presentation is loading. Please wait.

Presentation is loading. Please wait.

Text Book Database System Concepts- Silberschatz, Korth, Sudarshan, Fifth Edition, McGraw Hill.

Similar presentations


Presentation on theme: "Text Book Database System Concepts- Silberschatz, Korth, Sudarshan, Fifth Edition, McGraw Hill."— Presentation transcript:

1 Text Book Database System Concepts- Silberschatz, Korth, Sudarshan, Fifth Edition, McGraw Hill

2 Basic Concepts Data Database Database Systems Database Management System

3 Data : It is a raw fact. E.g. 20 The collection of data referred to as the database, contains information relevant to an enterprise. E.g. banking: for customer information, accounts, loans etc. University : students, course registration,grades etc.

4 Database systems are designed to manage large bodies of information. It includes both defining structures for storage of information and providing mechanisms for manipulation of information. It must ensures the safety of the information stored. DBMS is set of programs to access data.

5 Advantages of DBMS over File Systems By storing data in a DBMS rather than as a collection of operating system files, one can use the DBMS features to manage the data in robust and efficient manner.

6 File processing system has a number of major disadvantages : Data redundancy and inconsistency : since different programmers create the files, the various files are likely to have different format. The same information may be duplicated in several files. E.g. address and telephone no of particular customer may appear in file that consist of saving account records and in file that consist of checking account records. It leads to higher storage.

7 It may also lead to inconsistency i.e. various copies of the same data may no longer agree. E.g. a changed customer address may be reflected in saving account records but not elsewhere in the system.

8 Difficulty in accessing data:- E.g. bank officer needs to find out names of all customers who live within a particular postal code area. Because the designer of the system did not anticipate this request, there is no application program on hand. But there is an application program to generate list of all customers. There are two choices before officer: obtain list of all customer and extract information manually or ask the system programmer to write necessary application program.

9 Data isolation:- because data are scattered in various files, and files may be in different format, writing new application programs to retrieve the appropriate data is difficult. Files with different format get isolated. Integrity :- Constraints are not provided. E.g. if -10 is entered in balance field, it will not be recognized as wrong amount by file system.

10 Atomicity:- in many applications, it is crucial that, if a failure occurs, the data to be restored to the consistent state that existed prior to the failure. The transaction must happen in its entirety or not at all. It is difficult to ensure this in file processing e.g. transfer of money from one account to another account.

11 E.g. program of transferring Rs. 500 from account A to account B. If a system failures occurs during the execution of the program, it is possible that the Rs. 500 was removed from account A but was not credited to account B, resulting in an inconsistent database state. (either both (debit/ credit) or none should occur)

12 Concurrent access anomalies :-many systems allow multiple users to update the data simultaneously. System must maintain some form of supervision for this. But it is very difficult to implement using file processing system. problems of read- write operation.

13 E.g. consider bank account A, containing Rs.500. If two customers withdraw funds (Rs.50 and Rs.100 respectively) at about same time, the result of concurrent executions may leave the account in an incorrect state. If two programs run concurrently, they may both read the value 500,and write back Rs.450 and Rs.400 respectively. Depending on which one writes the value last, the account may contain either Rs.450 or Rs.400, rather than Rs.350.

14 Security problems :Every user of the database system should not be able to access all the data. It is very difficult to enforce such security problem in file processing system

15 View of Data -Three levels of Abstraction / Three level Architecture A major purpose of a database system is to provide users with abstract view of the data. i.e. the system hides certain details of how the data are stored and maintained.

16 Physical level (Internal level):- How the data is actually stored in the database. Logical level (Conceptual level): describes what data are stored in database and what relationships exist among those data. (like what is the datatype etc.) DBAs, who must decide what information to keep in the database use the logical level of abstraction.

17 View level (External level) :- highest level of abstraction. It describes only part of the entire database. Many users of the database system do not need all information; instead they need to access only a part of the database. The system may provide many views for the same database. E.g. tellers ( cashier) in bank see only that part of the database that has information on customer accounts; they can not access information about salaries of employees.

18 Physical independence: The physical level may be modified independently of the conceptual level. This means that the user cannot see all the hardware components of the database, which is simply a transparent structure for representing the stored information. Examples

19 Logical independence: The conceptual level must be editable without disrupting the physical level. In other words, the database's administrator must be able to make improvements without affecting the users' experience Examples

20 Instances & Schemas The collection of information stored in the database at a particular moment is called an instance of the database. The overall design of the database is called database schemas.

21 Physical Schema:- Describes the database design at the physical level. Logical Schema:- Describes the database design at the logical level. Subschema:- describes different views of the database.

22 Structure of DBMS The functional components of a database system can be broadly divided into : Storage Manager Query Processor

23 Storage manager is important because databases require a large amount of storage space. The query processor is important because it helps the database system simplify and facilitate access to data.

24 1.Storage manager: Is a program module that provides the interface between the low level data stored in the database and the application programs and queries submitted to the system. Is responsible for storing, retrieving and updating data in the database.  Components of storage manager: Authorization & Integrity manager: tests for the satisfaction of integrity constraints (incorrect data like balance = -10) and checks the authority of users to access data.

25 Transaction Manager: Which ensures that the database remains in a consistent (correct) state despite system failure, and that concurrent transaction executions proceed without conflicting. File Manager: Manages allocation of space on the disk storage. Buffer Manager: responsible for fetching data from disk storage to main memory.

26 Storage manager implements several data structure as a part of the physical system implementation: Data files : stores database itself Data dictionary : Stores metadata about the structure of the database, the schema of the database. Indices : which provides fast access to data items that hold particular values e.g. book index

27 2. Query Processor: Compiles & Executes DDL and DML statements [DDL : Database schema specified by a set of definitions expressed by a special language called Data Definition Language. ] DDL Interpreter: Interprets DDL statements and records the definitions into data dictionary. [DML : (Data Manipulation language) language that enables users to access or manipulate data, like Retrieval, Insertion, Deletion, Modification.] DML Compiler: Translates DML into query evaluation plan (low level instructions) Query evaluation engine : executes low-level instructions generated by the DML compiler.

28 Overall Architecture / Structure of DBMS Three levels : Physical level, Logical Level, View level Storage manager (Authorization & Integrity manager, Transaction Manager, File Manager, Buffer manager) Query Processor (DDL Interpreter, DML Compiler, Query evaluation engine )

29 Difference between two-tier and three tier architecture In two tier architecture, the application is partitioned into components that resides at the client machine, which invokes database system functionality at the server machine through the query language statements. In three tier architecture, the client machine acts as merely a front end and does not contain any direct database calls. The client end communicates with application server. The business logic of the application is embedded in the application server, instead of being distributed across multiple client.

30

31 Data Models Structure of the database is the Data Model Provides a way to describe the design of a database at the physical, logical, and view level. Relational Model:- Uses collection of tables to represent both data and the relationships among those data. Relational Model is an example of a record based model The database structured in fixed format records of several types.

32 The ER model:- Consists of a collection of basic objects, called entities and of relationships among those entities. Object based data model:- ER model with notions of encapsulation, methods and object identity. Combines features of Object Oriented Data Model and Relational Data Model. Semi-structured data model:- permits the specification of data where individual data items of the same type may have different set of attributes. XML can be used to represent semistructured data.

33 Database Languages A database system provides a data definition language to specify the database schema and a data-manipulation language to express database queries and updates. DDL : database schema. creation of table. Constraints are also provided. (create, alter, drop) DML: Retrieval, insertion, deletion, modification. (Data within structure)

34 Procedural DML : require a user to specify what data are needed and how to get those data. PL/SQL Declarative (nonprocedural) DML: require a user to specify what data are needed without specifying how to get those data. SQL

35 Query : statement requesting retrieval of information. The portion of DML that involves information retrieval is called query language. Metadata:- Data about Data. Example. It provides information about a certain item's content. For example, an image may include metadata that describes how large the picture is, the color depth, the image resolution and other data.

36 Database Users Naive users: - they interact with the system by invoking one of the application programs that have been written previously. E.g. a user who wishes to find her account balances over WWW. Application programmers:- they are computer professionals who write the application programs. They can choose from many tools to develop interface.

37 Sophisticated users:-interact with the system without writing the programs. They form their request in database query language. They submit each such query to query processor. Specialized users: - they write specialized database applications that do not fit into the traditional data-processing framework. Among these applications are computer-aided design systems, expert system etc.

38 DBA Role of DBA Schema definition: - DBA cerates the original database schema by executing a set of data definition statements in the DDL. DBA defines storage structure and access methods

39 Schema and physical organization modification:- The DBA carries out changes to the schema and physical organization to reflect the changing needs of the organization. He alters the physical organization to improve the performance. Granting of authorization for data access:-DBA can regulate which parts of the database various users can access. Routine maintenance: - taking backup of database ensures free disk space availability, monitors job running on the database etc

40

41 Components of DBMS Data Hardware Software Users Storage manager Query Processor

42 Questions Definitions: Data, Database, DBMS, Information, Instance, Schemas, DML, DDL Give 10 examples of Database-System Applications. Write down the advantages of DBMS over File System. Explain different views of data. Which are the different types of Data Models are available? Explain. Write a short note on Overall Architecture / Structure of DBMS. List down the functions carried out by the DBA OR Role of DBA


Download ppt "Text Book Database System Concepts- Silberschatz, Korth, Sudarshan, Fifth Edition, McGraw Hill."

Similar presentations


Ads by Google