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
| Option | What it does | Values and rules |
|---|---|---|
| Auto Update | Reads the list again every 4 seconds. | Off by default. While it is on, the Refresh button is disabled. |
| Display Alameen Procedures Only | Limits 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 SQL | Includes 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.
| Column | Meaning |
|---|---|
| ID | The task number on the server. |
| Operation Type | The kind of command the task runs, such as SELECT or INSERT. |
| Execution Duration | The time since the task started, as hours:minutes:seconds.fraction. |
| CPU Time | The processor time the task has used. |
| Read HD | The number of reads from disk. |
| Write HD | The number of writes to disk. |
| Program | The name of the program that opened the connection. |
| User | The login name of the alameen user who owns the connection, if the program has registered it. Empty for other connections. |
| Database | The database the task works on. |
| Server | The name of the computer that opened the connection. |
| SQL User | The 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
| Button | What it does |
|---|---|
| Expensive Queries | Opens the Expensive Queries dialog. |
| Refresh | Reads the list again with the current options. Disabled while Auto Update is on. |
Right-click menu
Right-click a line. The menu is the usual report-list menu (Grid Lines, see Lists and trees) followed by the command End task.
| Command | What it does |
|---|---|
| End task | Tells the server to end the task of the selected line at once. |
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.
| Column | Meaning |
|---|---|
| Operation Details | The text of the query. |
| Execution Count | How many times the server ran it. |
| CPU Time | The total processor time of all its runs. |
| Read HD | The total of physical reads from disk. |
| logical writes | The total of logical writes. |
| logical Reads | The total of logical reads. |
| Average Processing Time | The average total time of one run. |
| Database | The current database. |
| Button | What it does |
|---|---|
| Refresh | Reads 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.
Related
This page applies to alameen ERP 10, version 10.1.79.764.