Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 June SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and Answers (Day-2)

SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and Answers (Day-2)

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

What is the Read Uncommitted Isolation Level of the SQL Server?

SQL Server: What is Read Uncommitted Isolation Level?

 

What is the READ COMMITTED Isolation Level of the SQL Server?

SQL Server: READ COMMITTED Isolation Level with the READ_COMMITTED_SNAPSHOT option

 

What is the READ COMMITTED Isolation Level with the READ_COMMITTED_SNAPSHOT option?

When the READ_COMMITTED_SNAPSHOT database option is ON, read committed isolation uses row versioning.

READ COMMITTED SNAPSHOT does optimistic reads and pessimistic writes. When data is updating, you can still read old version of data and there is no any share lock, but you cannot update that same data until the running update is not finished.

What is the REPEATABLE READ Isolation Level of the SQL Server?

SQL Server: What is REPEATABLE READ Isolation Level?

 

What is the SERIALIZABLE Isolation level of the SQL Server?

SQL Sever: What is SERIALIZABLE Isolation level?

What is the SNAPSHOT Isolation Level of the SQL Server?

SQL Server: What is SNAPSHOT Isolation Level?

 

Can you enable SNAPSHOT Isolation Level for a particular SQL statement?

You cannot enable SNAPSHOT Isolation level at statement level.

You have to enable at the database level and after enabling all your database transactions will execute in MVCC fashion.

What is the difference between READ_COMMITTED_SNAPSHOT option and Snapshot Isolation Level?

Using READ_COMMITTED_SNAPSHOT option, you can SELECT old version of rows while it is updating, but you cannot execute new UPDATE on the same data until it finished a running UPDATE.

Using SNAPSHOT ISOLATION LEVEL, you can perform any kind of DML operation because it is managing different data version in the TempDB so the reader and writer never blocked by each other.

What is a Shared lock?

Shared (S): Used for read operations that do not change or update data, such as a SELECT statement.

What is an Update lock?

Update(U): Used on resources that can be updated. Prevents a common form of deadlock that occurs when multiple sessions are reading, locking, and potentially updating resources later.

What is an Exclusive lock?

Exclusive(X): Used for data-modification operations, such as INSERT, UPDATE, or DELETE. Ensures that multiple updates cannot be made to the same resource at the same time.

What is an Intent lock?

The Database Engine uses intent locks to protect placing a shared (S) lock or exclusive (X) lock on a resource lower in the lock hierarchy. Intent locks are named intent locks because they are acquired before a lock at the lower level, and therefore signal intent to place locks at a lower level.

What is a Schema lock?

The Database Engine uses schema modification (Sch-M) locks during a table data definition language (DDL) operation, such as adding a column or dropping a table. During the time that it is held, the Sch-M lock prevents concurrent access to the table.

What is a Bulk Update lock?

BulkUpdate (BU): Used when bulk copying data into a table and the TABLOCK hint is specified.

What is a Key range lock?

Key-range locks protect a range of rows implicitly included in a record set being read by a Transact-SQL statement while using the serializable transaction isolation level. Key-range locking prevents phantom reads.

A key range lock protects this requirement by preventing other transactions from inserting new rows whose keys would fall in the range of keys read by the serializable transaction.

Do you think lock is reducing the performance of the database system?

For large computer systems, locks on frequently referenced objects can become a performance bottleneck as acquiring and releasing locks place contention on internal locking resources.

What do you know about the lock partitioning?

Lock partitioning enhances locking performance by splitting a single lock resource into multiple lock resources. This feature is only available for systems with 16 or more CPUs, and is automatically enabled and cannot be disabled. Only object locks can be partitioned.

 

Jun 5, 2016Anvesh Patel
SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and Answers (Day-1)SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and Answers (Day-3)
Anvesh Patel
Anvesh Patel

Database Engineer

June 5, 2016 SQL Server Interviewanswers, Anvesh Patel, block, concurrency, database, database research and development, dbrnd, DeadLock, exclusive lock, intent lock, interview, Isolation, live lock, lock, lock partitioning, questions, schema lock, shared lock, SQL Query, SQL Server, SQL Server Administrator, SQL Server Monitoring, SQL Server Performance Tunning, SQL Server Tips and Tricks, transaction, TSQL, update lock
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....