Skip to main content

SQL Task Manager

The SQL Task Manager window shows what the database server is running at this moment, one task per line: who started it, since when, and how much it has used. You can follow a slow or stuck task there and end it. The button Expensive Queries opens a dialog with the heaviest queries the server ran recently. This window is for the administrator: ending a task stops what another user is doing.

Opening the window​

Click Management > Control > SQL Task Manager. You need:

  • A company file that is open, and the standard reports feature in your licence. Without it the command does not appear.
  • The permission SQL Task Manager in Users Management > Operations.

Options​

OptionWhat it doesValues and rules
Auto UpdateReads the list again every 4 seconds.Off by default. While it is on, the Refresh button is disabled.
Display Alameen Procedures OnlyLimits the list to the tasks the program starts.Shows the tasks whose program name contains alameenERP or .Net SqlClient Data Provider. Off by default.
Display Stored Procedures in SQLIncludes the internal tasks of the server.Off by default: the program shows the running tasks of users and hides internal system tasks and idle ones. When it is on, every running task shows.

The program reads the last two options at each refresh. After you change one, click Refresh or wait for the automatic update.

The task list​

One line for each running task. The list is read when the window opens, on Refresh and on each automatic update. The program orders the tasks by execution duration, longest first, and you can sort by clicking a column title.

ColumnMeaning
IDThe task number on the server.
Operation TypeThe kind of command the task runs, such as SELECT or INSERT.
Execution DurationThe time since the task started, as hours:minutes:seconds.fraction.
CPU TimeThe processor time the task has used.
Read HDThe number of reads from disk.
Write HDThe number of writes to disk.
ProgramThe name of the program that opened the connection.
UserThe login name of the alameen user who owns the connection, if the program has registered it. Empty for other connections.
DatabaseThe database the task works on.
ServerThe name of the computer that opened the connection.
SQL UserThe database login the connection uses.

Operation details​

Select a line and the read-only field Operation Details shows the text of the last command the connection sent, up to 5000 characters. It stays empty if the server does not know the text.

Buttons​

ButtonWhat it does
Expensive QueriesOpens the Expensive Queries dialog.
RefreshReads the list again with the current options. Disabled while Auto Update is on.

Right-click a line. The menu is the usual report-list menu (Grid Lines, see Lists and trees) followed by the command End task.

CommandWhat it does
End taskTells the server to end the task of the selected line at once.
warning

End task does not ask for confirmation. The task stops and its unfinished work is rolled back, so what the user was doing fails. You can end the task of another user's connection. Check User, Program and Execution Duration before you click.

The program shows no message after the command and does not refresh the list: click Refresh to see whether the task has gone. If the server refuses the command, the task stays in the list.

Expensive Queries dialog​

It opens from Expensive Queries. It shows at most 20 queries of the current database, ordered by total CPU time, highest first. It is what the server remembers about queries it ran recently, not a permanent record.

ColumnMeaning
Operation DetailsThe text of the query.
Execution CountHow many times the server ran it.
CPU TimeThe total processor time of all its runs.
Read HDThe total of physical reads from disk.
logical writesThe total of logical writes.
logical ReadsThe total of logical reads.
Average Processing TimeThe average total time of one run.
DatabaseThe current database.
ButtonWhat it does
RefreshReads the list again.

The list is read when the dialog opens. The dialog has no close button: close it with the close button of its frame. Its menu has no End task command.

Messages​

These two windows have no messages of their own. If the data cannot be read, the list stays empty.

This page applies to alameen ERP 10, version 10.1.79.764.