@@header

/*
*
*  Author     : Vishal Gupta
*  Purpose    : Display the metric names
*  Version    : 
*  Parameters : 1 - Metric Name (Use % as wildcard and \ as escape character)
*               
*
*  Revision History:
*  ===================
*  Date       Author        Description
*  ---------  ------------  -----------------------------------------
*  08-Oct-12  Vishal Gupta  Created
*
*/

UNDEFINE metric_name
UNDEFINE metric_group


DEFINE metric_name="&&1"
DEFINE metric_group="&&2"

Prompt
Prompt   ***************************************************************************************************
Prompt   *    ALL Metric Names like '&&metric_name'
Prompt   ***************************************************************************************************

COLUMN group_name         HEADING "Metric Group"          FORMAT a32
COLUMN metric_name        HEADING "Metric Name"           FORMAT a45
COLUMN metric_unit        HEADING "Metric Unit"           FORMAT a30
COLUMN interval_size      HEADING "Interval|Size|(sec)"  FORMAT 999999
COLUMN max_interval       HEADING "Max|Interval"           FORMAT 999999
 
SELECT m.group_name
     , m.metric_name
     , m.metric_unit
     , mg.interval_size/100   interval_size
     , mg.max_interval
  FROM v$metricname m
       JOIN v$metricgroup mg  ON mg.group_id = m.group_id
WHERE ( UPPER(m.metric_name)   like UPPER('&&metric_name') ESCAPE '\'
        OR UPPER(m.group_name) like UPPER('&&metric_name') ESCAPE '\' )
ORDER BY m.group_name
       , UPPER(m.metric_name) 
;
       

@@footer
