Module 7 Database Management Systems Processes and Services Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Learning Objectives Identify the services provided by a database management system Examine the catalog feature in a DBMS Describe the concurrent update problem Explain the data recovery process in a database environment Describe security services Examine data integrity features Discuss data independence Define and describe data replication Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Create, Read, Update, and Delete Data A relational database system allows users to create, read, update, and delete data in a database • Sometimes referred to with the acronym CRUD • Map to the SQL keywords and common HTTP methods HTTP (Hypertext Transfer Protocol) is a protocol for passing webpages, resources, and data through the web HTTP methods do not communicate directly with a database • Identify the action to perform on a particular resource and help pass data to that resource Solution stacks are a set of software components, that are well documented and have a proven track record of working well together Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Provide Catalog Services (1 of 2) A database catalog is maintained automatically by the relational database system, and contains table and field metadata, data about the data The catalogs for many database management systems consist of a set of special tables included in the database • They are typically hidden tables • In some cases, the DBA (database administrator) may want to access them to see or create documentation Catalog services in Microsoft Access • The Database Documenter feature creates a catalog report • The Relationship report creates a compact report showing the table names, field names, and relationships between the tables Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Provide Catalog Services (2 of 2) Catalog services in enterprise database management systems • Some enterprise-level systems as Oracle and Db2 refer to the catalog as the data dictionary, a read-only set of tables • The data dictionary is a critical communication tool for database analysts, application developers, and database administrators • You use SQL statements to access the data in the data dictionary, just as you would any other table or view the database Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Support Concurrent Updates (1 of 4) Concurrent update occurs when multiple users make updates to the same database at the same time Microsoft Access allows for multiple users to retrieve, enter, and update data in the same database file at the same time • Data is not locked at the file level, but rather, at the record level • Two or more users can simultaneously work in the same database file, but they cannot simultaneously enter or update the same record • When a particular record is locked for editing, a pencil symbol is displayed to the left of the record Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Support Concurrent Updates (2 of 4) Enterprise database management systems have many users across wide area networks that must deal with concurrent updates in large volumes • Private networks are sometimes established to secure internal database applications • If the application is used on the web or communicates with outside users and processes, additional complexities arise Data concurrency and data consistency for all transactions are key issues • Data concurrency means many users can access data at the same time • Data consistency means that each user sees a consistent view of the data, including real-time changes made by others Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Support Concurrent Updates (3 of 4) Oracle processes transactions in a series of steps that maintain data consistency by preventing three types of database concurrency problems: • Dirty reads • Nonrepeatable (fuzzy) reads • Phantom reads (or phantoms) ACID (atomicity, consistency, isolation, durability) defines a set of properties for a transaction that guarantees its success even in the event of a problem or interruption in the process Two common techniques for maintaining concurrency control are two-phase locking and timestamping Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Support Concurrent Updates (4 of 4) Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Recover Data (1 of 5) Recovery is the process of returning a database that has encountered some sort of problem to a state known to be correct • Periodic backups: an entire copy of the database created at a specific point in time Microsoft Access provides two features to help recover data: a backup tool and a repair tool • Access databases have a physical size limitation of 2 GB • Increasing the size of an Access database beyond that limit causes corruption Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Recover Data (2 of 5) Enterprise systems provide sophisticated features to avoid the costly and timeconsuming task of having users redo their work • Journaling involves maintaining a journal or log of all updates to the database • The log is a separate file from the database, so the log is still available if a catastrophe destroys the database • Several types of information are kept in the log for each transaction • Transaction ID and the date and time of each individual update • What the data looked like before image and after image • Start of a transaction and the successful completion (commit) Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Recover Data (3 of 5) Forward recovery • Because the database is no longer current, the DBA executes a DBMS recovery program that applies the after images of committed transactions from the log to bring the database up to date • You can improve the recovery process by realizing that if a specific record was updated 10 times since the last backup, the recovery program only needs to apply the last after image Backward recovery • Backward recovery, or rollback, recovers the database to a valid state by undoing the problem transactions • The DBMS reads the log for the problem transactions and applies the before images to undo their updates Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Recover Data (4 of 5) Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Recover Data (5 of 5) Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Provide Security Services (1 of 3) Security is the prevention of unauthorized access, either intentional or accidental, to a database • Encryption converts the data in a database to a format that is indecipherable by anyone other than an authorized user • Authentication refers to techniques for identifying the person attempting to access the data • User ID • Password • Biometric identification • Smart cards or smart fobs Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Provide Security Services (2 of 3) • Authorization • Enterprise-level database systems provide user-level security • Each user and process has specific privileges to select, insert, update, and delete data for different tables and views • SQL keywords can be used across all large-scale relational database systems to set table privileges • Views • A named subset of fields and records from one or more tables in the database • Can be used to give users and processes access to only the specific data needed for their job responsibilities Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Provide Security Services (3 of 3) Privacy refers to the right of individuals to have certain information about them kept confidential • Privacy and security are related because appropriate security measures protect privacy • Laws and regulations dictate some privacy rules • HIPAA, the Health Insurance Portability and Accountability Act, is a federal law that sets a national standard to protect medical records and other personal health information • FERPA, the Family Educational Rights and Privacy Act, protects the rights of students and parents regarding educational records Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Provide Data Integrity Features Key integrity constraints consist of primary key constraints and foreign key constraints • Primary keys are constrained to a unique value for each record • Foreign key fields are constrained to values previously entered in the primary key field Data integrity constraints help to ensure the accuracy and consistency of individual field values • Data type • Legal values • Format (input mask in Access) • Validation rule and validation text Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Support Data Independence Data independence lets you change the database structure without requiring you to change all of the programs that access the database • Adding a field • Changing the property of a field • Managing indexes • Changing the name of a field, table or view • Adding or changing a relationship Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Support Data Replication Database replication means that a copy of the database is distributed to other computers or locations • Early versions included master-slave configurations • Now, with the ubiquitous nature of the web, traditional “master-slave” models of distributed databases are not as common The distributed database concept is thriving with technologies such as Git • Free and open source that allows multiple developers to work on the same code base using distributed copies of the code • Control system language that provides the commands to create, compare, and merge changes between files • GitHub and BitBucket host projects that use the Git language Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Summary (1 of 2) The primary job of a relational database management system is to provide access to and maintain data. A popular acronym for these activities is to CRUD (Create, Read, Update, and Delete) data. The catalog, also called the data dictionary in some systems, contains metadata, data about the data. The concurrent update problem refers to the issue of two or more people wanting to update the same data at the same time, and how that conflict is resolved. Recovering from an attack or outage on a database starts with a reliable backup that allows a company to reset from a specific point in time, such as incremental backups throughout the day, journaling, and snapshots. Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Summary (2 of 2) Security is the prevention of unauthorized access, either intentional or accidental, to a database through encryption of data and implementation of user IDs and passwords. Data integrity features refer to rules set on fields and relationships in a database to prevent or at least minimize the entry of incorrect data. Data independence refers to the concept that changes can be made to the database without affecting each program and process that uses the database. Data replication means making a copy of data for use in a distributed environment. Friedrichsen, Ruffolo, Monk, Starks, Pratt, Last, Concepts of DB Management, 10th Edition. © 2021 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.