+ All Categories
Home > Documents > Dbms Presentation

Dbms Presentation

Date post: 15-Apr-2016
Category:
Upload: ayushi
View: 35 times
Download: 2 times
Share this document with a friend
Description:
data based management system
43
DBMS DATABASE MANAGEMENT SYSTEM (Concept, Components of DBMS, Characteristics of well designed DBMS, File System(Introduction & Problems), Types of DBMS, Hierarchical Models, Network Models, Relational Model, Introduction to ERD)
Transcript

DBMS

DBMSDATABASE MANAGEMENT SYSTEM(Concept, Components of DBMS, Characteristics of well designed DBMS, File System(Introduction & Problems), Types of DBMS, Hierarchical Models, Network Models, Relational Model, Introduction to ERD)

What is a Database? A database is any organized collection of data. Some examples of databases you may encounter in your daily life are: a telephone book T.V. Guide airline reservation system motor vehicle registration records papers in your filing cabinet files on your computer hard drive.

Database ManagementDatabase management is the process of storing data efficiently on the computer, keeping it updated, manipulating and processing it and making the information readily accessible (Skeete, 2004). A database management system is a collection of programs that enable you to store, modify, and retrieve information from a database.Data Data is nothing but a random, unorganized collection of indications or measurements of certain qualities or attributes relating to an entity, recorded either in alphabetical, numerical, alphanumerical, voice, image, text or any other form. Examplesperson namestelephone numbers salaries addresses

Data ProcessingInformation, according to Davis and Olson, is data that has been processed into a form that is meaningful to the recipient and is of real or perceived value in current or prospective actions or decisions.ProcessingDataInformationData ProcessingCapturing Data from an event/transaction has to be recordedVerifying Data has to be checked/validated for correctnessClassifying Data has to be placed in specific categoriesArranging/Sorting Data has to be placed in a particular order/sequenceSummarizing Data elements have to be combined/aggregatedCalculating Arithmetical/Logical calculations/computations have to be carried outStoring Data has to be placed in some specific mediaRetrieving Specific data elements have to be searched for and accessedReproducing Data has to be duplicated from one medium to anotherDissemination/Communication Data has to be transmitted from one place (device) to another (user)Data vs. Information: What is the difference?What is data?Data can be defined in many ways. Information science defines data as unprocessed information.What is information?Information is data that have been organized and communicated in a coherent and meaningful manner. Data is converted into information, and information is converted into knowledge.Knowledge; information evaluated and organized so that it can be used purposefully.

Characteristics of InformationIt improves representation of an entity;It updates the level of knowledge;It reduces the uncertainty;It aids in Decision Making; etc.Why do we need a Database?Keep records of our:ClientsStaffVolunteersTo keep a record of activities and interventions;Keep sales records;Develop reports;Perform research; etc.

Purpose of Database SystemsIn the early days, database applications were built directly on top of file systemsDrawbacks of using file systems to store data:Data redundancy and inconsistencyMultiple file formats, duplication of information in different filesDifficulty in accessing data Need to write a new program to carry out each new taskData isolation multiple files and formatsIntegrity problemsIntegrity constraints (e.g. account balance > 0) become buried in program code rather than being stated explicitlyHard to add new constraints or change existing onesPurpose of Database Systems (Cont.)Drawbacks of using file systems (cont.) Atomicity of updatesFailures may leave database in an inconsistent state with partial updates carried outExample: Transfer of funds from one account to another should either complete or not happen at allConcurrent access by multiple usersConcurrent accessed needed for performanceUncontrolled concurrent accesses can lead to inconsistenciesExample: Two people reading a balance and updating it at the same timeSecurity problemsHard to provide user access to some, but not all, dataDatabase systems offer solutions to all the above problemsWhat is the ultimate purpose of a Database Management System?DataInformationKnowledgeActionIs to transformDBMS-ConceptCollection of interrelated dataSet of programs to access the data DBMS contains information about a particular enterpriseDBMS provides an environment that is both convenient and efficient to use.Database Applications:Banking: all transactionsAirlines: reservations, schedulesUniversities: registration, grades

Sales: customers, products, purchasesManufacturing: production, inventory, orders, supply chainHuman resources: employee records, salaries, tax deductionsDatabases touch all aspects of our livesDBMS-DefinitionDBMS is basically a software which performs the functions of defining, creating, revising and controlling the database.

DBMS is a specially designed software to create and maintain a database and enable individual business applications to extract the data they need without having to create separate files in their computer programs.DBMS-illustration

Components of DBMSTransaction ManagementEnsuring AtomicityConcurrency ControlRecovery ManagementSecurity ManagementLanguage InterfaceStorage ManagementDatabase Catalog Management

Transaction ManagementA 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. A transaction can update, Delete or modify a single or a set of records. When the DBMS does a commit ,the changes made by the transaction made permanent. If the changes are not to be made permanent , the transaction can be rolled back and the database will remain in its original state.Ensuring AtomicityDBMS ensures atomicity (all-or-nothing property) even if system crashes in the middle of a transaction.Keep a log (history) of all actions carried out by the DBMS while executing a set of transactions:Before a change is made to the database, the corresponding log entry is forced to a safe location. After a crash, the effects of partially executed transactions are undone using the log. (If log entry wasnt saved before the crash, corresponding change was not applied to database!)All log related activities are handled transparently by the DBMS.

Concurrency ControlConcurrency Control is the database management activity of coordinating the actions of database manipulation process that operates concurrently that access shared data and can potentially interface with one another. The goal of an ideal concurrency management mechanism is to allow concurrency while maintaining the consistency of the share data. Concurrency ControlConcurrent execution of user programs is essential for good DBMS performance.Because disk accesses are frequent, and relatively slow, it is important to keep the CPU humming by working on several user programs concurrently.Interleaving actions of different user programs can lead to inconsistency: e.g., check is cleared while account balance is being computed.DBMS ensures such problems dont arise: users can pretend they are using a single-user system.Scheduling Concurrent TransactionsDBMS ensures that execution of {T1, ... , Tn} is equivalent to some serial execution T1 ... Tn.Before reading/writing an object, a transaction requests a lock on the object, and waits till the DBMS gives it the lock. All locks are released at the end of the transaction. (locking protocol.)E.g: If an action of Ti (say, writing X) affects Tj (which perhaps reads X), one of them, say Ti, will obtain the lock on X first and Tj is forced to wait until Ti completes; this effectively orders the transactions.Recovery ManagementEnsures that aborted or failed transaction do not create an adverse effect on the database or the other transactions. It also ensures that the database is returned to a consistent state after a transaction fails or abort. Recovery is related to concurrency---more the concurrency the more is the chance that an aborted transaction can affect many other transactions.Security Management Refers to the protection of data against unauthorized access---only authorized users are given access to the data in the database. The level of access for each user and the type of operation the user can perform on data will depend on the access privileges of the users.Language InterfaceProvides support languages used for the definition and manipulation of data in the database.Storage ManagementThe DBMS provides a mechanism for management of permanent storage of data. The internal schema defines how the data should be stored by the storage management mechanism and the storage manager interfaces with the operating system to access the physical storage.Data Catalog ManagementData Catalog or Data Dictionary is a system database that contains description of data in the database. It contains information about data, relationships, constraints and the entire schema that organize these features into a unified database. The data catalog can be queried to get information about the structure of the database.Characteristics of Well Designed DBMSThe DBMS helps in reducing the complexity in the systems environment due to the central control/management of data, access, utilization and security.As same data elements are not repeated in all the files, DBMS helps reduce/eliminate data redundancy and inconsistency and promotes data integrity throughout the system/organization.DBMS helps increase access and availability of/ to information.

The DBMS provides for central control of data creation and definition, thereby reducing/ eliminating data confusion.DBMS helps in bringing about substantial reduction in the costs related with program development and maintenance.DBMS helps separate logical view and physical arrangement, thereby, reducing program-data dependence.DBMS, particularly the RDBMS, permits ad-hoc queries, thereby ensuring flexibility of information system.Structure of a DBMSA typical DBMS has a layered architecture.This is one of several possible architectures; each system has its own variations.Query Optimizationand ExecutionRelational OperatorsFiles and Access MethodsBuffer ManagementDisk Space ManagementDBThese layersmust considerconcurrencycontrol andrecovery22Database LanguagesData Definition Language (DDL) define relation, schemes and constraints.Data Manipulation Language (DML)insert, update, delete, retrieve.Procedural - tell the system what and how to get itnon-procedural (declarative) tell the system what, not howData Control Language (DCL) security,accessibilityExample - The SQL or Structured Query Language, is, presently, the most prominent and popular database language used.Sophisticated languages for managing database systems are called fourth-generation languages, or 4GLs for short.DBMS Approach

DatabaseFile System approachDBMS approachDatabase Management Systems33Data Definition Language (DDL)Specification notation for defining the database schemaExample:create table account ( account_number char(10), branch_name char(10), balance integer)DDL compiler generates a set of tables stored in a data dictionaryData dictionary contains metadata (i.e., data about data)Database schema Data storage and definition language Specifies the storage structure and access methods usedIntegrity constraintsDomain constraintsReferential integrity (e.g. branch_name must correspond to a valid branch in the branch table)AuthorizationData Manipulation Language (DML)Language for accessing and manipulating the data organized by the appropriate data modelDML also known as query languageTwo classes of languages Procedural user specifies what data is required and how to get those data Declarative (nonprocedural) user specifies what data is required without specifying how to get those dataSQL is the most widely used query languageAn ExampleThe Wine Cellar Database:Cellar:

Retrieval:DML (Data Manipulation Language): SELECT Wine, Bin, Producer FROM Cellar WHERE Ready = 85;

Result:

2 Chardonnay Buena Vista 83 1 85 3Chardonnay Louis Martini 81 5 84 6 Chardonnay Chappellet 82 4 85 Thanksgiving12 Jo. Riesling Buena Vista 82 1 83 Late Harvest16 Jo. Riesling Sattui 82 1 83 Very dry43 Cab. Sauvignon Robt. Mondavi 77 12 8750 Pinot Noir Mirassou 77 3 85 Harvest51 Pinot Noir Ch. St. Jean 78 2 86 Bin Wine Producer Year Bottle Ready Comments Wine Bin ProducerChardonnay 2 Buena VistaChardonnay 6 ChappelletPinot Noir 50 MirassouAn Example (cont.)Deletion: DML: DELETE FROM Cellar WHERE Ready < 86; Result:

Insertion: DML: INSERT INTO Cellar VALUES (53, 'Pinot Noir', 'Franciscan', 79, 1, 86, 'for Joan');Result:1-3743 Cab. Sauvignon Robt. Mondavi 77 12 8751 Pinot Noir Ch. St. Jean 78 2 86 Bin Wine Producer Year Bottle Ready Comments43 Cab. Sauvignon Robt. Mondavi 77 12 8751 Pinot Noir Ch. St. Jean 78 2 8653Pinot NoirFranciscan79 186for Joan Bin Wine Producer Year Bottle Ready CommentsAn Example (cont.)UpdateDML: UPDATE Cellar SET Bottles = 4WHERE Bin = 51;Result:

1-3843 Cab. Sauvignon Robt. Mondavi 77 12 8751 Pinot Noir Ch. St. Jean 78 4 8653Pinot NoirFranciscan 79 186 for Joan Bin Wine Producer Year Bottle Ready CommentsData Types

File Based SystemThe typical file-processing system is supported by a conventional operating system. Permanent records are stored in various files, and different application programs are written to extract records from, and to add records to, the appropriate files. Before the advent of DBMSs, organizations typically stored information using such systems.

Data redundancy and inconsistencyDifficulty in accessing dataData isolationIntegrity problemsAtomicity Problems (transaction failure-rolled back)Concurrent-access anomaliesSecurity Problems

Advantages of DBMS over File-Processing System

Disadvantages of Using a DBMS

Confidentiality, Privacy and Security (centralized information) Data Quality (multi users-damage of data) Data Integrity (concurrency-accuracy)Enterprise Vulnerability (centralized-unauthorized access of data)The Cost of Using a DBMS (installation cost) Experts (specialised personnel)

Levels of AbstractionPhysical level: describes how a record (e.g., customer) is stored.Logical level: describes data stored in database, and the relationships among the data.type customer = recordcustomer_id : string; customer_name : string;customer_street : string;customer_city : string;end;View level: application programs hide details of data types. Views can also hide information (such as an employees salary) for security purposes.

File-3

File-2

File-1

program-3

data description-3

program-2

data description-2

program-1

data description-1

Description

Manipulation

Control

. .

.

Application program-3

with data semantics

Application program-2

with data semantics

Application program-1

with data semantics


Recommended