1.

List out the different forms of locks available in Teradata.

Answer»

Every object in the database is shared between multiple users who access the data simultaneously. If, for example, a user was updating a table and another user tried to view it simultaneously, the second user would receive inaccurate and inconsistent information. Locking mechanisms have been invented to avoid this kind of data inconsistency or data corruption. Having a lock PREVENTS multiple users from CHANGING the same data at the same TIME, reducing the possibility of data corruption/data inconsistency. In general, Teradata comprises four types of locks as follows: 

  • Exclusive: Teradata applies an exclusive lock whenever anyone attempts to MODIFY the structure of any objects ( like a table or view). In other words, Teradata holds the lock on that object and no other user is permitted to access or manipulate that object until the lock is released from the object. 
  • Write: Table that is secured with a write lock can only be modified by the lock owner. If other users try to insert, delete, or update a table, a write lock will be applied. With a write lock, other users cannot modify the same table.  
  • Read: When a user submits a SELECT query, a read lock is applied.  Multiple users can hold READ locks on an object, during which the system does not permit changes to that object. Hence, data integrity is thus maintained since the data in the tables cannot be altered when read locks are applied.  
  • Access: It only prevents exclusive access. ACCESS locks do not restrict access to another user except for when an EXCLUSIVE lock is REQUIRED to prevent others from accessing. 


Discussion

No Comment Found