DBMS Functions Data, Storage, Retrieval, and Update
Download
Report
Transcript DBMS Functions Data, Storage, Retrieval, and Update
DBMS Functions
Data, Storage, Retrieval, and Update
• Provides users with the ability to store,
retrieve, and update the data that are in the
database.
DBMS Functions
Shared Update
• Ensures accuracy when several users are
updating the database at the same time.
Avoiding Inconsistent Data
• Prohibit shared update.
• Use batch processing
• Lock other users from accessing records
that are being updated by another.
Concurrency Control
• The DBMS must prevent or overcome
the interference of transactions of
multiple users
• Locking
– different levels of granularity (records to tables)
Avoiding the Problem
• Two-Phase Locking
– Locks are held until all the required updates have been
completed.
• Deadlock
– Occurs when two users hold more than one lock at a
time.
• Locking on PC-Based DBMSs
– Usually much more limited than locking facilities
provided by mainframe DBMSs.
Record Locking
• Deadlock prevention
• Deadlock resolution
Avoiding the Problem
• Timestamping
– The DBMS assigns to each database update the
unique time when the update started, called a
timestamp.
– Avoids the need to lock rows and eliminates the
processing time needed to apply and release
locks; also detects and resolves deadlocks.
Backup and Recovery
• Provides a mechanism for recovering the
database in the event that the database is
damaged in any way.
• The process of returning the database to a
correct state is called recovery.
• Periodically making a copy of the database
is called backup.
Replication
• A way to manage copies of the same data at
multiple locations.
Security
• The protection of the database against
unauthorized access.
– Passwords
– Encryption
– Views
Integrity
• Integrity constraints, or conditions, fall into
four categories:
–
–
–
–
Data type
Legal values
Format
Key constraints
Integrity Constraints in a DBMS
Data Independence
• Facilities that allow programs to be
independent of the structure of the database.
–
–
–
–
Addition of a field
Changing the length of a field
Creating a new index
Adding or changing a relationship
ACID properties
• Atomic
– all of a transaction should be executed or none
• Consistent
– the database should be in a “consistent” state after the
transaction is completed
• Isolated
– Updates of concurrent transactions should be concealed
from each other, till committed
• Durable
– once a transaction commits, its updates survive even if
there is a subsequent system crash