DBA Data[Home] [Help]

VIEW: SYS.DBA_ADVISOR_TASKS

Source

View Text - Preformatted

select a.owner_name as owner,
             a.id as task_id,
             a.name as task_name,
             a.description as description,
             a.advisor_name as advisor_name,
             a.ctime as created,
             a.mtime as last_modified,
             a.parent_id as parent_task_id,
             a.parent_rec_id as parent_rxec_id,
             a.last_exec_name as last_execution,
             e.exec_type as execution_type,
             e.exec_type_id as execution_type#,
             e.description as execution_description,
             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,
             a.source as source,
             a.how_created as how_created,
             decode(bitand(a.property,1), 1, 'TRUE', 'FALSE') as read_only,
             decode(bitand(a.property,32), 32, 'TRUE', 'FALSE') as system_task,
             a.advisor_id as advisor_id,
             nvl(e.status, a.status) as status#
      from wri$_adv_tasks a, wri$_adv_executions e
      where a.id = e.task_id(+)
        and a.advisor_id = e.advisor_id(+)
        and a.last_exec_name = e.name(+)
        and bitand(a.property, 6) = 4
View Text - HTML Formatted

SELECT A.OWNER_NAME AS OWNER
, A.ID AS TASK_ID
, A.NAME AS TASK_NAME
, A.DESCRIPTION AS DESCRIPTION
, A.ADVISOR_NAME AS ADVISOR_NAME
, A.CTIME AS CREATED
, A.MTIME AS LAST_MODIFIED
, A.PARENT_ID AS PARENT_TASK_ID
, A.PARENT_REC_ID AS PARENT_RXEC_ID
, A.LAST_EXEC_NAME AS LAST_EXECUTION
, E.EXEC_TYPE AS EXECUTION_TYPE
, E.EXEC_TYPE_ID AS EXECUTION_TYPE#
, E.DESCRIPTION AS EXECUTION_DESCRIPTION
, 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
, A.SOURCE AS SOURCE
, A.HOW_CREATED AS HOW_CREATED
, DECODE(BITAND(A.PROPERTY
, 1)
, 1
, 'TRUE'
, 'FALSE') AS READ_ONLY
, DECODE(BITAND(A.PROPERTY
, 32)
, 32
, 'TRUE'
, 'FALSE') AS SYSTEM_TASK
, A.ADVISOR_ID AS ADVISOR_ID
, NVL(E.STATUS
, A.STATUS) AS STATUS#
FROM WRI$_ADV_TASKS A
, WRI$_ADV_EXECUTIONS E
WHERE A.ID = E.TASK_ID(+)
AND A.ADVISOR_ID = E.ADVISOR_ID(+)
AND A.LAST_EXEC_NAME = E.NAME(+)
AND BITAND(A.PROPERTY
, 6) = 4