Muokkaa

Jaa


Monitoring SQL Database Locks

About Locks

Locking controls access to the same data at the same time by multiple users. To protect a transaction from another transaction modifying the same data, the first transaction puts a lock on the data. The lock remains until the transactions is done.

When a database lock occurs, concurrent transactions are limited in their access to the affected data resource. The limit is determined by the locking mode set by SQL Server. In the client, depending on the locking mode, users may be blocked from completing transactions on the locked data. If so, they'll typically get a message that indicates lock condition.

For general information about database locks in SQL Server, see Transaction Locking and Row Versioning Guide.

View Database Locks

To view database locks, open page 9511 Database Locks in the client.

The Database Locks page gives a snapshot of all current database locks in SQL Server. It provides information like the table and database resource affected by the lock. Or, the AL object or method that ran the transaction that caused the lock. These details can help you better understand the locking condition. For an explanation about the fields shown, use the tooltips on the page or refer to sp_lock (Transact-SQL)

Tip

If you are running Business Central Fall 2018 or earlier, you'll have to use the Dynamics NAV Development Environment. On the Tools menu, choose Debugger, and then choose Database Locks.

See Also

Viewing Database Locks
Monitoring SQL Database Deadlocks