Professional Documents
Culture Documents
1. Consider the following two transactions and schedule (time goes from top to
bottom). Is this schedule conflict-serializable? Explain why or why not.
Transaction T0 Transaction T1
r0[A]
w0[A]
r1[A]
r1[B]
c1
r0[B]
w0[B]
c0
The schedule is not conflict serializable because the precedence graph contains a cycle.
The graph has an edge T0 → T1 because the schedule contains w0[A] → r1[A]. The
graph has an edge T1 → T0 because the schedule contains r1[B] → wo[B].
4. Differentiate strict two phase protocol and rigorous two phase protocol.
In strict two phase locking the shared locks are released in shrinking phase, but in
rigorous two phase locking all the shared and exclusive locks are kept until the end of the
transaction.
Strict two phase locking protocol provide only cascadeless schedules, recovery is very
easy. But the set of schedules obtainable is a subset of those obtainable from plain two
phase locking, thus concurrency is reduced.
In rigorous two phase locking we do not need to know the access pattern of locks on data
items beforehand so it is more appropriate for dynamic environments while in strict two
phase locking the access pattern of locks should be specified at the start of transaction
6. List the SQL statements used for transaction control. (Nov/Dec 2011)
Transaction Control Language(TCL) commands are used to manage transactions in
database.These are used to manage the changes made by DML statements.
1. Commit command: Commit command is used to permanently save any transaction
into database. Following is Commit command's syntax,
Commit;
2. Rollback command: This command restores the database to last commited state. It is
also use with savepoint command to jump to a savepoint in a transaction. Following is
Rollback command's syntax,
rollback to savepoint-name;
3. Savepoint command: savepoint command is used to temporarily save a transaction
so that you can rollback to that point whenever necessary. Following is savepoint
command's syntax,
savepointsavepoint-name;
Deadlock prevention or avoidance - Do not allow the system to get into a deadlocked
state.
Deadlock detection and recovery - Abort a process or preempt some resources
when deadlocks are detected.
UNIT IV
The difference in hardware RAID and software RAID is where the RAID processing happens.
Software RAID performs the processing on the host’s CPU. Because it does not use the server
processor, hardware RAID provides better performance. However, because of the need for
additional hardware, it is more expensive than software RAID.
5. What are the two type of stripping? Give example for both.
If we need to read a large file, instead of pulling it all from a single hard disk, it is much faster to
chop it up into pieces, store some of the pieces on each of the drives in an array, and then use all
the disks to read back the file when needed. This technique is called striping, after the pattern
that might be visible if you could see these "chopped up pieces" on the various drives with a
different colour used for each file. It is similar in concept to the memory performance-enhancing
technique called interleaving.
Striping can be done at the byte level, or in blocks. Byte-level striping means that the file is
broken into "byte-sized pieces". The first byte of the file is sent to the first drive, then the second
to the second drive, and so on. Sometimes byte-level striping is done as a sector of 512 bytes.
Block-level striping means that each file is split into blocks of a certain size and those are
distributed to the various drives