Monday, January 21, 2013

Cloud Control 12 udm to metric extension


Today I got a question to move udm from gridcontrol 11 to 12c metric extensions.
I used this inventarisation query as as startpoint, when I finished the query I thought that this could be usefull for other oracle dba' as well:

SELECT target_name,
  collection_name,
  aantal,
  SUM(aantal) OVER ( PARTITION BY collection_name ) running_total_by_coll_name,
  CASE
    WHEN SUM(aantal) OVER ( PARTITION BY collection_name ) > 1
    THEN 'POSSIBLE GENERIC METRIC EXTENSION'
    ELSE 'UNIQUE METRIC EXTENSION'
  END ME_OUTPUT
FROM
  (SELECT target_name,
    collection_name,
    COUNT(*) aantal
  FROM mgmt$target_metric_settings
  WHERE METRIC_NAME        ='SQLUDM'
  AND collection_name NOT IN ('UDM_GENERIC_SECURITY_1','UDM_GENERIC_SECURITY_2', 'UDM_GENERIC_BACKUP_CHECK' , 'UDM_GENERIC_UNUSABLE_INDEXES')
  GROUP BY target_name,
    collection_name
  )

No comments: