select a.id as task_id,
a.name as task_name,
nvl(e.exec_start, a.exec_start) as execution_start,
nvl(e.exec_end, a.exec_end) as execution_end,
decode(nvl(e.status, a.status),
1, 'INITIAL',
2, 'EXECUTING',
3, 'COMPLETED',
4, 'INTERRUPTED',
5, 'CANCELLED',
6, 'FATAL ERROR') as status,
dbms_advisor.format_message_group(
nvl(e.status_msg_id, a.status_msg_id)) as status_message,
a.pct_completion_time as pct_completion_time,
a.progress_metric as progress_metric,
a.metric_units as metric_units,
a.activity_counter as activity_counter,
a.rec_count as recommendation_count,
dbms_advisor.format_message_group(
nvl(e.error_msg_id, a.error_msg#)) as error_message
from wri$_adv_tasks a, wri$_adv_executions e
where a.id = e.task_id(+)
and a.last_exec_name = e.name(+)
and a.advisor_id = e.advisor_id(+)
and a.owner# = userenv('SCHEMAID')
and bitand(a.property, 6) = 4
SELECT A.ID AS TASK_ID
,
A.NAME AS TASK_NAME
,
NVL(E.EXEC_START
, A.EXEC_START) AS EXECUTION_START
,
NVL(E.EXEC_END
, A.EXEC_END) AS EXECUTION_END
,
DECODE(NVL(E.STATUS
, A.STATUS)
,
1
, 'INITIAL'
,
2
, 'EXECUTING'
,
3
, 'COMPLETED'
,
4
, 'INTERRUPTED'
,
5
, 'CANCELLED'
,
6
, 'FATAL ERROR') AS STATUS
,
DBMS_ADVISOR.FORMAT_MESSAGE_GROUP(
NVL(E.STATUS_MSG_ID
, A.STATUS_MSG_ID)) AS STATUS_MESSAGE
,
A.PCT_COMPLETION_TIME AS PCT_COMPLETION_TIME
,
A.PROGRESS_METRIC AS PROGRESS_METRIC
,
A.METRIC_UNITS AS METRIC_UNITS
,
A.ACTIVITY_COUNTER AS ACTIVITY_COUNTER
,
A.REC_COUNT AS RECOMMENDATION_COUNT
,
DBMS_ADVISOR.FORMAT_MESSAGE_GROUP(
NVL(E.ERROR_MSG_ID
, A.ERROR_MSG#)) AS ERROR_MESSAGE
FROM WRI$_ADV_TASKS A
, WRI$_ADV_EXECUTIONS E
WHERE A.ID = E.TASK_ID(+)
AND A.LAST_EXEC_NAME = E.NAME(+)
AND A.ADVISOR_ID = E.ADVISOR_ID(+)
AND A.OWNER# = USERENV('SCHEMAID')
AND BITAND(A.PROPERTY
, 6) = 4
|
|
|