Presentation is loading. Please wait.

Presentation is loading. Please wait.

Managing Multi-User Databases

Similar presentations


Presentation on theme: "Managing Multi-User Databases"— Presentation transcript:

1 Managing Multi-User Databases
AIMS 3710 R. Nakatsu

2 Multi-User Issues Transaction Management Database Recovery
Database Administration

3 Transaction Processing
What is a transaction? A transaction is a logical unit of work that must be entirely completed or aborted; no intermediate states are accepted. A transaction may consist of a series of related UPDATE (or writes) to the database.

4 Transaction: Example Scenario: A company makes a credit sale of a product to a customer. 1. Generate an order on the Order table to record the order. 2. Update the Inventory table by subtracting the number of units of the product sold from the quantity-on-hand. 3. Update the Account Receivable table to bill the customer later. If the three transactions are not completely executed, the transaction will yield an inconsistent database

5 Transaction Management with SQL
Two commands are useful to know: 1. COMMIT: When this statement is issued, the changes are permanently recorded in the database. 2. ROLLBACK: When this statement is reached, the changes are aborted, and the database is “rolled back” to its previous consistent state.

6 Database Recovery The process of restoring the database to a correct state in the event of a failure. Via Reprocessing Via Rollback/Rollforward (Undo/Redo)

7 Recovery Facilities Backup Facilities: make periodic backup copies of the database Logging Facilities: keep track of all updates made to the database Checkpoint Facilities: maintain a point of synchronization between the database and the transaction log

8 Have a Back Up Strategy! Disk drives fail: don’t be surprised if this happens to you! 3-2-1 Strategy: Have at least three copies of your data, on at least two separate media storage devices, at least one copy offsite. Cloud-based services like Carbonite, and Dropbox offer affordable and convenient offsite, “cloud” storage. Create a disk image (e.g., timemachine on the Mac, superduper, drivesnapshot.de, among other programs)

9 Transaction Log Transaction records contain: Transaction identifier
Time Type of transaction (transaction start, insert, update, delete, abort, commit) Identifier of data item affected Before-image of the data item After-image of the data item Log management information (such as pointers to previous and next log records for the transaction)

10 Transaction Log Example

11 Checkpoint The point of synchronization between the database and the transaction log file. All buffers are force-written to secondary storage. Checkpoints involve the following operations: All log records in main memory are written to secondary storage. A checkpoint record is written to the log file. The record contains the identifers of all active transactions at the time the checkpoint is taken.

12 Checkpointing Example
tC tF

13 Fault-Tolerant Computer Systems…
are systems that contain extra hardware, software, and power supply components that can back up a system and keep it running continuously to prevent system failure.

14 Technologies used to ensure maximum performance
Load balancing distributes large numbers of access requests across multiple servers. Mirroring uses a backup server that duplicates all the processes and transactions of the primary server. Clustering links two computers together so that the second computer can act as a backup to the primary computer.

15 RAID (Redundant Array of Independent Disks)
Technology that provides enhanced performance and reliability through redundancy RAID has different levels or methods of storage. The common ones are RAID 0, RAID 1, and RAID 5. RAID 0: Distributes data across multiple drives for faster read/write speeds, but does not duplicate information (faster performance only). RAID 1: Writes the same data to two drives (mirroring). RAID 5: Offers both speed and mirroring. Question: Does RAID replace the need for backups?

16 DBA Must Monitor DBMS Performance
© 2000 Prentice Hall

17 Features of Multi-User DBMS Products
Support for SQL and other open standards Support for transaction processing (commits and rollbacks) Transaction logging for quick recovery Security management Programmability (the ability to create customized applications) Support for DBA functions (e.g., performance tuning and query optimization)


Download ppt "Managing Multi-User Databases"

Similar presentations


Ads by Google