Que. Explain locking in DBMS?
Ans-
1) A lock is a one of the variable associated with a data item.
2) It is describes the status of the time with respect to possible operations that can be applied to it.
3) Its prevents access to a database record by a second transaction until the first transaction has completed all of its action.
4) In database there is one lock for each data item in the database.
5) It is used to as means of synchronizing the access by concurrent transaction to the database items.
6) Locks are granted and released by a lock manager. The data structure of lock manager is manage by lock table.
7) Generally their are two types of lock:
a) S locks -Shared or Read lock
b) X locks-exclusive or Write lock.
8) Execution of the lock as a follows
a) Transaction T1 holds an S lock on data 'd' . A request by transaction T2 for an S lock will be granted. Read-Read is allowed .
b)Transaction T1 hold an S lock on data 'd'. A request by transaction T2 for an S lock will be refused. Read-Write is not allowed.
c)Transaction T1 hold an X lock on data 'd'. A request by transaction T2 will be refused. Write is not allowed.
DBMS mainly uses the following types of locking techniques:
a) Binary locking
b) Exclusive locking
c) Shared locking
d) Two-phase locking(2PL) https://myknowledgemyfinance.blogspot.com/2018/06/dbms-two-phase-locking2pl.html
e) Three- phase locking(3PL)
0 comments:
Post a Comment