Restore the
DBCleanUp task:
Step 1 — Take a backup of the ePO database before making any changes. For instructions to back up the SQL database, see one of the following articles:
Step 2 — Confirm that you’re experiencing the issue described in this article.
- Log on to the Microsoft SQL Server Management Studio.
- Expand Databases.
- Right-click the ePO database (where the default name is ePO_) and select New Query.
- Paste the following SQL statements into the query window and determine which clean up tasks exist in the OrionTaskQueueMT table:
SELECT
SUBSTRING(TaskDescription, LEN(LEFT(TaskDescription, CHARINDEX ('<name>', TaskDescription))) + 6, LEN(TaskDescription) - LEN(LEFT(TaskDescription, CHARINDEX ('<name>', TaskDescription))) - LEN(RIGHT(TaskDescription, LEN(TaskDescription) - CHARINDEX ('</name>', TaskDescription))) - 6) as 'Task Name',
CONVERT(datetime, SWITCHOFFSET(CONVERT(datetimeoffset, OrionTaskQueueMT.RunTime), DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS 'Local Start Time',
CONVERT(datetime, SWITCHOFFSET(CONVERT(datetimeoffset, OrionTaskQueueMT.EnqueuedTime), DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS 'Local Queued Time',
CASE WHEN State=0 THEN 'Queued' WHEN State=1 THEN 'INVALID' WHEN State=2 THEN 'Pending/Waiting' WHEN State=3 THEN 'Running' ELSE 'Unknown' END as 'State'
FROM OrionTaskQueueMT
where taskdescription like '%db clean%'
- Click Execute.
The results differ depending on the ePO version you’re using.
Expected results:
ePO 5.9.x
Task Name |
Local Start Time |
Local Queued Time |
State |
DB Clean-up Task |
<date> |
<date> |
Queued |
ePO 5.10
Task Name |
Local Start Time |
Local Queued Time |
State |
DB Clean-up Task |
<date> |
<date> |
Queued |
DC DB Clean-up Tasks |
<date> |
<date> |
Queued |
IMPORTANT: If the results you see on your server are
similar to the examples above (one row returned on an ePO 5.9.x database, or two rows returned on a 5.10 database), you’re experiencing a different issue. Stop here and contact Support. See the "Related Information" field for details.
Step 3 — Determine the ID of the task that is missing from the above results.
If you
don't see the above expected results, and there's a missing task, run the following query to show the task identifiers from the
OrionSchedulerTaskMT table:
SELECT Id, name, UniqueKey, Enabled FROM OrionSchedulerTaskMT WHERE name like '%db clean%'
NOTE: The script above determines the IDs of the missing tasks.
Expected results:
ePO 5.9.x
ID |
Name |
UniqueKey |
Enabled |
6 |
DB Clean-up Task |
DBCleanupTask |
1 |
ePO 5.10.x
ID |
Name |
UniqueKey |
Enabled |
7 |
DB Clean-up Task |
ClientTaskCleanupTask |
1 |
87 |
DC DB CleanUp Task |
DbCleanupTask |
1 |
Compare the above results with the results from the previous query, and determine the
ID of the task that's missing.
Example: Assume that you’re using ePO 5.10, and the query from
step 2 only returns the DB Clean-up Task and
not the
CD DB Clean-up Task. Then, based on the above results from the
OrionSchedulerTaskMT table, the task with ID
87 is missing from the first set of results.
Step 4 — Verify that the issue is resolved.
- Run the following command using a web browser:
https://<ePO_server_name>:8443/remote/scheduler.updateServerTask?taskId=<ID_from_Step_3>&status=disabled&isHidden=true
- When prompted for credentials, type in an ePO user with Global Administrator permissions. For example, the original administrator user.
If there’s any reply other than the following, provide the full error message with the current orion.log files to Technical Support and stop here. For contact details, see the "Related Information" section below.
OK
True
- Run the SQL query from 'Step 3' again to show the results from the OrionSchedulerTaskMT table. The result indicates that the task is disabled (Enabled =0).
- Delete records in OrionSchedulerTaskQueueEntryMT using the ID of the missing task found in 'Step 3':
DELETE FROM OrionScheduledTaskQueueEntryMT WHERE SchedulerTaskID = < ID_from_Step_3>
NOTE: You might see a message that states, "0 rows affected." If so, this message doesn’t indicate a problem. Continue to the next step.
- Run the following command using a web browser:
https://<ePO_server_name>:8443/remote/scheduler.updateServerTask?taskId=<ID_from_step_3>&status=enabled&isHidden=true
If there’s any reply other than the following, provide the full error message with the current Orion.log files to Technical Support, and stop here. For contact details, see the "Related Information" section below.
OK:
True
- Run the SQL queries from Steps 2 and 3 again. The first query must now return the expected results as shown in the example in Step 2. The second query is expected to show that the task is enabled again (Enabled =1)
Use the query below to display all data on one page:
SELECT
st.Id,
st.[name],
st.[UniqueKey],
st.[Enabled],
st.[type],
CASE WHEN tq.[state]=0 THEN 'Queued'
WHEN tq.[state]=1 THEN 'INVALID'
WHEN tq.[state]=2 THEN 'Pending/Waiting'
WHEN tq.[state]=3 THEN 'Running'
ELSE 'UNKNOWN'
END AS [state],
CONVERT(datetime, SWITCHOFFSET(CONVERT(datetimeoffset, TQ.RunTime), DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS 'Local Start Time',
CONVERT(datetime, SWITCHOFFSET(CONVERT(datetimeoffset, TQ.EnqueuedTime), DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS 'Local Queued Time'
FROM OrionSchedulerTaskMT as ST
INNER JOIN OrionScheduledTaskQueueEntryMT as TQE on ST.id=TQE.SchedulerTaskID
inner join OrionTaskQueueMT as TQ on tq.id=TQE.TaskQueueEntryID
WHERE ST.name like '%db clean%' or st.name like '%Task Queue Maintenance Task%'
Example Output:
ID |
Name |
UniqueKey |
Enabled |
Type |
State |
Local Start Time |
Local Queued Time |
4 |
Task Queue Maintenance Task |
scheduler.taskQueue.maintenance |
1 |
3 |
Queued |
2022-02-28 10:43:00.000 |
2022-02-28 10:43:15.267 |
7 |
DB Clean-up Task |
ClientTaskCleanupTask |
1 |
3 |
Queued |
2022-02-28 11:00:00.000 |
2022-02-28 10:00:13.720 |
35 |
DC DB CleanUp Task |
DbCleanupTask |
1 |
3 |
Queued |
2022-02-28 10:43:00.000 |
2022-02-28 10:43:15.263 |