DBMS Classtest2
DBMS Classtest2
A. Multivalued dependency occurs when there are more than one independent
multivalued attributes in a table. This is an example of multivalued
dependency: An item depends on more than one value. In this example, the
course depends on both lecturer and book. Thus, 4NF states that a table should not
have more than one of these dependencies. 4NF is rarely used outside of
academic circles.
A given relation is said to be in its third normal form when it's in 2NF but has no
transitive partial dependency. Meaning, when no transitive dependency exists for
the attributes that are non-prime, then the relation can be said to be in 3NF.
3NF
There shouldn’t be any transitive dependency.
There shouldn’t be any non-prime attribute that depends transitively on
a candidate key.
It is not as strong as BCNF.
It has high redundancy.
The functional dependencies are already present in INF and 2NF.
It is easy to achieve.
It can be used to achieve lossless decomposition
BCNF
For any relation A->B, ‘A’ should be a super key of that specific relation.
It is stronger than 3NF.
The functional dependencies are present in 1NF, 2NF and 3NF.
It has low redundancy in comparison to 3NF.
The functional dependencies may or may not be preserved.
It is difficult to achieve lossless decomposition using BCNF.
4. Explain the concept of Deadlock and how to Prevent deadlocks in Time based stamp
Protocol.
This locking protocol divides the execution phase of a transaction into three
different parts.
Growing Phase: In this phase transaction may obtain locks but may not
release any locks.
Shrinking Phase: In this phase, a transaction may release locks but not
obtain any new lock
It is true that the 2PL protocol offers serializability. However, it does not ensure
that deadlocks do not happen.
7. Explain Aries in Detail and Explain “Write-Ahead Log Protocol”
A. ARIES stands for “Algorithm for Recovery and Isolation Exploiting Semantics.” It was
designed to support the needs of industrial strength transaction processing systems. ARIES
uses logs to record the progress of transactions and their actions which cause changes to
recoverable data objects. The log is the source of truth and is used to ensure that committed
actions are reflected in the database, and that uncommitned actions are undone.
Conceptually the log is a single ever-growing sequential file (append-only). Every log record
has a unique log sequence number (LSN), and LSNs are assigned in ascending order.
If you restore the archived redo log files and data files, then you must perform media recovery
before you can open the database. Any database transactions in the archived redo log files not
reflected in the data files are applied to the data files, bringing them to a transaction-consistent
state before the database is opened.
Media recovery requires a control file, data files (typically restored from backup), and online and
archived redo log files containing changes since the time the data files were backed up. Media
recovery is most often used to recover from media failure, such as the loss of a file or disk, or a
user error, such as the deletion of the contents of a table.
Media recovery can be a complete recovery or a point-in-time recovery. Complete recovery can
apply to individual datafiles, tablespaces, or the entire database. Point-in-time recovery applies to
the whole database (and also sometimes to individual tablespaces, with automation help from
Oracle Recover Manager (RMAN)).