Microsoft Dynamics 365 LS Central for Retail Scheduler Jobs Database Lock Issues
First: Using an SQL Query to Check Locked Tables
This SQL query is useful for identifying locked tables and their status within the database, helping you pinpoint the cause of error messages related to locks.
Query to Check Locked Tables
You can use a Dynamic Management View (DMV) query in SQL Server as follows:
Second: Using SQL Server Activity Monitor
The Activity Monitor is a built-in tool in SQL Server that helps you monitor performance, session statuses, and locked tables.
How to Open Activity Monitor:
- Open SQL Server Management Studio (SSMS).
- Log in to the server.
- Right-click the server name in the left pane, then select Activity Monitor.
How to Use Activity Monitor to Check Locked Tables:
- Processes: Displays all active processes in the database. Here, you can identify sessions holding locks and monitor their Session ID.
- Locks by Object: Shows the status and lock type on tables. This lets you see if a specific process is locking a particular table, such as the Scheduler Job Header table.
- Locks by Process: Provides details on sessions using locks and the lock types in use.
Note: If you find a session locking the table you need, you can terminate the session using the Activity Monitor or the KILL command in SQL (ensure not to end essential sessions).
Video tutorial
https://youtu.be/eAXqznYcoqs?si=EI_CvOEV7L2KrIU4