select bl.dbid, bst.instance_number,
bl.baseline_id, bl.baseline_name, bl.baseline_type,
bst.start_snap_id, bst.start_snap_time,
bst.end_snap_id, bst.end_snap_time,
bst.shutdown, bst.error_count, bst.pct_total_time,
bl.last_time_computed,
bl.moving_window_size, bl.creation_time,
bl.expiration, bl.template_name, con_dbid_to_id(bl.dbid) con_id
from
WRM$_BASELINE bl, WRM$_BASELINE_DETAILS bst
where
bl.dbid = bst.dbid and
bl.baseline_id != 0 and
bl.baseline_id = bst.baseline_id
union all
select bl.dbid, bst.instance_number,
bl.baseline_id, bl.baseline_name, bl.baseline_type,
bst.start_snap_id, bst.start_snap_time,
bst.end_snap_id, bst.end_snap_time,
bst.shutdown, bst.error_count, bst.pct_total_time,
bl.last_time_computed,
bl.moving_window_size, bl.creation_time,
bl.expiration, bl.template_name, con_dbid_to_id(bl.dbid) con_id
from
WRM$_BASELINE bl, /* Note: moving window stats only for local dbid */
table(dbms_workload_repository.select_baseline_details(bl.baseline_id)) bst
where
bl.dbid = bst.dbid and
bl.baseline_id = 0 and
bl.baseline_id = bst.baseline_id
SELECT BL.DBID
, BST.INSTANCE_NUMBER
,
BL.BASELINE_ID
, BL.BASELINE_NAME
, BL.BASELINE_TYPE
,
BST.START_SNAP_ID
, BST.START_SNAP_TIME
,
BST.END_SNAP_ID
, BST.END_SNAP_TIME
,
BST.SHUTDOWN
, BST.ERROR_COUNT
, BST.PCT_TOTAL_TIME
,
BL.LAST_TIME_COMPUTED
,
BL.MOVING_WINDOW_SIZE
, BL.CREATION_TIME
,
BL.EXPIRATION
, BL.TEMPLATE_NAME
, CON_DBID_TO_ID(BL.DBID) CON_ID
FROM
WRM$_BASELINE BL
, WRM$_BASELINE_DETAILS BST
WHERE
BL.DBID = BST.DBID AND
BL.BASELINE_ID != 0 AND
BL.BASELINE_ID = BST.BASELINE_ID
UNION ALL
SELECT BL.DBID
, BST.INSTANCE_NUMBER
,
BL.BASELINE_ID
, BL.BASELINE_NAME
, BL.BASELINE_TYPE
,
BST.START_SNAP_ID
, BST.START_SNAP_TIME
,
BST.END_SNAP_ID
, BST.END_SNAP_TIME
,
BST.SHUTDOWN
, BST.ERROR_COUNT
, BST.PCT_TOTAL_TIME
,
BL.LAST_TIME_COMPUTED
,
BL.MOVING_WINDOW_SIZE
, BL.CREATION_TIME
,
BL.EXPIRATION
, BL.TEMPLATE_NAME
, CON_DBID_TO_ID(BL.DBID) CON_ID
FROM
WRM$_BASELINE BL
, /* NOTE: MOVING WINDOW STATS ONLY FOR LOCAL DBID */
TABLE(DBMS_WORKLOAD_REPOSITORY.SELECT_BASELINE_DETAILS(BL.BASELINE_ID)) BST
WHERE
BL.DBID = BST.DBID AND
BL.BASELINE_ID = 0 AND
BL.BASELINE_ID = BST.BASELINE_ID
|
|
|