Skip to main content

Monitor SQL tasks

Use SQL Task Manager when users complain that the program is slow or that an operation never ends. It shows which task is running now, who started it and how much it has used, and lets you end a stuck task.

Before you begin​

  • You need the permission SQL Task Manager in Users Management > Operations, and the standard reports feature in your licence.
  • Ending a task stops what another user is doing and rolls back what was not finished. Tell the user first if you can.

Steps​

Follow the tasks​

  1. Click Management > Control > SQL Task Manager. The window opens with the running tasks.
  2. To limit the list to the tasks of alameen, turn on Display Alameen Procedures Only. To include the internal system tasks, turn on Display Stored Procedures in SQL.
  3. To follow the list without clicking, turn on Auto Update. The list refreshes every 4 seconds. Without it, click Refresh when you need to.
  4. Click the title Execution Duration to find the longest tasks, or CPU Time to find the heaviest on the processor. Read User and Program to know who owns the task.
  5. Select a line to read the text of its command in Operation Details.

Find the heaviest queries​

  1. Click Expensive Queries. The dialog opens with the top 20 queries by processor use.
  2. For each query read Execution Count, CPU Time and Average Processing Time. A query that runs very often, or whose average is long, is worth checking.
  3. Click Refresh to read the list again.

End a stuck task​

  1. Select the line of the task and check User, Execution Duration and the text in Operation Details.
  2. Right-click the line and choose End task. The program runs the command at once and does not ask for confirmation.
  3. Click Refresh and check that the task has left the list. If it is still there, the server refused the command.

Result​

  • The lists are read-only: following the tasks changes nothing in the data of the file.
  • The task you ended stops, and the server rolls back what was not finished. Its owner may see an error or a lost connection.

If something goes wrong​

SituationWhy it appearsWhat to do
The command is not in the ribbonYour licence has no standard reports feature, or you lack the permission.Ask the administrator.
The list is emptyNo tasks are running with the chosen options, or the data could not be read.Turn on Display Stored Procedures in SQL and click Refresh.
The Refresh button is disabledAuto Update is on.Turn it off to go back to manual refresh.
The task stays after End taskThe server refused the command, or the task ended and another started with a different number.Refresh the list and check the login that the program uses to connect to the database.

This page applies to alameen ERP 10, version 10.1.79.764.