<!-- $Header: emdb/sysman/admin/metadata/osm_instance.xml /st_emdbsa_11.2/21 2009/06/20 15:57:01 pardutta Exp $
   MODIFIED    (MM/DD/YY)
      mnihalan  04/16/09 - Fix bug 8407207
      mpawelko  03/09/09 - 8316983: improve perf of ofs metrics
      ajdsouza  02/22/09 - added metric cluster_resource_name
      mpawelko  02/20/09 - 6996096: split performance metrics into 2
                           collections
      fagonzal  02/18/09 - Adding checker failures alert
      chanchan  02/09/09 - Add ofs space usage to ofs metric
      loliu     02/05/09 - Added group name to Disk_Path metric
      asubba    01/13/09 - relate asm creds with db creds
      ychan     12/10/08 - XbranchMerge ychan_bug-6343005 from
                           st_emdbgc_10.2.0.1.0
      mpawelko  12/05/08 - 6996096: split cluster and instance perf metrics
      asubba    11/29/08 - change asm creds to extend dbcreds
      ychan     11/26/08 - Fix bug 6343005
      mnihalan  10/22/08 - Fix ofs used pct
      mnihalan  10/03/08 - View name changes
      mappusam  09/18/08 - Backport mappusam_bug-6970279 from main
      mnihalan  09/16/08 - Fix bug 7413707
      mnihalan  09/08/08 - Change 11gR1TB to 11gR1
      mnihalan  09/03/08 - Fix Version Category
      mnihalan  08/29/08 - Fix bug 7342407
      yozhang   08/11/08 - Name change OFS to ACFS
      mappusam  08/06/08 - 
      asubba    08/01/08 - 
      mappusam  07/31/08 - Backport mappusam_bug-6970279 from main
      asubba    07/29/08 - diskgroup size alert enhancement
      yozhang   07/23/08 - Fix bug 7260061 in 11.2DBC
      yozhang   07/23/08 - Fix rfi bug 7278621
      asubba    07/22/08 - diskgroup size alert enhancemnet
      mnihalan  07/17/08 - Fix ofs metrics usage
      asubba    06/22/08 - XbranchMerge asubba_rfi_backport_7117654_10.2.0.5.0
                           from st_emdbgc_10.2.0.1.0
      asubba    05/29/08 - Backport from 11.1.0.7
      mpawelko  05/20/08 - 7111621: backport of 6408082 (ASM creds set); bumped META_VER to 2.7
      mnihalan  05/09/08 - Fix volume performance metrics
      mnihalan  02/07/08 - Add metrics for Volume performance
      mnihalan  01/23/08 - Fix OFS bug 6754205
      fagonzal  12/28/07 - Adding missing search patterns
      fagonzal  11/27/07 - Added/updated ASM alert log metrics
      mpawelko  10/26/07 - bug 6408082 add monitoring credential set; fix ComputeOFSVC
      asubba    09/25/07 - XbranchMerge asubba_ui_improvements from main
      mpawelko  08/30/07 - XbranchMerge mpawelko_bug-6266985 from main
      jsoule    08/07/07 - add support workbench integration items
      qsong     05/15/07 - change OFS metrics column order
      qsong     05/03/07 - bug 6008914: add ASMCreds credential type and related credentials set
      mpawelko  04/18/07 - bug 6003984: fix unavailable_failure_group; add review changes
      mpawelko  03/14/07 - add new imbalance and failure group metrics
      mpawelko  03/14/07 - add new imbalance and failure group metrics
      mpawelko  03/14/07 - add new imbalance and failure group metrics
      mpawelko  03/14/07 - add new imbalance and failure group metrics
      mpawelko  03/14/07 - add new imbalance and failure group metrics
      mpawelko  03/14/07 - add new imbalance and failure group metrics
      qsong     03/06/07 - remove dg rebalance metric
      qsong     03/06/07 - remove dg rebalance metric
      qsong     11/13/06 - 
      chanchan  11/10/06 - 
      qsong     11/03/06 - 
      chanchan  08/22/06 - 
      qsong     08/14/06 - make DiskGroup_Usage metric a TEST_METRIC for monitor configureation test connection feature, change the metric column from total_bytes to total_mb for compatibility
      qsong     08/14/06 - make DiskGroup_Usage metric a TEST_METRIC for monitor configureation test connection feature, change the metric column from total_bytes to total_mb for compatibility
      mnihalan  08/08/06 - Backport bug 5406081
      mnihalan  08/02/06 - Fix bug 5406081
      qsong     05/05/06 - 
      qsong     05/05/06 - 
      chanchan  04/28/06 - 
      chanchan  04/28/06 - 
      qsong     02/28/06 - 4769090, fix Database_Diskgroup_Usage metric query 
      qsong     02/23/06 - bump the meta_ver 
      qsong     02/02/06 - add io_size, read_size, write_size metric columns
      ajdsouza  07/27/05 - bug 4505127 , add group_number to disk_path metric
      rajeshar  03/13/05 - bug 4234699, 4191804 and 4234709(bump meta_ver to 2.5)
      rajeshar  02/03/05 - bug 4130659
      ychan     01/31/05 - Add alertlog filter 
      hying     01/03/05 - errorPrefix for alertlog      
      jochen    12/21/04 - Fix NLS strings 
      jsoule    12/08/04 - parametrize alertLog metric 
      rajeshar  12/08/04 - Changing the collection time for 10gR1 and 10gR2 bug 3590905
      jochen    10/12/04 - Add instance_name=%sid% to connect string 
      lhan      10/08/04 - fix show-stopper 3936536 
      jochen    08/20/04 - Fix ilint problem 
      jochen    07/26/04 - Use dbresp to get response 
      sjconnol  07/16/04 - Pref creds support
      jochen    07/09/04 - Use timeFormat, make alert log stacks stateless
      ychan     07/09/04 - Remove 10gBeta 
      jochen    07/07/04 - Change db_dg_usage label to total bytes 
                           Remove serviceName, perldebug properties
      jochen    06/25/04 - Use asm_disk_stat and asm_diskgroup_stat
      jochen    06/23/04 - Add alert for mode_status=offline
      jochen    06/10/04 - Add usable_file_mb, type, bump version
                           Change connect string to work around bug 3711168
      rreilly   06/10/04 - policies
      many               - many edits by many people
      spanchum  02/08/02 - Creation
-->

<!DOCTYPE TargetMetadata SYSTEM "../dtds/TargetMetadata.dtd">

<TargetMetadata META_VER="3.7"
                TYPE="osm_instance"
                CATEGORY_PROPERTIES="VersionCategory"
                RESOURCE_BUNDLE_PACKAGE="oracle.sysman.db.rsc">
  <Display>
    <Label NLSID="oracle_storage_manager">Automatic Storage Management</Label>
  </Display>

  <!--
  ==================================================================
  == Response
  ==================================================================
    -->
    <Metric NAME="Response" TYPE="TABLE"> 
    <Display>
      <Label NLSID="osm_instance_resp">Response</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="Status" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_resp_status">Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="oraerr" TYPE="STRING" IS_KEY="FALSE" TRANSIENT="TRUE" HELP="NO_HELP">
        <Display>
          <Label NLSID="resp_oraerr">ORA- Error</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>

    <QueryDescriptor FETCHLET_ID="OSLineToken">
      <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
      <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
      <Property NAME="command" SCOPE="GLOBAL">
         %perlBin%/perl %scriptsDir%/db/osmresp.pl
      </Property>
      <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
      <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
      <Property NAME="ENVEM_TARGET_NAME" SCOPE="INSTANCE">NAME</Property>
      <Property NAME="STDINEM_TARGET_USERNAME" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="STDINEM_TARGET_PASSWORD" SCOPE="INSTANCE">password</Property>
      <Property NAME="ENVEM_TARGET_ROLE" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE">SID</Property>
      <Property NAME="ENVEM_TARGET_ORACLE_HOME" SCOPE="INSTANCE">OracleHome</Property>
      <Property NAME="ENVEM_TARGET_ADDRESS" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>

  </Metric>

  <!--
  ==================================================================
  == DiskGroup_Usage - pre 10.2
  ==================================================================
    -->
  <Metric NAME="DiskGroup_Usage" TYPE="TABLE"  IS_TEST_METRIC="TRUE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR1"/>
    </ValidIf>
    <Display>
      <Label NLSID="osm_instance_diskgroup_usage">Disk Group Usage</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="total_mb" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_mb">Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="free_mb" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_free_mb">Disk Group Free (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="type" TYPE="STRING" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_type">Redundancy</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="percent_used" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((total_mb-free_mb)/total_mb)*100">
        <Display>
          <Label NLSID="osm_instance_used_pct">Disk Group Used %</Label>
        </Display>
      </ColumnDescriptor>

    </TableDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select dg.name "Disk Group Name", to_char(NVL(dg.total_mb,0)) "Total MB",
    to_char(NVL(dg.free_mb, 0)) "Free MB", type "Type"
  from V$ASM_DISKGROUP dg
  where state = 'MOUNTED'
]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>

  <!--
  ==================================================================
  == DiskGroup_Usage - 10.2+
  ==================================================================
    -->
  <Metric NAME="DiskGroup_Usage" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="osm_instance_diskgroup_usage">Disk Group Usage</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="total_mb" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_mb">Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="free_mb" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_free_mb">Disk Group Free (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="type" TYPE="STRING" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_type">Redundancy</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="usable_file_mb" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_usable_file_mb">Disk Group Usable Free (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="required_mirror_free_mb" TYPE="NUMBER" IS_KEY="FALSE"
                        TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_mirror_free_mb">Required Mirror Free (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="redundancy_factor" TYPE="NUMBER" IS_KEY="FALSE"
                        TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_redundancy_factor">Redundancy Factor</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="usable_total_mb" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(total_mb - required_mirror_free_mb)/redundancy_factor">
        <Display>
          <Label NLSID="osm_instance_usable_total_mb">Disk Group Usable (MB)</Label>
        </Display>
      </ColumnDescriptor>
      
      <ColumnDescriptor NAME="percent_used" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((total_mb-free_mb)/total_mb)*100">
        <Display>
          <Label NLSID="osm_instance_used_pct">Disk Group Used %</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="safe_percent_used" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="100 - (usable_file_mb/usable_total_mb)*100">
        <Display>
          <Label NLSID="osm_instance_102_used_pct">Used % of Safely Usable</Label>
        </Display>
      </ColumnDescriptor>

    </TableDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select dg.name "Disk Group Name", to_char(NVL(dg.total_mb,0)) "Total MB",
  to_char(NVL(dg.free_mb, 0)) "Free MB",
  type "Type",
  to_char(NVL(dg.usable_file_mb, 0)) "Usable Free MB", 
  to_char(NVL(dg.required_mirror_free_mb, 0)),
  decode(type, 'EXTERN', 1,
               'NORMAL', 2,
               'HIGH', 3,
               1) redundancy_factor
  from V$ASM_DISKGROUP_STAT dg
  where state = 'MOUNTED'
]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>

  <!--
  ==================================================================
  == Disk_Path
  ==================================================================
    -->
<Metric NAME="Disk_Path" TYPE="TABLE">
    <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="osm_instance_disk_path">Disk Path</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="group_number" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_group_number">Group Number</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="group_name" TYPE="STRING">
        <Display>
          <Label NLSID="osm_instance_group_name">Group Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="disk_number" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_disk_number">Disk Number</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="disk_name" TYPE="STRING" >
        <Display>
          <Label NLSID="osm_instance_disk_name">Disk Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="disk_path" TYPE="STRING" >
        <Display>
          <Label NLSID="osm_instance_disk_path">Disk Path</Label>
        </Display>
      </ColumnDescriptor>
     </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select d.group_number, g.name "Group Name", d.disk_number, d.name "Disk Name", d.path "Disk Path" from V$ASM_DISK_STAT d, V$ASM_DISKGROUP_STAT g where d.group_number != 0 and d.group_number = g.group_number ]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>


<!--
   == commented out for r1 for performance reasons
    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR1"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select d.group_number, d.name "Disk Name", d.path "Disk Path" from V$ASM_DISK d where group_number != 0 ]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
-->

  </Metric>

  <!--
  ==================================================================
  == Database_DiskGroup_Usage
  ==================================================================
    -->
  <Metric NAME="Database_DiskGroup_Usage" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR1;10gR2;11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="osm_instance_database_diskgroup_usage">Database Disk Group Usage</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="db_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_db_name">Database Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="total_mb" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_bytes">Total Bytes</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
     select dg_name "Disk Group Name", db_name "Database Name", to_char(SUM(space)) "Total Bytes"
         from
          ((select distinct UPPER(a1.name) db_name, vf.space space, dg.name dg_name, dg.group_number, vf.file_number
            from V$ASM_ALIAS a1,  V$ASM_ALIAS a2  , V$ASM_ALIAS a3, V$ASM_FILE vf,V$ASM_DISKGROUP_STAT dg
            where a2.parent_index = a1.reference_index
              and a3.parent_index = a2.reference_index
              and (mod(a1.parent_index, 16777216) = 0)
              and a1.alias_directory = 'Y'
              and a2.alias_directory = 'Y'
              and a3.system_created = 'Y' and a3.alias_directory = 'N'
              and dg.group_number = a1.group_number
              and dg.group_number = vf.group_number
              and vf.file_number = a3.file_number
              and dg.state = 'MOUNTED'
            ) 
           UNION ALL
           (select distinct UPPER(a1.name) db_name, vf.space space, dg.name dg_name, dg.group_number, vf.file_number
            from V$ASM_ALIAS a1,  V$ASM_ALIAS a2  , V$ASM_ALIAS a3, V$ASM_ALIAS a4, V$ASM_FILE vf,V$ASM_DISKGROUP_STAT dg
            where a2.parent_index = a1.reference_index
              and a3.parent_index = a2.reference_index
              and a4.parent_index = a3.reference_index
              and (mod(a1.parent_index, 16777216) = 0)
              and a1.alias_directory = 'Y'
              and a2.alias_directory = 'Y'   
              and a3.alias_directory = 'Y'
              and a4.system_created = 'Y' and a4.alias_directory = 'N'
              and dg.group_number = a1.group_number
              and dg.group_number = vf.group_number
              and vf.file_number = a4.file_number
              and dg.state = 'MOUNTED'
             )
           UNION ALL
           (select distinct UPPER(a1.name) db_name, vf.space space, dg.name dg_name, dg.group_number, vf.file_number
            from V$ASM_ALIAS a1,  V$ASM_ALIAS a2  , V$ASM_ALIAS a3, 
              V$ASM_ALIAS a4, V$ASM_ALIAS a5, V$ASM_FILE vf,V$ASM_DISKGROUP_STAT dg
            where a2.parent_index = a1.reference_index
              and a3.parent_index = a2.reference_index
              and a4.parent_index = a3.reference_index
              and a5.parent_index = a4.reference_index 
              and (mod(a1.parent_index, 16777216) = 0)
              and a1.alias_directory = 'Y' 
              and a2.alias_directory = 'Y' 
              and a3.alias_directory = 'Y' 
              and a4.alias_directory = 'Y' 
              and a5.system_created = 'Y' and a5.alias_directory = 'N'
              and dg.group_number = a1.group_number
              and dg.group_number = vf.group_number
              and vf.file_number = a5.file_number
              and dg.state = 'MOUNTED'   
            ))
           group by dg_name, db_name
]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR1"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
    select dg_name "Disk Group Name", db_name "Database Name", to_char(SUM(space)) "Total Bytes"
         from
          ((select distinct UPPER(a1.name) db_name, vf.space space, dg.name dg_name, dg.group_number, vf.file_number
            from V$ASM_ALIAS a1,  V$ASM_ALIAS a2  , V$ASM_ALIAS a3, V$ASM_FILE vf,V$ASM_DISKGROUP dg
            where a2.parent_index = a1.reference_index
              and a3.parent_index = a2.reference_index
              and (mod(a1.parent_index, 16777216) = 0)
              and a1.alias_directory = 'Y'
              and a2.alias_directory = 'Y'
              and a3.system_created = 'Y' and a3.alias_directory = 'N'
              and dg.group_number = a1.group_number
              and dg.group_number = vf.group_number
              and vf.file_number = a3.file_number
              and dg.state = 'MOUNTED'
            ) 
           UNION ALL
           (select distinct UPPER(a1.name) db_name, vf.space space, dg.name dg_name, dg.group_number, vf.file_number
            from V$ASM_ALIAS a1,  V$ASM_ALIAS a2  , V$ASM_ALIAS a3, V$ASM_ALIAS a4, V$ASM_FILE vf,V$ASM_DISKGROUP dg
            where a2.parent_index = a1.reference_index
              and a3.parent_index = a2.reference_index
              and a4.parent_index = a3.reference_index
              and (mod(a1.parent_index, 16777216) = 0)
              and a1.alias_directory = 'Y'
              and a2.alias_directory = 'Y' 
              and a3.alias_directory = 'Y'
              and a4.system_created = 'Y' and a4.alias_directory = 'N'
              and dg.group_number = a1.group_number
              and dg.group_number = vf.group_number
              and vf.file_number = a4.file_number
              and dg.state = 'MOUNTED'
             )
           UNION ALL
           (select distinct UPPER(a1.name) db_name, vf.space space, dg.name dg_name, dg.group_number, vf.file_number
            from V$ASM_ALIAS a1,  V$ASM_ALIAS a2  , V$ASM_ALIAS a3, 
              V$ASM_ALIAS a4, V$ASM_ALIAS a5, V$ASM_FILE vf,V$ASM_DISKGROUP dg
            where a2.parent_index = a1.reference_index
              and a3.parent_index = a2.reference_index
              and a4.parent_index = a3.reference_index
              and a5.parent_index = a4.reference_index 
              and (mod(a1.parent_index, 16777216) = 0)
              and a1.alias_directory = 'Y'
              and a2.alias_directory = 'Y'
              and a3.alias_directory = 'Y'
              and a4.alias_directory = 'Y'
              and a5.system_created = 'Y' and a5.alias_directory = 'N'
              and dg.group_number = a1.group_number
              and dg.group_number = vf.group_number
              and vf.file_number = a5.file_number
              and dg.state = 'MOUNTED'   
             ))
           group by dg_name, db_name
]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>

  <!--
  ==================================================================
  == Instance_Disk_Performance
  ==================================================================
    -->
  <Metric NAME="Instance_Disk_Performance" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR1;10gR2;11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="osm_instance_inst_disk_performance">Instance Disk Performance</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="inst_id" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_inst_id">Instance ID</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="disk_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_disk_name">Disk Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_reads">Reads</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes">Writes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_time" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_read_time">Read Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_time" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_write_time">Write Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_read" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_bytes_read">Bytes Read</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_written" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_bytes_written">Bytes Written</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_io">Total I/O</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_time" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_io_time">Total I/O Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_io" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_bytes_total">Total I/O Bytes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_errs" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_errs">Read Errors</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_errs" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_write_errs">Write Errors</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="mount_date" TRANSIENT="TRUE" TYPE="STRING" IS_DATE="TRUE" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_mount_date">Mount Date</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_write_errs" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(read_errs + write_errs):((read_errs - _read_errs) + (write_errs - _write_errs))">
        <Display>
          <Label NLSID="osm_instance_read_write_errs">Read Write Errors</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(read_time/reads)*10:((reads >_reads)?(read_time - _read_time)/(reads - _reads):0)*10">
         <Display>
          <Label NLSID="osm_instance_read_response_time">Read Response Time</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="write_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(write_time/writes)*10:((writes >_writes)?(write_time - _write_time)/(writes - _writes):0)*10">
        <Display>
          <Label NLSID="osm_instance_write_response_time">Write Response Time</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(io_time/io)*10:((io >_io)?(io_time - _io_time)/(io - _io):0)*10">
        <Display>
          <Label NLSID="osm_instance_io_response_time">Response Time</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="reads_ps" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?reads/(__interval/2):((reads > _reads)?(reads - _reads)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_reads_ps">Reads Per Second</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="writes_ps" TYPE="NUMBER" IS_KEY="FALSE"
       COMPUTE_EXPR="(mount_date > _mount_date)?writes/(__interval/2):((writes > _writes)?(writes - _writes)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_writes_ps">Writes Per Second</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_ps" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?io/(__interval/2):((io > _io)?(io - _io)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_io_ps">IOPS</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_throughput" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?bytes_read/(__interval/2):((bytes_read > _bytes_read)?(bytes_read - _bytes_read)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_read_throughput">Read Throughput</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="write_throughput" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?bytes_written/(__interval/2):((bytes_written > _bytes_written)?(bytes_written - _bytes_written)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_write_throughput">Write Throughput</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_throughput" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?bytes_io/(__interval/2):((bytes_io > _bytes_io)?(bytes_io - _bytes_io)/(__interval):0)">
         <Display>
          <Label NLSID="osm_instance_io_throughput">IO Throughput</Label> 
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_io)/(io):((io > _io)?((bytes_io - _bytes_io)/(io - _io)):0)">
        <Display>
          <Label NLSID="osm_instance_io_size_mb">IO Size (MB)</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_read)/(reads):((reads > _reads)?((bytes_read - _bytes_read)/(reads - _reads)):0)">
        <Display>
          <Label NLSID="osm_instance_read_size_mb">Read Size (MB)</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="write_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_written)/(writes):((writes > _writes)?((bytes_written - _bytes_written)/(writes - _writes)):0)">
        <Display>
          <Label NLSID="osm_instance_write_size_mb">Write Size (MB)</Label>
        </Display>
      </ColumnDescriptor>

    </TableDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select :1 "Instance ID", dg.name "Disk Group Name", di.name "Disk Name",
  di.reads "Reads", di.writes "Writes",
  di.read_time "Read Time", di.write_time "Write Time",
  bytes_read/1024/1024 "Bytes Read", bytes_written/1024/1024 "Bytes Written",
  reads+writes "Total IO", read_time+write_time "Total IO time", (bytes_read+bytes_written)/1024/1024 "Total IO Bytes",
  read_errs "Read Errors", write_errs "Write Errors",
  TO_CHAR(di.mount_date, 'yyyy-MM-dd HH:mm:ss') "MOUNT_DATE"
  from V$ASM_DISKGROUP_STAT dg, V$ASM_DISK_STAT di
  where dg.group_number = di.group_number
  AND dg.state = 'MOUNTED'
  ORDER BY 1, dg.group_number, di.name
]]>
      </Property>
      <Property NAME="SQLINPARAM1" SCOPE="INSTANCE">InstanceID</Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR1"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select :1 "Instance ID", dg.name "Disk Group Name", di.name "Disk Name",
  di.reads "Reads", di.writes "Writes",
  di.read_time "Read Time", di.write_time "Write Time",
  bytes_read/1024/1024 "Bytes Read", bytes_written/1024/1024 "Bytes Written",
  reads+writes "Total IO", read_time+write_time "Total IO time", (bytes_read+bytes_written)/1024/1024 "Total IO Bytes",
  read_errs "Read Errors", write_errs "Write Errors",
  TO_CHAR(di.mount_date, 'yyyy-MM-dd HH:mm:ss') "MOUNT_DATE"
  from V$ASM_DISKGROUP dg, V$ASM_DISK di
  where dg.group_number = di.group_number
  AND dg.state = 'MOUNTED'
  ORDER BY 1, dg.group_number, di.name
]]>
      </Property>
      <Property NAME="SQLINPARAM1" SCOPE="INSTANCE">InstanceID</Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>

  <!--
  ==================================================================
  == Disk_Performance
  ==================================================================
    -->
  <Metric NAME="Disk_Performance" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR1;10gR2;11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="osm_instance_disk_performance">Cluster Disk Performance</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="disk_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_disk_name">Disk Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_reads">Reads</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes">Writes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_time" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_read_time">Read Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_time" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_write_time">Write Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_read" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_bytes_read">Bytes Read</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_written" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_bytes_written">Bytes Written</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_io">Total I/O</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_time" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_io_time">Total I/O Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_io" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_bytes_total">Total I/O Bytes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_errs" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_errs">Read Errors</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_errs" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_write_errs">Write Errors</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="mount_date" TRANSIENT="TRUE" TYPE="STRING" IS_DATE="TRUE" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_mount_date">Mount Date</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_write_errs" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(read_errs + write_errs):((read_errs - _read_errs) + (write_errs - _write_errs))">
        <Display>
          <Label NLSID="osm_instance_read_write_errs">Read Write Errors</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(read_time/reads)*10:((reads >_reads)?(read_time - _read_time)/(reads - _reads):0)*10">
         <Display>
          <Label NLSID="osm_instance_read_response_time">Read Response Time</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="write_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(write_time/writes)*10:((writes >_writes)?(write_time - _write_time)/(writes - _writes):0)*10">
        <Display>
          <Label NLSID="osm_instance_write_response_time">Write Response Time</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(io_time/io)*10:((io >_io)?(io_time - _io_time)/(io - _io):0)*10">
        <Display>
          <Label NLSID="osm_instance_io_response_time">Response Time</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="reads_ps" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?reads/(__interval/2):((reads > _reads)?(reads - _reads)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_reads_ps">Reads Per Second</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="writes_ps" TYPE="NUMBER" IS_KEY="FALSE"
       COMPUTE_EXPR="(mount_date > _mount_date)?writes/(__interval/2):((writes > _writes)?(writes - _writes)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_writes_ps">Writes Per Second</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_ps" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?io/(__interval/2):((io > _io)?(io - _io)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_io_per_sec">>I/O per second</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_throughput" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?bytes_read/(__interval/2):((bytes_read > _bytes_read)?(bytes_read - _bytes_read)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_read_throughput">Read Throughput</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="write_throughput" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?bytes_written/(__interval/2):((bytes_written > _bytes_written)?(bytes_written - _bytes_written)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_write_throughput">Write Throughput</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_throughput" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?bytes_io/(__interval/2):((bytes_io > _bytes_io)?(bytes_io - _bytes_io)/(__interval):0)">
         <Display>
          <Label NLSID="osm_instance_io_throughput">IO Throughput</Label> 
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_io)/(io):((io > _io)?((bytes_io - _bytes_io)/(io - _io)):0)">
        <Display>
          <Label NLSID="osm_instance_io_size_mb">IO Size (MB)</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_read)/(reads):((reads > _reads)?((bytes_read - _bytes_read)/(reads - _reads)):0)">
        <Display>
          <Label NLSID="osm_instance_read_size_mb">Read Size (MB)</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="write_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_written)/(writes):((writes > _writes)?((bytes_written - _bytes_written)/(writes - _writes)):0)">
        <Display>
          <Label NLSID="osm_instance_write_size_mb">Write Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select dg.name "Disk Group Name", di.name "Disk Name",
  sum(di.reads) "Reads", sum(di.writes) "Writes",
  sum(di.read_time) "Read Time", sum(di.write_time) "Write Time",
  sum(bytes_read)/1024/1024 "Bytes Read", sum(bytes_written)/1024/1024 "Bytes Written",
  sum(reads+writes) "Total IO", sum(read_time+write_time) "Total IO time", 
  (sum(bytes_read)+sum(bytes_written))/1024/1024 "Total IO Bytes",
  sum(read_errs) "Read Errors", sum(write_errs) "Write Errors",
  TO_CHAR(max(di.mount_date), 'yyyy-MM-dd HH:mm:ss') "MOUNT_DATE"
  from GV$ASM_DISKGROUP_STAT dg, GV$ASM_DISK_STAT di
  where dg.group_number = di.group_number
  AND dg.inst_id = di.inst_id
  AND dg.state = 'MOUNTED'
  GROUP BY dg.name, di.name
]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR1"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select dg.name "Disk Group Name", di.name "Disk Name",
  sum(di.reads) "Reads", sum(di.writes) "Writes",
  sum(di.read_time) "Read Time", sum(di.write_time) "Write Time",
  sum(bytes_read)/1024/1024 "Bytes Read", sum(bytes_written)/1024/1024 "Bytes Written",
  sum(reads+writes) "Total IO", sum(read_time+write_time) "Total IO time", 
  (sum(bytes_read)+sum(bytes_written))/1024/1024 "Total IO Bytes",
  sum(read_errs) "Read Errors", sum(write_errs) "Write Errors",
  TO_CHAR(max(di.mount_date), 'yyyy-MM-dd HH:mm:ss') "MOUNT_DATE"
  from GV$ASM_DISKGROUP dg, GV$ASM_DISK di
  where dg.group_number = di.group_number
  AND dg.inst_id = di.inst_id
  AND dg.state = 'MOUNTED'
  GROUP BY dg.name, di.name
]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>

  </Metric>


  <!--
  ==================================================================
  == Instance_DiskGroup_Performance
  ==================================================================
    -->
  <Metric NAME="Instance_DiskGroup_Performance" TYPE="TABLE">
    <Display>
      <Label NLSID="osm_instance_inst_disk_group_performance">Instance Disk Group Performance</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="inst_id" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_inst_id">Instance ID</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_reads_ps">Reads per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes_ps">Writes per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_io_per_sec">I/O per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_throughput">Read Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes_throughput">Write Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_io_throughput">IO Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_io" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_bytes_total">Total I/O Bytes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_io">Total I/O</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_time" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_io_time">Total I/O Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_read" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_bytes_read">Bytes Read</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_reads">Reads</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_time" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_read_time">Read Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_written" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
         <Label NLSID="osm_instance_bytes_written">Bytes Written</Label>   
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_writes">Writes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_time" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_write_time">Write Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="mount_date" TRANSIENT="TRUE" TYPE="STRING" IS_DATE="TRUE" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_mount_date">Mount Date</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(read_time/reads)*10:((reads >_reads)?(read_time - _read_time)/(reads - _reads):0)*10">
        <Display>
          <Label NLSID="osm_instance_read_response_time">Read Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(write_time/writes)*10:((writes >_writes)?(write_time - _write_time)/(writes - _writes):0)*10">
        <Display>
          <Label NLSID="osm_instance_write_response_time">Write Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(io_time/io)*10:((io >_io)?(io_time - _io_time)/(io - _io):0)*10">
        <Display>
          <Label NLSID="osm_instance_response_time">Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_io)/(io):((io > _io)?((bytes_io - _bytes_io)/(io - _io)):0)">    
        <Display>
          <Label NLSID="osm_instance_io_size_mb">IO Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_read)/(reads):((reads > _reads)?((bytes_read - _bytes_read)/(reads - _reads)):0)">
        <Display>
          <Label NLSID="osm_instance_read_size_mb">Read Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_written)/(writes):((writes > _writes)?((bytes_written - _bytes_written)/(writes - _writes)):0)">
        <Display>
          <Label NLSID="osm_instance_write_size_mb">Write Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>

    <ExecutionDescriptor>
      <GetTable NAME="Instance_Disk_Performance" USE_CACHE="TRUE"/>
      <GroupBy NAME="avg_response" FROM_TABLE="Instance_Disk_Performance">
        <By NAME="inst_id" COLUMN_NAME="inst_id"/>
        <By NAME="dg_name" COLUMN_NAME="dg_name"/>
        <AggregateColumn  NAME="reads_ps"
                          COLUMN_NAME="reads_ps"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="writes_ps"
                          COLUMN_NAME="writes_ps"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io_ps"
                          COLUMN_NAME="io_ps"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="read_throughput"
                          COLUMN_NAME="read_throughput"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="write_throughput"
                          COLUMN_NAME="write_throughput"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io_throughput"
                          COLUMN_NAME="io_throughput"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="bytes_io"
                          COLUMN_NAME="bytes_io"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io"
                          COLUMN_NAME="io"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io_time"
                          COLUMN_NAME="io_time"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="bytes_read"
                          COLUMN_NAME="bytes_read"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="reads"
                          COLUMN_NAME="reads"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="read_time"
                          COLUMN_NAME="read_time"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="bytes_written"
                          COLUMN_NAME="bytes_written"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="writes"
                          COLUMN_NAME="writes"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="write_time"
                          COLUMN_NAME="write_time"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="mount_date"
                          COLUMN_NAME="mount_date"
                          OPERATOR="MAX" />
      </GroupBy>
    </ExecutionDescriptor>
  </Metric>

  <!--
  ==================================================================
  == Single_Instance_DiskGroup_Performance
  ==================================================================
    -->
  <Metric NAME="Single_Instance_DiskGroup_Performance" TYPE="TABLE">
    <Display>
      <Label NLSID="osm_instance_single_instance_disk_group_performance">Single Instance Disk Group Performance</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_response_time" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_response_time">Read Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_response_time" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_write_response_time">Write Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_response_time" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_response_time">Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_reads_ps">Reads per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes_ps">Writes per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_io_per_sec">I/O per second</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_throughput">Read Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes_throughput">Write Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_io_throughput">IO Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_size" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_io_size_mb">IO Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_size" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_size_mb">Read Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_size" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_write_size_mb">Write Size (MB)</Label>
        </Display>
      </ColumnDescriptor>

    </TableDescriptor>

    <ExecutionDescriptor>
      <GetTable NAME="Instance_DiskGroup_Performance" USE_CACHE="TRUE" />

      <GetView NAME="Single_Instance_DiskGroup_Performance" FROM_TABLE="Instance_DiskGroup_Performance" >
        <Filter COLUMN_NAME="inst_id" SCOPE="INSTANCE" OPERATOR="EQ">InstanceID</Filter>
      </GetView>

    </ExecutionDescriptor>
  </Metric>

  <!--
  ==================================================================
  == DiskGroup_Performance
  ==================================================================
    -->
  <Metric NAME="DiskGroup_Performance" TYPE="TABLE">
    <Display>
      <Label NLSID="osm_instance_disk_group_performance">Cluster Disk Group Performance</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_reads_ps">Reads per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes_ps">Writes per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_io_per_sec">I/O per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_throughput">Read Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_write_throughput">Write Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_io_throughput">IO Throughput</Label>
        </Display>
      </ColumnDescriptor>
     <ColumnDescriptor NAME="bytes_io" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_bytes_total">Total I/O Bytes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_io">Total I/O</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_time" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_io_time">Total I/O Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_read" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_bytes_read">Bytes Read</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_reads">Reads</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_time" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_read_time">Read Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_written" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
         <Label NLSID="osm_instance_bytes_written">Bytes Written</Label>   
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_writes">Writes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_time" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_write_time">Write Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="mount_date" TRANSIENT="TRUE" TYPE="STRING" IS_DATE="TRUE" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_mount_date">Mount Date</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(read_time/reads)*10:((reads >_reads)?(read_time - _read_time)/(reads - _reads):0)*10">
        <Display>
          <Label NLSID="osm_instance_read_response_time">Read Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(write_time/writes)*10:((writes >_writes)?(write_time - _write_time)/(writes - _writes):0)*10">
        <Display>
          <Label NLSID="osm_instance_write_response_time">Write Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(io_time/io)*10:((io >_io)?(io_time - _io_time)/(io - _io):0)*10">
        <Display>
          <Label NLSID="osm_instance_response_time">Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_io)/(io):((io > _io)?((bytes_io - _bytes_io)/(io - _io)):0)">
        <Display>
          <Label NLSID="osm_instance_io_size_mb">IO Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_read)/(reads):((reads > _reads)?((bytes_read - _bytes_read)/(reads - _reads)):0)">
        <Display>
          <Label NLSID="osm_instance_read_size_mb">Read Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(mount_date > _mount_date)?(bytes_written)/(writes):((writes > _writes)?((bytes_written - _bytes_written)/(writes - _writes)):0)">
        <Display>
          <Label NLSID="osm_instance_write_size_mb">Write Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>

    <ExecutionDescriptor>
      <GetTable NAME="Disk_Performance" USE_CACHE="TRUE"/>
      <GroupBy NAME="avg_response" FROM_TABLE="Disk_Performance">
        <By NAME="dg_name" COLUMN_NAME="dg_name"/>
        <AggregateColumn  NAME="reads_ps"
                          COLUMN_NAME="reads_ps"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="writes_ps"
                          COLUMN_NAME="writes_ps"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io_ps"
                          COLUMN_NAME="io_ps"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="read_throughput"
                          COLUMN_NAME="read_throughput"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="write_throughput"
                          COLUMN_NAME="write_throughput"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io_throughput"
                          COLUMN_NAME="io_throughput"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="bytes_io"
                          COLUMN_NAME="bytes_io"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io"
                          COLUMN_NAME="io"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io_time"
                          COLUMN_NAME="io_time"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="bytes_read"
                          COLUMN_NAME="bytes_read"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="reads"
                          COLUMN_NAME="reads"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="read_time"
                          COLUMN_NAME="read_time"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="bytes_written"
                          COLUMN_NAME="bytes_written"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="writes"
                          COLUMN_NAME="writes"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="write_time"
                          COLUMN_NAME="write_time"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="mount_date"
                          COLUMN_NAME="mount_date"
                          OPERATOR="MAX" />
      </GroupBy>
    </ExecutionDescriptor>
  </Metric>

 <!-- 
  ==================================================================
  == diskgroup_fg_imbalance (ASM failure group imbalance)
  == Purpose: For NORMAL or HIGH redundancy, alert on partner count
  == and/or partner space imbalance
  ==================================================================
  -->
  <Metric NAME="diskgroup_fg_imbalance" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="diskgroup_fg_imbalance">Failure Group Imbalance Status</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="diskGroup" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group</Label>
        </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="sImbalance" TYPE="NUMBER"> 
        <Display>
          <Label NLSID="partner_space_imbalance_pct">Disk Size Imbalance (%)</Label>
        </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="pImbalance" TYPE="NUMBER"> 
        <Display>
          <Label NLSID="partner_count_imbalance">Disk Count Imbalance Variance</Label>
        </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="failGrpCnt" TYPE="NUMBER"> 
        <Display>
          <Label NLSID="failGroup_count">Failure Group Count</Label>
        </Display>
      </ColumnDescriptor> 
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
        <![CDATA[
        select 
          g.name,
          100*(max(p.pspace)-min(p.pspace))/max(p.pspace),
          max(p.cnt)-min(p.cnt),
          count(distinct p.fgrp)
        from 
          v$asm_diskgroup_stat g ,
          (
            select
              x.grp grp,
              x.disk disk,
              sum(x.active) cnt,
              greatest(sum(x.total_mb/d.total_mb),0.0001) pspace,
              d.failgroup fgrp
            from  
              v$asm_disk_stat d ,
              (
                select 
                    y.grp grp,
                    y.disk disk,
                    z.total_mb*y.active_kfdpartner total_mb,
                    y.active_kfdpartner active
                from
                    x$kfdpartner y,
                    v$asm_disk_stat z
                where
                    y.number_kfdpartner = z.disk_number and
                    y.grp = z.group_number            
            ) x 
          where
            d.group_number = x.grp and
            d.disk_number = x.disk and
            d.group_number <> 0 and
            d.state = 'NORMAL' and
            d.mount_status = 'CACHED'
          group by
            x.grp, x.disk, d.failgroup
          ) p
        where
          g.group_number = p.grp
        group by
          g.name
        ]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>

 <!-- 
  ==================================================================
  == diskgroup_imbalance (ASM disk group imbalance)
  == Purpose: Alert when disk group requires rebalance, disk group
  == requires configuration change (e.g. increase storage) and 
  == when a rebalance in progress requires a power boost.
  ==================================================================
  -->
  <Metric NAME="diskgroup_imbalance" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="diskgroup_imbalance_status">Disk Group Imbalance Status</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="diskGroup" TYPE="STRING" IS_KEY="TRUE">
       <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group</Label>
       </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="imbalance" TYPE="NUMBER"> 
       <Display>
          <Label NLSID="actual_imbalance_pct">Actual Imbalance (%)</Label>
       </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="variance" TYPE="NUMBER"> 
        <Display>
          <Label NLSID="disk_size_variance_pct">Disk Size Variance (%)</Label>
        </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="minFree" TYPE="NUMBER"> 
        <Display>
          <Label NLSID="actual_min_free_pct">Actual Minimum Percent Free</Label>
        </Display>
      </ColumnDescriptor> 
     <ColumnDescriptor NAME="diskCnt" TYPE="NUMBER"> 
        <Display>
          <Label NLSID="disk_count">Disk Count</Label>
        </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="operation" TYPE="NUMBER" TRANSIENT="TRUE"> 
        <Display>
          <Label NLSID="operation">Operation</Label>
        </Display>
      </ColumnDescriptor> 
     <ColumnDescriptor NAME="power" TYPE="NUMBER" TRANSIENT="TRUE"> 
        <Display>
          <Label NLSID="power">Power</Label>
        </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="rebalInProgress" TYPE="STRING"
       COMPUTE_EXPR="(operation > 0 ? 'No' : 'Yes')">
        <Display>
          <Label NLSID="rebal_in_progress">Rebalance In Progress</Label>
        </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="computedImbalance" TYPE="NUMBER"
       COMPUTE_EXPR="(operation > 0 ? imbalance : 0)">
        <Display>
          <Label NLSID="imbalance_pct">Disk Group Imbalance (%) without Rebalance</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="computedMinFree" TYPE="NUMBER"
       COMPUTE_EXPR="(operation > 0 ? minFree : 100)">
        <Display>
          <Label NLSID="min_free_pct">Disk Minimum Free (%) without Rebalance</Label>
        </Display>
      </ColumnDescriptor>
    <ColumnDescriptor NAME="computedMaxUsed" TYPE="NUMBER"
       COMPUTE_EXPR="(operation > 0 ? 0 : (power > 0 ? (100 - minFree) : 0))">
        <Display>
          <Label NLSID="maximum_used_pct">Disk Maximum Used (%) with Rebalance</Label>
        </Display>
        </ColumnDescriptor>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
        <![CDATA[
        select 
          g.name, 
          100*(max((d.total_mb-d.free_mb)/d.total_mb)-min((d.total_mb-d.free_mb)/d.total_mb))/max((d.total_mb-d.free_mb)/d.total_mb),
          100*(max(d.total_mb)-min(d.total_mb))/max(d.total_mb),
          100*(min(d.free_mb/d.total_mb)),
          count(*),
          decode(op.operation, 'REBAL',0,1),
          decode(op.power, 0, 0, 1)
        from 
          v$asm_disk_stat d, 
          v$asm_diskgroup_stat g, 
          v$asm_operation op
        where
          d.group_number = g.group_number and
          g.group_number = op.group_number(+) and
          d.group_number <> 0 and 
          d.state = 'NORMAL' and
          d.mount_status = 'CACHED'
        group by 
          g.name, 
          op.operation,
          op.power
        ]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>

 <!-- 
  ==================================================================
  == unavailable_failure_group (ASM unavailable failure group)
  == Purpose: Alert on failure groups with all member disks offline
  ==================================================================
  -->
  <Metric NAME="unavailable_failure_group" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
    </ValidIf>
   <Display>
      <Label NLSID="failure_group_status">Failure Group Status</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="diskGroup" TYPE="STRING" IS_KEY="TRUE">
       <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group</Label>
        </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="failureGroup" TYPE="STRING" IS_KEY="TRUE">
       <Display>
          <Label NLSID="failure_group_name">Failure Group</Label>
       </Display>
      </ColumnDescriptor> 
      <ColumnDescriptor NAME="fgDiskCount" TYPE="NUMBER">
        <Display>
          <Label NLSID="disk_count">Total Disks</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="fgOfflineDiskCount" TYPE="NUMBER" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="disk_status_rollup">Offline Disk Count</Label>
        </Display>
      </ColumnDescriptor>
     <ColumnDescriptor NAME="fgAvailDiskCount" TYPE="NUMBER"
        COMPUTE_EXPR="fgDiskCount - fgOfflineDiskCount">
        <Display>
          <Label NLSID="available_disks">Available Disks</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="fgAlertDiskCount" TYPE="NUMBER"
        COMPUTE_EXPR="fgDiskCount > 1 ? fgAvailDiskCount : 1">
        <Display>
          <Label NLSID="alert_disk_count">Disk Count for Alerts</Label>
        </Display>
      </ColumnDescriptor> 
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
        <![CDATA[
        select x.name, x.fg, x.cnt, nvl(y.cnt,0)
        from
         (select dg.name name, failgroup fg, count(disk_number) cnt from v$asm_disk_stat d, v$asm_diskgroup_stat dg where d.group_number <> 0 and d.group_number = dg.group_number group by d.group_number, failgroup, dg.name) x,
         (select dg.name name, failgroup fg, count(disk_number) cnt from v$asm_disk_stat d, v$asm_diskgroup_stat dg where d.group_number <> 0 and d.group_number = dg.group_number and mode_status = 'OFFLINE' group by d.group_number, failgroup, dg.name) y
        where x.name = y.name (+)
        and x.fg = y.fg (+)
        and x.cnt > 0
        ]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>

  <!--
  ==================================================================
  == alertLog
  ==================================================================
    -->
  <Metric NAME="alertLog" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR1;10gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="oracle_database_alertLog">Alert Log</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="alertTime" TYPE="STRING" IS_TIMESTAMP="TRUE" TRANSIENT="TRUE" HELP="NO_HELP">
        <Display>
          <Label NLSID="alert_time">Alert Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="timeLine" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="oracle_database_alertLog_timeLine">Timestamp/LineNumber</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="genericErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display>
          <Label NLSID="oracle_database_alertLog_genericErrStack">Alert Log Error Stack</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="archiveHungErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display>
          <Label NLSID="oracle_database_alertLog_archiveHungErrStack">Archive Hung Error Stack</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="blockCorruptErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display>
          <Label NLSID="oracle_database_alertLog_blockCorruptErrStack">Data Block Corruption Error Stack</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="sessTerminateErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display>
          <Label NLSID="oracle_database_alertLog_sessTerminateErrStack">Session Terminated Error Stack</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="mediaFailureErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display>
          <Label NLSID="oracle_database_alertLog_mediaFailureErrStack">Media Failure Error Stack</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="traceFileName" TYPE="STRING" IS_KEY="FALSE">
        <Display>
          <Label NLSID="oracle_database_alertLog_traceFileName">Alert Log Error Stack Trace File Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="errCodes" TYPE="STRING" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="oracle_database_alertLog_errCodes">Witnessed Error Codes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="alertLogName" TYPE="STRING" IS_KEY="FALSE">
        <Display>
          <Label NLSID="oracle_database_alertLog_fileName">Alert Log Name</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="OSLineToken">
      <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
      <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
      <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
      <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
      <Property NAME="log_file_absolute" SCOPE="INSTANCE">alert_log_file</Property>
      <Property NAME="log_timestamp_format" SCOPE="GLOBAL"><![CDATA[(\w+) (\w+)( |  )31 023:059:059 02037]]></Property>
      <Property NAME="background_dump_dest" SCOPE="INSTANCE">background_dump_dest</Property>
      <Property NAME="user_dump_dest" SCOPE="INSTANCE">user_dump_dest</Property>
      <Property NAME="ignorePattern" SCOPE="GLOBAL">""</Property>
      <Property NAME="command" SCOPE="GLOBAL">
         %perlBin%/perl %scriptsDir%/alertlog.pl %log_file_absolute% '%log_timestamp_format%' 'ORA' %background_dump_dest% %user_dump_dest% 250 %ignorePattern%
      </Property>
      <Property NAME="ENVEM_TARGET_GUID" SCOPE="INSTANCE">GUID</Property>
      <Property NAME="ENVEM_TARGET_ORACLE_HOME" SCOPE="INSTANCE">OracleHome</Property>
      <Property NAME="ENVEM_TARGET_ORACLE_SID" SCOPE="INSTANCE">SID</Property>
      <Property NAME="ENVEM_AGENT_STATE_DIR" SCOPE="SYSTEMGLOBAL">agentStateDir</Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPES" SCOPE="GLOBAL">4</Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE1" SCOPE="GLOBAL">00257,16038</Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE2" SCOPE="GLOBAL">01157,01578,27048</Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE3" SCOPE="GLOBAL">00603</Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE4" SCOPE="GLOBAL">15130,15049,15050,15051</Property>
    </QueryDescriptor>
  </Metric>
  <!--
  ======================================================================
  == Category:         Alert Log Status
  == Collection Level: Minimum
  == Purpose:          Alerts
  ======================================================================
    -->
  <Metric NAME="alertLogStatus" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR1;10gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="alertLogStatus">Alert Log Error Status</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="genericErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="alertLogStatus_genericErrors">Generic Alert Log Error Status</Label>

        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="archiveHungErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="alertLogStatus_archiveHungErrors">Archiver Hung Alert Log Error Status</Label>

        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="blockCorruptErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="alertLogStatus_blockCorruptErrors">Data Block Corruption Alert Log Error Status</Label>
          <ShortName NLSID="alertLogStatus_blockCorruptErrors_sht">Data Block Corruption Error Status</ShortName>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="sessTerminateErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="alertLogStatus_sessTerminateErrors">Session Terminated Alert Log Error Status</Label>
          <ShortName NLSID="alertLogStatus_sessTerminateErrors_sht">Session Terminated Error Status</ShortName>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="mediaFailureErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="alertLogStatus_mediaFailureErrors">Media Failure Alert Log Error Status</Label>
          <ShortName NLSID="alertLogStatus_mediaFailureErrors_sht">Media Failure Error Status</ShortName>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <ExecutionDescriptor>
      <GetTable NAME="alert_log_errors" METRIC_NAME="alertLog" USE_CACHE="TRUE"/>
      <GetView NAME="generic_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="genericErrStack"/>
        <Filter COLUMN_NAME="genericErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="generic_alert_log_rollup" FROM_TABLE="generic_alert_log_errors">
        <AggregateColumn NAME="genericErrors" COLUMN_NAME="genericErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="archive_hung_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="archiveHungErrStack"/>
        <Filter COLUMN_NAME="archiveHungErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="archive_hung_alert_log_rollup" FROM_TABLE="archive_hung_alert_log_errors">
        <AggregateColumn NAME="archiveHungErrors" COLUMN_NAME="archiveHungErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="block_corrupt_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="blockCorruptErrStack"/>
        <Filter COLUMN_NAME="blockCorruptErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="block_corrupt_alert_log_rollup" FROM_TABLE="block_corrupt_alert_log_errors">
        <AggregateColumn NAME="blockCorruptErrors" COLUMN_NAME="blockCorruptErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="sess_terminate_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="sessTerminateErrStack"/>
        <Filter COLUMN_NAME="sessTerminateErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="sess_terminate_alert_log_rollup" FROM_TABLE="sess_terminate_alert_log_errors">
        <AggregateColumn NAME="sessTerminateErrors" COLUMN_NAME="sessTerminateErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="media_failure_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="mediaFailureErrStack"/>
        <Filter COLUMN_NAME="mediaFailureErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="media_failure_alert_log_rollup" FROM_TABLE="media_failure_alert_log_errors">
        <AggregateColumn NAME="mediaFailureErrors" COLUMN_NAME="mediaFailureErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <JoinTables NAME="alertLogStatus">
        <Table NAME="generic_alert_log_rollup"/>
        <Table NAME="archive_hung_alert_log_rollup"/>
        <Table NAME="block_corrupt_alert_log_rollup"/>
        <Table NAME="sess_terminate_alert_log_rollup"/>
        <Table NAME="media_failure_alert_log_rollup"/>
      </JoinTables>
    </ExecutionDescriptor>
  </Metric>

  <!--
  ==================================================================
  == alertLogContent
  ==================================================================
    -->
  <Metric NAME="alertLogContent" TYPE="TABLE" USAGE_TYPE="HIDDEN">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="10gR1;10gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="oracle_database_alertLogContent">Alert Log Content</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="alertLogContent" TYPE="STRING" IS_KEY="FALSE">
          <Display>
            <Label NLSID="oracle_database_alertLog_content">Content</Label>
          </Display>
        </ColumnDescriptor>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="OS">
      <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
      <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
      <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="OracleHome" SCOPE="INSTANCE">OracleHome</Property>
      <Property NAME="GetDumpDestination" SCOPE="INSTANCE">background_dump_dest</Property>
      <Property NAME="sizeToView" SCOPE="GLOBAL">"100000"</Property>
      <Property NAME="startTime" SCOPE="USER" OPTIONAL="TRUE">startTime</Property>
      <Property NAME="endTime" SCOPE="USER" OPTIONAL="TRUE">endTime</Property>
      <Property NAME="command" SCOPE="GLOBAL">
         %perlBin%/perl %scriptsDir%/alertlogViewer.pl %OracleHome% %GetDumpDestination% %SID% %sizeToView% %startTime% %endTime%
      </Property>
    </QueryDescriptor>
  </Metric>

  <!--
  ======================================================================
  == Category:         Recommended ASM Disk Group Settings
  == Collection Level: Recommended
  == Purpose:          ASM Disk Group Policies
  ==
  ==  Numeric values correspond to specific problems and recommendations:
  ==   1 Disk Group Contains Disks of Significantly Different Sizes
  ==   2 Disk Group Depends on External Redundancy and has Unprotected Disks
  ==   3 Disk Group Contains Disks with Different Redundancy Attributes
  ==   4 Disk Group with NORMAL or HIGH Redundancy has Protected Disks
  ==
  == Added by rreilly on 04-Jun-2004
  ======================================================================
  -->

  <Metric NAME="osm_diskGroupPolicies" TYPE="RAW" KEYS_ONLY="TRUE" CONFIG="TRUE">
    <TableDescriptor TABLE_NAME="MGMT_OSM_DISK_GROUP_ECM">
        <ColumnDescriptor NAME="diskGroup" COLUMN_NAME="disk_group"
                       TYPE="STRING" IS_KEY="TRUE"/>
        <ColumnDescriptor NAME="problem" COLUMN_NAME="problem_code"
                       TYPE="NUMBER" IS_KEY="TRUE"/>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL"><![CDATA[
SELECT "NAME", 1
    FROM (SELECT g."NAME" "NAME",
                 MIN(d.total_mb) "MIN_SIZE",
                 MAX(d.total_mb) "MAX_SIZE"
              FROM v$asm_diskgroup_stat g, v$asm_disk_stat d
              WHERE d.group_number != 0
                AND g.group_number = d.group_number
              GROUP BY g."NAME")
    WHERE min_size + 0.05 * min_size < "MAX_SIZE"
UNION
SELECT g."NAME", DECODE(g."TYPE", 'EXTERN', 2, 'NORMAL', 4, 'HIGH', 4)
    FROM v$asm_diskgroup_stat g
    WHERE (g."TYPE" = 'EXTERN'
      OR  g."TYPE" = 'NORMAL'
      OR  g."TYPE" = 'HIGH')
      AND EXISTS (SELECT d.redundancy
                      FROM v$asm_disk_stat d
                      WHERE d.group_number != 0
                        AND (g."TYPE" = 'EXTERN'
                        AND d.redundancy = 'UNPROT'
                        OR  (g."TYPE" = 'HIGH'
                        OR  g."TYPE" = 'NORMAL')
                        AND (d.redundancy = 'MIRROR'
                        OR  d.redundancy = 'PARITY'))
                        AND d.group_number = g.group_number)
UNION
SELECT g."NAME", 3
    FROM v$asm_diskgroup_stat g
    WHERE g.group_number = group_number
      AND EXISTS (SELECT d1.group_number
                      FROM v$asm_disk_stat d2, v$asm_disk_stat d1
                      WHERE d1.redundancy != 'UNKNOWN'
                        AND d2.redundancy != 'UNKNOWN'
                        AND d1.group_number != 0
                        AND d1.group_number = g.group_number
                        AND d2.group_number = g.group_number
                        AND d2.group_number = d1.group_number
                        AND d1.redundancy != d2.redundancy)
]]></Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR1"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL"><![CDATA[
SELECT "NAME", 1
    FROM (SELECT g."NAME" "NAME",
                 MIN(d.total_mb) "MIN_SIZE",
                 MAX(d.total_mb) "MAX_SIZE"
              FROM v$asm_diskgroup g, v$asm_disk d
              WHERE d.group_number != 0
                AND g.group_number = d.group_number
              GROUP BY g."NAME")
    WHERE min_size + 0.05 * min_size < "MAX_SIZE"
UNION
SELECT g."NAME", DECODE(g."TYPE", 'EXTERN', 2, 'NORMAL', 4, 'HIGH', 4)
    FROM v$asm_diskgroup g
    WHERE (g."TYPE" = 'EXTERN'
      OR  g."TYPE" = 'NORMAL'
      OR  g."TYPE" = 'HIGH')
      AND EXISTS (SELECT d.redundancy
                      FROM v$asm_disk d
                      WHERE d.group_number != 0
                        AND (g."TYPE" = 'EXTERN'
                        AND d.redundancy = 'UNPROT'
                        OR  (g."TYPE" = 'HIGH'
                        OR  g."TYPE" = 'NORMAL')
                        AND (d.redundancy = 'MIRROR'
                        OR  d.redundancy = 'PARITY'))
                        AND d.group_number = g.group_number)
UNION
SELECT g."NAME", 3
    FROM v$asm_diskgroup g
    WHERE g.group_number = group_number
      AND EXISTS (SELECT d1.group_number
                      FROM v$asm_disk d2, v$asm_disk d1
                      WHERE d1.redundancy != 'UNKNOWN'
                        AND d2.redundancy != 'UNKNOWN'
                        AND d1.group_number != 0
                        AND d1.group_number = g.group_number
                        AND d2.group_number = g.group_number
                        AND d2.group_number = d1.group_number
                        AND d1.redundancy != d2.redundancy)
]]></Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>


    <!--
  ======================================================================
  == disk_status
  == Purpose:  Alert when disk mode_status becomes OFFLINE
  ======================================================================
    -->
  <Metric NAME="disk_status" TYPE="TABLE" USAGE_TYPE="VIEW_COLLECT">
    <Display>
      <Label NLSID="disk_status">Disk Status</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="disk_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_disk_name">Disk Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="mode_status" TYPE="STRING">
        <Display>
          <Label NLSID="osm_instance_disk_mode_status">Disk Mode Status</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR2;11gR1;11gR2"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL"><![CDATA[
SELECT g.name, d.name, d.mode_status
FROM v$asm_disk_stat d, v$asm_diskgroup_stat g
WHERE d.group_number != 0
  AND g.group_number != 0
  AND d.group_number = g.group_number
]]></Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="10gR1"/>
      </ValidIf>
      <Property NAME="STATEMENT" SCOPE="GLOBAL"><![CDATA[
SELECT g.name, d.name, d.mode_status
FROM v$asm_disk d, v$asm_diskgroup g
WHERE d.group_number != 0
  AND g.group_number != 0
  AND d.group_number = g.group_number
]]></Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>
    <!--
  ======================================================================
  == disk_status_rollup
  == Purpose:  Alert on count of disk mode_status = OFFLINE
  ======================================================================
    -->
  <Metric NAME="disk_status_rollup" TYPE="TABLE" USAGE_TYPE="VIEW_COLLECT">
    <Display>
      <Label NLSID="disk_status_rollup">Offline Disk Count</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="offline_count" TYPE="NUMBER">
        <Display>
          <Label NLSID="disk_status_rollup">Offline Disk Count</Label>
        </Display>
      </ColumnDescriptor>
      <!-- Calculate the change in the number of offline disks.  We will
           send data back to the repository only when the number of offline disks
           change to avoid flooding it. -->
      <ColumnDescriptor NAME="delta_offline" TYPE="NUMBER" TRANSIENT="TRUE" HELP="NO_HELP"
                        COMPUTE_EXPR="offline_count - _offline_count">
        <Display>
          <Label NLSID="osm_instance_delta_offline">Delta Offline Disks</Label>
        </Display>
      </ColumnDescriptor>

    </TableDescriptor>
    <ExecutionDescriptor>
      <GetTable NAME="disk_status_table" METRIC_NAME="disk_status" USE_CACHE="TRUE"/>
      <GetView NAME="disk_status_offline" FROM_TABLE="disk_status_table">
        <Filter COLUMN_NAME="mode_status" OPERATOR="EQ">OFFLINE</Filter>
      </GetView>
      <GroupBy NAME="count_offline_disks" FROM_TABLE="disk_status_offline">
        <AggregateColumn NAME="offline_count"
                         COLUMN_NAME="mode_status"
                         OPERATOR="COUNT"/>
      </GroupBy>
    </ExecutionDescriptor>
 </Metric>


  <!-- OFS metrics -->
  <!-- Check the ofs state (whether it's currently mounted or dismounted). 
       It's dismounted only when:
       1. The usage of the volume is "ofs"
       2. The mountpath is not empty and not in v$asm_filesystem fs_name list
  -->
  <Metric NAME="OFS_State" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR2"/> 
    </ValidIf>
    <Display>
      <Label NLSID="ofs_state_metric_name">ASM Cluster File System State</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="volume_device" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="volume_device">Volume Device</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_mountpoint" TYPE="STRING">
        <Display>
          <Label NLSID="ofs_mountpoint">ASM Cluster File System Mount Point</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_mount_state" TYPE="STRING">
        <Display>
          <Label NLSID="ofs_mount_state">ASM Cluster File System Mount State</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_availability" TYPE="STRING">
        <Display>
          <Label NLSID="ofs_availability">ASM Cluster File System Availability</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_uptime" TYPE="STRING">
        <Display>
          <Label NLSID="ofs_uptime">ASM Cluster File System Available Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_host" TYPE="STRING" 
        COMPUTE_EXPR="__prop_MachineName" IS_KEY="TRUE">
        <Display>
          <Label NLSID="ofs_host">Host</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
       <![CDATA[
            select v.volume_device, NVL(fs.fs_name, ' '), 'MOUNTED', fs.state,
                 fs.available_time
            from v$asm_filesystem fs, v$asm_volume v, v$asm_acfsvolumes ov
            where v.mountpath = fs.fs_name and
              v.mountpath = ov.fs_name and
              ov.primary_vol = 'TRUE' and 
              v.usage = 'ACFS' and
              v.volume_device in (select vol_device from v$asm_acfsvolumes)
 	union all
      	    select vol.volume_device, vol.mountpath, 'DISMOUNTED', null, null
            from v$asm_volume vol
            where vol.usage = 'ACFS' and
                 vol.volume_device not in
                 (select vol_device from v$asm_acfsvolumes)
        union all
          select ' ',' ',' ', null, null
        from dual
         order by 1
       ]]>
      </Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="MachineName" SCOPE="HOST">NAME</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>
    
  <Metric NAME="Single_Instance_OFS_Summary" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="single_instance_ofs_summary_metric_name">ASM Cluster File System</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="ofs_volume_device" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="volume_device">Volume Device</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_volume_name" TYPE="STRING">
        <Display>
          <Label NLSID="volume_name">Volume Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_corrupted_state" TYPE="STRING">
        <Display>
          <Label NLSID="ofs_corrupt">Corrupt</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="dg_alloc_size_gb" TYPE="NUMBER">
        <Display>
          <Label NLSID="dg_alloc_size_gb">Disk Group Allocated Space (GB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_size_gb" TYPE="NUMBER">
        <Display>
          <Label NLSID="ofs_size_gb">Size (GB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_free_gb" TYPE="NUMBER">
        <Display>
          <Label NLSID="ofs_free_gb">Free (GB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_used_gb" TYPE="NUMBER">
        <Display>
          <Label NLSID="ofs_used_gb">Used (GB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_snap_used_mb" TYPE="NUMBER">
        <Display>
          <Label NLSID="ofs_snap_used_mb">Used (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_diskgroup" TYPE="STRING" IS_KEY="TRUE"> 
        <Display>
          <Label NLSID="ofs_diskgroup">Disk Group</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="ofs_used_pct" TYPE="NUMBER"
        COMPUTE_EXPR="(ofs_used_gb == 0)?0:(((ofs_size_gb-ofs_free_gb)/ofs_size_gb)*100)">
        <Display>
          <Label NLSID="ofs_used_pct">Used (%)</Label>
          <Unit NLSID="em__sys__standard_percent">%</Unit>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
       <![CDATA[
       select v.volume_device, v.volume_name,  
              fs.corrupt, f.space,
              fs.total_size/1024, fs.total_free/1024,
              (fs.total_size - fs.total_free)/1024,  
              fs.total_snap_space_usage,
              dg.name
         from v$asm_filesystem fs, v$asm_volume v, 
              v$asm_diskgroup_stat dg, v$asm_acfsvolumes ov, 
              (select v.group_number group_number, v.file_number file_number,
                      sum(f.space)/1024/1024/1024 space
			           from v$asm_volume v, v$asm_file f
			          where v.group_number = f.group_number
			            and v.file_number=f.file_number
				        group by v.group_number, v.file_number) f
        where v.mountpath = fs.fs_name and 
              v.mountpath = ov.fs_name and
              ov.primary_vol='TRUE' and 
              v.group_number = dg.group_number and
              v.group_number = f.group_number and
              v.file_number = f.file_number and
              v.usage = 'ACFS' and
              v.volume_device in (select vol_device from v$asm_acfsvolumes)
      union all
      select vol.volume_device, vol.volume_name, null, 
             f.space,
             vol.size_mb/1024,0,0,0,dg.name
        from v$asm_volume vol, v$asm_diskgroup_stat dg, 
              (select v.group_number group_number, v.file_number file_number,
                      sum(f.space)/1024/1024/1024 space
			           from v$asm_volume v, v$asm_file f
			          where v.group_number = f.group_number
			            and v.file_number=f.file_number
				        group by v.group_number, v.file_number) f
       where vol.usage = 'ACFS' and 
             vol.group_number = dg.group_number and
             vol.group_number = f.group_number and 
             vol.file_number = f.file_number and 
             vol.volume_device not in
             (select vol_device from v$asm_acfsvolumes)
      union all
      select ' ',' ', null, null, null, null, null, null, null
        from dual
         order by 1
       ]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>


  <Metric NAME="Volumes_Summary" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR2"/> 
    </ValidIf>
    <Display>
      <Label NLSID="volumes_summary_metric_name">ASM Volumes</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="volume_device" TYPE="STRING" IS_KEY="TRUE"> 
        <Display>
          <Label NLSID="volume_device">Volume Device</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="volume_name" TYPE="STRING"> 
        <Display>
          <Label NLSID="volume_name">Volume Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="volume_status" TYPE="STRING">
        <Display>
          <Label NLSID="volume_status">Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="volume_usage" TYPE="STRING">
        <Display>
          <Label NLSID="volume_usage">Usage</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="volume_mountpath" TYPE="STRING">
        <Display>
          <Label NLSID="volume_mountpoint">Mount Point</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="size_gb" TYPE="NUMBER"> 
        <Display>
          <Label NLSID="volume_size_gb">Size (GB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="dg_alloc_size_gb" TYPE="NUMBER"> 
        <Display>
          <Label NLSID="dg_alloc_size_gb">Disk Group Allocated Space (GB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="diskgroup" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="volume_diskgroup">Disk Group</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="redundancy" TYPE="STRING">
        <Display>
          <Label NLSID="volume_redundancy">Redundancy</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="host" TYPE="STRING" 
        COMPUTE_EXPR="__prop_MachineName" IS_KEY="TRUE">
        <Display>
          <Label NLSID="volume_host">Host</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
      <![CDATA[
      select v.volume_device, v.volume_name, v.state, v.usage, v.mountpath, 
             v.size_mb/1024, f.space,
             dg.name, v.redundancy
        from v$asm_volume v, v$asm_diskgroup_stat dg,
		         (select v.group_number group_number, v.file_number file_number,
                     sum(f.space)/1024/1024/1024 space
			          from v$asm_volume v, v$asm_file f
			         where v.group_number=f.group_number
			           and v.file_number=f.file_number
				       group by v.group_number, v.file_number) f
       where v.group_number=dg.group_number
         and v.group_number=f.group_number
         and v.file_number=f.file_number
      union all
      select null,' ',null,' ',' ',null,null,null,null from dual
      ]]>
      </Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="MachineName" SCOPE="HOST">NAME</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>

  
  <!-- Volume Perfromance metrics -->
  <Metric NAME="Instance_Volume_Performance" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR2"/> 
    </ValidIf>
    <Display>
      <Label NLSID="volume_inst_performance">Instance Volume Performance</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="inst_id" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_inst_id">Instance ID</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="volume_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="volume_name">Volume Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_reads">Reads</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes">Writes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_time" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_read_time">Read Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_time" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_write_time">Write Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_read" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_bytes_read">Bytes Read</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_written" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_bytes_written">Bytes Written</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_io">Total I/O</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_time" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_total_io_time">Total I/O Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_io" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_bytes_total">Total I/O Bytes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_errs" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_errs">Read Errors</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_errs" TRANSIENT="TRUE" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_write_errs">Write Errors</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_write_errs" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="(read_errs > _read_errs)?((read_errs - _read_errs) + (write_errs - _write_errs)):0">
        <Display>
          <Label NLSID="osm_instance_read_write_errs">Read Write Errors</Label>
        </Display>
      </ColumnDescriptor>


      <ColumnDescriptor NAME="reads_ps" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((reads > _reads)?(reads - _reads)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_reads_ps">Reads Per Second</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="writes_ps" TYPE="NUMBER" IS_KEY="FALSE"
       COMPUTE_EXPR="((writes > _writes)?(writes - _writes)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_writes_ps">Writes Per Second</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_ps" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((io > _io)?(io - _io)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_io_per_sec">I/O per second</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_throughput" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((bytes_read > _bytes_read)?(bytes_read - _bytes_read)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_read_throughput">Read Throughput</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="write_throughput" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((bytes_written > _bytes_written)?(bytes_written - _bytes_written)/(__interval):0)">
        <Display>
          <Label NLSID="osm_instance_write_throughput">Write Throughput</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_throughput" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((bytes_io > _bytes_io)?(bytes_io - _bytes_io)/(__interval):0)">
         <Display>
          <Label NLSID="osm_instance_io_throughput">IO Throughput</Label> 
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((reads > _reads)?(read_time - _read_time)/(reads - _reads):0)*10">
         <Display>
          <Label NLSID="osm_instance_read_response_time">Read Response Time</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="write_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((writes >_writes)?(write_time - _write_time)/(writes - _writes):0)*10">
        <Display>
          <Label NLSID="osm_instance_write_response_time">Write Response Time</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="io_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((io >_io)?(io_time - _io_time)/(io - _io):0)*10">
        <Display>
          <Label NLSID="osm_instance_io_response_time">Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((io > _io)?((bytes_io - _bytes_io)/(io - _io)):0)">
        <Display>
          <Label NLSID="osm_instance_io_size_mb">IO Size (MB)</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="read_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((reads > _reads)?((bytes_read - _bytes_read)/(reads - _reads)):0)">
        <Display>
          <Label NLSID="osm_instance_read_size_mb">Read Size (MB)</Label>
        </Display>
      </ColumnDescriptor>

      <ColumnDescriptor NAME="write_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((writes > _writes)?((bytes_written - _bytes_written)/(writes - _writes)):0)">
        <Display>
          <Label NLSID="osm_instance_write_size_mb">Write Size (MB)</Label>
        </Display>
      </ColumnDescriptor>

    </TableDescriptor>

    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
  select to_char(dg.inst_id) "Instance ID", dg.name "Disk Group Name", vs.volume_name "Volume Name",
  vs.reads "Reads", vs.writes "Writes",
  vs.read_time "Read Time" , vs.write_time "Write Time",
  vs.bytes_read/1024/1024 "Bytes Read", vs.bytes_written/1024/1024 "Bytes Written",
  vs.reads+vs.writes "Total IO", vs.read_time+vs.write_time "Total IO time", 
  (vs.bytes_read+vs.bytes_written)/1024/1024 "Total IO Bytes",
  vs.read_errs "Read Errors", vs.write_errs "Write Errors"
  from GV$ASM_DISKGROUP_STAT dg, GV$ASM_VOLUME_STAT vs
  where dg.group_number = vs.group_number
  AND dg.inst_id = vs.inst_id
  ORDER BY dg.inst_id, dg.group_number, vs.volume_name
]]>
      </Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
    </QueryDescriptor>
  </Metric>

  <!--
  ==================================================================
  == Volume_Performance
  ==================================================================
    -->
  <Metric NAME="Volume_Performance" TYPE="TABLE">
    <Display>
      <Label NLSID="volume_cluster_inst_performance">Cluster Volume Performance</Label>
    </Display>

    <TableDescriptor>
      <ColumnDescriptor NAME="dg_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="osm_instance_dg_name">Disk Group Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="volume_name" TYPE="STRING" IS_KEY="TRUE">
        <Display>
          <Label NLSID="volume_name">Volume Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_write_errs" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_write_errs">Read Write Errors</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_reads_ps">Reads per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes_ps">Writes per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_ps" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_io_per_sec">I/O per second</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_read_throughput">Read Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_writes_throughput">Write Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_throughput" TYPE="NUMBER" IS_KEY="FALSE">
        <Display>
          <Label NLSID="osm_instance_io_throughput">IO Throughput</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_io" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_bytes_total">Total I/O Bytes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_io">Total I/O</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_time" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_io_time">Total I/O Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_written" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
         <Label NLSID="osm_instance_bytes_written">Bytes Written</Label>   
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="writes" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_writes">Writes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_time" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_write_time">Write Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="bytes_read" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_bytes_read">Bytes Read</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="reads" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_reads">Reads</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_time" TYPE="NUMBER" IS_KEY="FALSE" TRANSIENT="TRUE">
        <Display>
          <Label NLSID="osm_instance_total_read_time">Read Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((reads >_reads)?(read_time - _read_time)/(reads - _reads):0)*10">
        <Display>
          <Label NLSID="osm_instance_read_response_time">Read Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((writes >_writes)?(write_time - _write_time)/(writes - _writes):0)*10">
        <Display>
          <Label NLSID="osm_instance_write_response_time">Write Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_response_time" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((io >_io)?(io_time - _io_time)/(io - _io):0)*10">
        <Display>
          <Label NLSID="osm_instance_response_time">Response Time</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="io_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((io > _io)?((bytes_io - _bytes_io)/(io - _io)):0)">
        <Display>
          <Label NLSID="osm_instance_io_size_mb">IO Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="read_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((reads > _reads)?((bytes_read - _bytes_read)/(reads - _reads)):0)">
        <Display>
          <Label NLSID="osm_instance_read_size_mb">Read Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="write_size" TYPE="NUMBER" IS_KEY="FALSE"
        COMPUTE_EXPR="((writes > _writes)?((bytes_written - _bytes_written)/(writes - _writes)):0)">
        <Display>
          <Label NLSID="osm_instance_write_size_mb">Write Size (MB)</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>

    <ExecutionDescriptor>
      <GetTable NAME="Instance_Volume_Performance" USE_CACHE="TRUE"/>
      <GroupBy NAME="avg_response" FROM_TABLE="Instance_Volume_Performance">
        <By NAME="dg_name" COLUMN_NAME="dg_name"/>
        <By NAME="volume_name" COLUMN_NAME="volume_name"/>
        <AggregateColumn  NAME="read_write_errs"
                          COLUMN_NAME="read_write_errs"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="reads_ps"
                          COLUMN_NAME="reads_ps"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="writes_ps"
                          COLUMN_NAME="writes_ps"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io_ps"
                          COLUMN_NAME="io_ps"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="read_throughput"
                          COLUMN_NAME="read_throughput"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="write_throughput"
                          COLUMN_NAME="write_throughput"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io_throughput"
                          COLUMN_NAME="io_throughput"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="bytes_io"
                          COLUMN_NAME="bytes_io"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io"
                          COLUMN_NAME="io"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="io_time"
                          COLUMN_NAME="io_time"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="bytes_written"
                          COLUMN_NAME="bytes_written"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="writes"
                          COLUMN_NAME="writes"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="write_time"
                          COLUMN_NAME="write_time"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="bytes_read"
                          COLUMN_NAME="bytes_read"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="reads"
                          COLUMN_NAME="reads"
                          OPERATOR="SUM" />
        <AggregateColumn  NAME="read_time"
                          COLUMN_NAME="read_time"
                          OPERATOR="SUM" />
      </GroupBy>
    </ExecutionDescriptor>
  </Metric>
  <!-- END OFS metrics -->

  <!--
    ======================================================================
    == Category:         Incident Meter
    == Collection Level: Minimum
    == Purpose:          To upload the incident meter to the repository
    ======================================================================
    -->
  <Metric NAME="incident_meter" TYPE="TABLE" USAGE_TYPE="COLLECT_UPLOAD">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2" />
    </ValidIf>
    <TableDescriptor>
      <ColumnDescriptor NAME="severity_index" TYPE="STRING" HELP="NO_HELP"/>
      <ColumnDescriptor NAME="critical_incidents" HELP="NO_HELP"/>
      <ColumnDescriptor NAME="warning_incidents" HELP="NO_HELP"/>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="SQL">
      <Property NAME="STATEMENT" SCOPE="GLOBAL"><![CDATA[
select RTRIM(severity_index, ' ') severity_index,
       critical_inicdents,
       warning_incidents
  from v$incmeter_summary
      ]]></Property>
      <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
      <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
      <Property NAME="SID" SCOPE="INSTANCE">SID</Property>
      <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
      <Property NAME="password" SCOPE="INSTANCE">password</Property>
      <Property NAME="Role" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))</Property>
    </QueryDescriptor>
  </Metric>

  <!--
    ======================================================================
    == ADRViewer Metric
    == Collection Level: {Not Collected}
    == Purpose:          On-Demand
    ======================================================================
    -->
  <Metric NAME="adr_viewer" TYPE="TABLE" USAGE_TYPE="HIDDEN">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
    </ValidIf>
    <TableDescriptor>
      <ColumnDescriptor NAME="dummy" TYPE="STRING" IS_KEY="FALSE"/>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="OS">
      <Property NAME="OracleHome" SCOPE="INSTANCE">OracleHome</Property>
      <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
      <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
      <Property NAME="ARG" SCOPE="USER" OPTIONAL="TRUE">ARG</Property>
      <Property NAME="ENVEM_TARGET_SWEEP" SCOPE="USER" OPTIONAL="TRUE">SWEEP</Property>
      <Property NAME="ENVEM_TARGET_ORACLE_HOME" SCOPE="INSTANCE">OracleHome</Property>
      <Property NAME="ENVEM_TARGET_ORACLE_SID" SCOPE="INSTANCE">SID</Property>
      <Property NAME="ENVEM_TARGET_ADR_BASE" SCOPE="INSTANCE">AdrBase</Property>
      <Property NAME="ENVEM_TARGET_ADR_HOME" SCOPE="INSTANCE">AdrHome</Property>
      <Property NAME="ENVEM_AGENT_STATE_DIR" SCOPE="SYSTEMGLOBAL">agentStateDir</Property>
      <Property NAME="command" SCOPE="GLOBAL">%perlBin%/perl -I %OracleHome%/lib %scriptsDir%/adrviewer.pl "%ARG%"</Property>
      <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
      <Property NAME="STDINARGLIST" SCOPE="USER" OPTIONAL="TRUE">ARGLIST</Property>
    </QueryDescriptor>
  </Metric>

  <!--
  ======================================================================
  == Category:         ADR Alert Log Error
  == Collection Level: Minimum
  == Purpose:          Alerts
  ======================================================================
    -->
  <Metric NAME="adrAlertLogError" TYPE="TABLE" USAGE_TYPE="HIDDEN_COLLECT" HELP="NO_HELP">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
    </ValidIf>
    <TableDescriptor>
      <ColumnDescriptor NAME="timeLine" TYPE="STRING" IS_KEY="TRUE"/>
      <ColumnDescriptor NAME="errorCategory" TYPE="STRING" IS_KEY="FALSE"/>

      <!-- incident errors -->
      <ColumnDescriptor NAME="genericInternalErrStack" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="sessTerminateErrStack" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="internalSqlErrStack" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="accessViolationErrStack" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="fileAccessErrStack" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="outOfMemoryErrStack" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="clusterErrStack" TYPE="STRING" IS_KEY="FALSE"/>      
      <ColumnDescriptor NAME="deadlockErrStack" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="asmBlockCorruptionErrStack" TYPE="STRING" IS_KEY="FALSE"/>      
      <ColumnDescriptor NAME="redoLogCorruptionErrStack" TYPE="STRING" IS_KEY="FALSE"/>

      <!-- catch-all errors should be the last of the group -->
      <ColumnDescriptor NAME="genericIncidentErrStack" TYPE="STRING" IS_KEY="FALSE"/>

      <!-- checker failures -->
      <ColumnDescriptor NAME="genericCheckerFailureErrStack" TYPE="STRING" IS_KEY="FALSE"/>

      <!-- operational errors -->
      <ColumnDescriptor NAME="dataBlockCorruptionErrStack" TYPE="STRING" IS_KEY="FALSE"/>      
      <ColumnDescriptor NAME="mediaFailureErrStack" TYPE="STRING" IS_KEY="FALSE"/>

      <!-- catch-all errors should be the last of the group -->
      <ColumnDescriptor NAME="genericOperationalErrStack" TYPE="STRING" IS_KEY="FALSE"/>

      <ColumnDescriptor NAME="traceFileName" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="errCodes" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="alertLogName" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="impact" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="incidentId" TYPE="STRING" IS_KEY="FALSE"/>
      <ColumnDescriptor NAME="numberOfFailures" TYPE="STRING" IS_KEY="FALSE"/>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="OSLineToken">
      <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
      <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
      <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
      <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
      <Property NAME="AdrHome" SCOPE="INSTANCE">AdrHome</Property>
      <Property NAME="command" SCOPE="GLOBAL">
        %perlBin%/perl %scriptsDir%/alertlogAdr.pl %AdrHome% 270
      </Property>
<!-- TODO: make these available for ASM
      <Property NAME="ConvertFromCharset" SCOPE="INSTANCE" OPTIONAL="TRUE">ConvertFromCharset</Property>
      <Property NAME="needCharsetConvert" SCOPE="INSTANCE" OPTIONAL="TRUE">needCharsetConvert</Property>
  -->
      <Property NAME="ENVEM_TARGET_GUID" SCOPE="INSTANCE">GUID</Property>
      <Property NAME="ENVEM_AGENT_STATE_DIR" SCOPE="SYSTEMGLOBAL">agentStateDir</Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPES" SCOPE="GLOBAL">15</Property>
      <!-- error category, match patterns, ... -->
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE1" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']Generic Internal Error["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE2" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']Session Terminated["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE3" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']Internal SQL Error["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE4" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']Access Violation["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE5" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']File Access Error["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE6" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']Out of Memory["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE7" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']Cluster Error["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE8" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']Deadlock["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE9" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']Data Block Corruption["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE10" SCOPE="GLOBAL"><![CDATA[incident,type=["']INCIDENT_ERROR["'],group=["']Redo Log Corruption["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE11" SCOPE="GLOBAL"><![CDATA[incident,level=["'][12]["'],type=["']INCIDENT_ERROR["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE12" SCOPE="GLOBAL"><![CDATA[checkerFailure,type=["']ERROR["'],group=["']ASM["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE13" SCOPE="GLOBAL"><![CDATA[operational,type=["']ERROR["'],group=["']Data Block Corruption["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE14" SCOPE="GLOBAL"><![CDATA[operational,type=["']ERROR["'],group=["']Media Failure["']]]></Property>
      <Property NAME="ENVEM_ALERTLOG_ERROR_TYPE15" SCOPE="GLOBAL"><![CDATA[operational,level=["'][12]["'],type=["']ERROR["']]]></Property>
    </QueryDescriptor>
  </Metric>

  <!--
  ======================================================================
  == Category:         ADR Alert Log Incident Error
  == Collection Level: Minimum
  == Purpose:          Alerts
  ======================================================================
    -->
  <Metric NAME="adrAlertLogIncidentError" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="adrAlertLogIncidentError">Incident</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="timeLine" TYPE="STRING" IS_KEY="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_timeLine">Time/Line Number</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="genericIncidentErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_genericIncidentErrStack">Generic Incident</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="genericInternalErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_genericInternalErrStack">Generic Internal Error</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="sessTerminateErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_sessTerminateErrStack">Session Terminated</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="internalSqlErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_internalSqlErrStack">Internal SQL Error</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="accessViolationErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_accessViolationErrStack">Access Violation</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="fileAccessErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_fileAccessErrStack">File Access Error</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="outOfMemoryErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_outOfMemoryErrStack">Out of Memory</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="clusterErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_clusterErrStack">Cluster Error</Label>
        </Display>
      </ColumnDescriptor>      
      <ColumnDescriptor NAME="deadlockErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_deadlockErrStack">Deadlock</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="asmBlockCorruptionErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_asmBlockCorruptionErrStack">ASM Block Corruption</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="redoLogCorruptionErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_redoLogCorruptionErrStack">Redo Log Corruption</Label>
        </Display>
      </ColumnDescriptor>                  
      <ColumnDescriptor NAME="traceFileName" TYPE="STRING" IS_KEY="FALSE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_traceFileName">Alert Log Error Trace File</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="errCodes" TYPE="STRING" IS_KEY="FALSE" TRANSIENT="TRUE" HELP="NO_HELP">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_errCodes">Witnessed Error Codes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="alertLogName" TYPE="STRING" IS_KEY="FALSE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_fileName">Alert Log Name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="impact" TYPE="STRING" IS_KEY="FALSE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_impact">Impact</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="incidentId" TYPE="STRING" IS_KEY="FALSE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_incidentId">Incident ID</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <ExecutionDescriptor>
      <GetTable NAME="alert_log_errors" METRIC_NAME="adrAlertLogError" USE_CACHE="TRUE"/>
      <GetView NAME="alert_log_incident_errors" FROM_TABLE="alert_log_errors">
        <Filter COLUMN_NAME="errorCategory" OPERATOR="EQ">incident</Filter>
      </GetView>
      <GetView NAME="alert_log_incident_errors_1" FROM_TABLE="alert_log_incident_errors">
        <Column NAME="timeLine"/>
        <Column NAME="genericIncidentErrStack"/>
        <Column NAME="genericInternalErrStack"/>
        <Column NAME="sessTerminateErrStack"/>
        <Column NAME="internalSqlErrStack"/>
        <Column NAME="accessViolationErrStack"/>
        <Column NAME="fileAccessErrStack"/>
        <Column NAME="outOfMemoryErrStack"/>
        <Column NAME="clusterErrStack"/>
        <Column NAME="deadlockErrStack"/>
        <Column NAME="asmBlockCorruptionErrStack"/>
        <Column NAME="redoLogCorruptionErrStack"/>
        <Column NAME="traceFileName"/>
        <Column NAME="errCodes"/>
        <Column NAME="alertLogName"/>
        <Column NAME="impact"/>
        <Column NAME="incidentId"/>
      </GetView>
    </ExecutionDescriptor>
  </Metric>

  <!--
  ======================================================================
  == Category:         ADR Alert Log Operational Error
  == Collection Level: Minimum
  == Purpose:          Alerts
  ======================================================================
    -->
  <Metric NAME="adrAlertLogOperationalError" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="adrAlertLogOperationalError">Operational Error</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="timeLine" TYPE="STRING" IS_KEY="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_timeLine">Time/Line Number</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="genericOperationalErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_genericOperationalErrStack">Generic Operational Error</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="dataBlockCorruptionErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_dataBlockCorruptionErrStack">Data Block Corruption</Label>
        </Display>
      </ColumnDescriptor>      
      <ColumnDescriptor NAME="mediaFailureErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_mediaFailureErrStack">Media Failure</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="traceFileName" TYPE="STRING" IS_KEY="FALSE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_traceFileName">Alert Log Error Trace File</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="errCodes" TYPE="STRING" IS_KEY="FALSE" TRANSIENT="TRUE" HELP="NO_HELP">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_errCodes">Witnessed Error Codes</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="alertLogName" TYPE="STRING" IS_KEY="FALSE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_fileName">Alert Log Name</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <ExecutionDescriptor>
      <GetTable NAME="alert_log_errors" METRIC_NAME="adrAlertLogError" USE_CACHE="TRUE"/>
      <GetView NAME="alert_log_operational_errors" FROM_TABLE="alert_log_errors">
        <Filter COLUMN_NAME="errorCategory" OPERATOR="EQ">operational</Filter>
      </GetView>
      <GetView NAME="alert_log_operational_errors_1" FROM_TABLE="alert_log_operational_errors">
        <Column NAME="timeLine"/>
        <Column NAME="genericOperationalErrStack"/>
        <Column NAME="dataBlockCorruptionErrStack"/>
        <Column NAME="mediaFailureErrStack"/>
        <Column NAME="traceFileName"/>
        <Column NAME="errCodes"/>
        <Column NAME="alertLogName"/>
      </GetView>
    </ExecutionDescriptor>
  </Metric>

  <!--
  ======================================================================
  == Category:         ADR Alert Log Checker Failure
  == Collection Level: Minimum
  == Purpose:          Alerts
  ======================================================================
  -->
  <Metric NAME="adrAlertLogCheckerFailure" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="adrAlertLogCheckerFailure">Checker Failure</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="timeLine" TYPE="STRING" IS_KEY="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_timeLine">Time/Line Number</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="genericCheckerFailureErrStack" TYPE="STRING" STATELESS_ALERTS="TRUE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_genericCheckerFailureErrStack">Checker Failure Detected</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="numberOfFailures" TYPE="STRING" IS_KEY="FALSE" HELP="NO_HELP">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_numberOfFailures">Number of Failures</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="alertLogName" TYPE="STRING" IS_KEY="FALSE">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLog_fileName">Alert Log Name</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <ExecutionDescriptor>
      <GetTable NAME="alert_log_errors" METRIC_NAME="adrAlertLogError" USE_CACHE="TRUE"/>
      <GetView NAME="alert_log_checker_failures" FROM_TABLE="alert_log_errors">
        <Filter COLUMN_NAME="errorCategory" OPERATOR="EQ">checkerFailure</Filter>
      </GetView>
      <GetView NAME="alert_log_checker_failures_1" FROM_TABLE="alert_log_checker_failures">
        <Column NAME="timeLine"/>
        <Column NAME="genericCheckerFailureErrStack"/>
        <Column NAME="numberOfFailures"/>
        <Column NAME="alertLogName"/>
      </GetView>
    </ExecutionDescriptor>
  </Metric>

  <!--
  ======================================================================
  == Category:         ADR Alert Log Incident Error Status
  == Collection Level: Minimum
  == Purpose:          Alerts
  ======================================================================
    -->
  <Metric NAME="adrAlertLogIncidentErrorStatus" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="adrAlertLogIncidentErrorStatus">Incident Status</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="genericIncidentErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_genericIncidentErrors">Generic Incident Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="genericInternalErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_genericInternalErrors">Generic Internal Error Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="sessTerminateErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_sessTerminateErrors">Session Terminated Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="internalSqlErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_internalSqlErrors">Internal SQL Error Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="accessViolationErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_accessViolationErrors">Access Violation Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="fileAccessErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_fileAccessErrors">File Access Error Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="outOfMemoryErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_outOfMemoryErrors">Out of Memory Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="clusterErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_clusterErrors">Cluster Error Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="deadlockErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_deadlockErrors">Deadlock Error Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="asmBlockCorruptionErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_asmBlockCorruptionErrors">ASM Block Corruption Error Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="redoLogCorruptionErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_redoLogCorruptionErrors">Redo Log Corruption Error Status</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <ExecutionDescriptor>
      <GetTable NAME="alert_log_errors" METRIC_NAME="adrAlertLogIncidentError" USE_CACHE="TRUE"/>
      <GetView NAME="generic_incident_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="genericIncidentErrStack"/>
        <Filter COLUMN_NAME="genericIncidentErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="generic_incident_alert_log_rollup" FROM_TABLE="generic_incident_alert_log_errors">
        <AggregateColumn NAME="genericIncidentErrors" COLUMN_NAME="genericIncidentErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="generic_internal_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="genericInternalErrStack"/>
        <Filter COLUMN_NAME="genericInternalErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="generic_internal_alert_log_rollup" FROM_TABLE="generic_internal_alert_log_errors">
        <AggregateColumn NAME="genericInternalErrors" COLUMN_NAME="genericInternalErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="sess_terminate_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="sessTerminateErrStack"/>
        <Filter COLUMN_NAME="sessTerminateErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="sess_terminate_alert_log_rollup" FROM_TABLE="sess_terminate_alert_log_errors">
        <AggregateColumn NAME="sessTerminateErrors" COLUMN_NAME="sessTerminateErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="internal_sql_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="internalSqlErrStack"/>
        <Filter COLUMN_NAME="internalSqlErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="internal_sql_alert_log_rollup" FROM_TABLE="internal_sql_alert_log_errors">
        <AggregateColumn NAME="internalSqlErrors" COLUMN_NAME="internalSqlErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="access_violation_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="accessViolationErrStack"/>
        <Filter COLUMN_NAME="accessViolationErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="access_violation_alert_log_rollup" FROM_TABLE="access_violation_alert_log_errors">
        <AggregateColumn NAME="accessViolationErrors" COLUMN_NAME="accessViolationErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="file_access_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="fileAccessErrStack"/>
        <Filter COLUMN_NAME="fileAccessErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="file_access_alert_log_rollup" FROM_TABLE="file_access_alert_log_errors">
        <AggregateColumn NAME="fileAccessErrors" COLUMN_NAME="fileAccessErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="out_of_memory_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="outOfMemoryErrStack"/>
        <Filter COLUMN_NAME="outOfMemoryErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="out_of_memory_alert_log_rollup" FROM_TABLE="out_of_memory_alert_log_errors">
        <AggregateColumn NAME="outOfMemoryErrors" COLUMN_NAME="outOfMemoryErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="cluster_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="clusterErrStack"/>
        <Filter COLUMN_NAME="clusterErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="cluster_alert_log_rollup" FROM_TABLE="cluster_alert_log_errors">
        <AggregateColumn NAME="clusterErrors" COLUMN_NAME="clusterErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="deadlock_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="deadlockErrStack"/>
        <Filter COLUMN_NAME="deadlockErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="deadlock_alert_log_rollup" FROM_TABLE="deadlock_alert_log_errors">
        <AggregateColumn NAME="deadlockErrors" COLUMN_NAME="deadlockErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="asm_block_corruption_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="asmBlockCorruptionErrStack"/>
        <Filter COLUMN_NAME="asmBlockCorruptionErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="asm_block_corruption_alert_log_rollup" FROM_TABLE="asm_block_corruption_alert_log_errors">
        <AggregateColumn NAME="asmBlockCorruptionErrors" COLUMN_NAME="asmBlockCorruptionErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="redo_log_corruption_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="redoLogCorruptionErrStack"/>
        <Filter COLUMN_NAME="redoLogCorruptionErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="redo_log_corruption_alert_log_rollup" FROM_TABLE="redo_log_corruption_alert_log_errors">
        <AggregateColumn NAME="redoLogCorruptionErrors" COLUMN_NAME="redoLogCorruptionErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <JoinTables NAME="adrAlertLogIncidentErrorStatus">
        <Table NAME="generic_incident_alert_log_rollup"/>
        <Table NAME="generic_internal_alert_log_rollup"/>
        <Table NAME="sess_terminate_alert_log_rollup"/>
        <Table NAME="internal_sql_alert_log_rollup"/>
        <Table NAME="access_violation_alert_log_rollup"/>
        <Table NAME="file_access_alert_log_rollup"/>
        <Table NAME="out_of_memory_alert_log_rollup"/>
        <Table NAME="cluster_alert_log_rollup"/>
        <Table NAME="deadlock_alert_log_rollup"/>
        <Table NAME="asm_block_corruption_alert_log_rollup"/>
        <Table NAME="redo_log_corruption_alert_log_rollup"/>
      </JoinTables>
    </ExecutionDescriptor>
  </Metric>

  <!--
  ======================================================================
  == Category:         ADR Alert Log Operational Error Status
  == Collection Level: Minimum
  == Purpose:          Alerts
  ======================================================================
    -->
  <Metric NAME="adrAlertLogOperationalErrorStatus" TYPE="TABLE">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
    </ValidIf>
    <Display>
      <Label NLSID="adrAlertLogOperationalErrorStatus">Operational Error Status</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="genericOperationalErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_genericOperationalErrors">Generic Operational Error Status</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor NAME="dataBlockCorruptionErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_dataBlockCorruptionErrors">Data Block Corruption Error Status</Label>
        </Display>
      </ColumnDescriptor>     
      <ColumnDescriptor NAME="mediaFailureErrors" TYPE="NUMBER">
        <Display FOR_SUMMARY_UI="TRUE">
          <Label NLSID="adrAlertLogStatus_mediaFailureErrors">Media Failure Status</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <ExecutionDescriptor>
      <GetTable NAME="alert_log_errors" METRIC_NAME="adrAlertLogOperationalError" USE_CACHE="TRUE"/>
      <GetView NAME="generic_operational_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="genericOperationalErrStack"/>
        <Filter COLUMN_NAME="genericOperationalErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="generic_operational_alert_log_rollup" FROM_TABLE="generic_operational_alert_log_errors">
        <AggregateColumn NAME="genericOperationalErrors" COLUMN_NAME="genericOperationalErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <GetView NAME="data_block_corruption_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="dataBlockCorruptionErrStack"/>
        <Filter COLUMN_NAME="dataBlockCorruptionErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="data_block_corruption_alert_log_rollup" FROM_TABLE="data_block_corruption_alert_log_errors">
        <AggregateColumn NAME="dataBlockCorruptionErrors" COLUMN_NAME="dataBlockCorruptionErrStack" OPERATOR="COUNT"/>
      </GroupBy>      
      <GetView NAME="media_failure_alert_log_errors" FROM_TABLE="alert_log_errors">
        <Column NAME="mediaFailureErrStack"/>
        <Filter COLUMN_NAME="mediaFailureErrStack" OPERATOR="ISNOTNULL"/>
      </GetView>
      <GroupBy NAME="media_failure_alert_log_rollup" FROM_TABLE="media_failure_alert_log_errors">
        <AggregateColumn NAME="mediaFailureErrors" COLUMN_NAME="mediaFailureErrStack" OPERATOR="COUNT"/>
      </GroupBy>
      <JoinTables NAME="adrAlertLogOperationalErrorStatus">
        <Table NAME="generic_operational_alert_log_rollup"/>
        <Table NAME="data_block_corruption_alert_log_rollup"/>
      	<Table NAME="media_failure_alert_log_rollup"/>
      </JoinTables>
    </ExecutionDescriptor>
  </Metric>

  <!--
  ======================================================================
  == Category:         ADR Alert Log Content
  == Collection Level: {Not Collected}
  == Purpose:          On-Demand
  ======================================================================
    -->
  <Metric NAME="adrAlertLogContent" TYPE="TABLE" USAGE_TYPE="HIDDEN" HELP="NO_HELP">
    <ValidIf>
      <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
    </ValidIf>
    <TableDescriptor>
      <ColumnDescriptor NAME="logContent" TYPE="STRING" IS_KEY="FALSE"/>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="OS">
      <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
      <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
      <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
<!-- TODO: make these available for ASM
      <Property NAME="ConvertFromCharset" SCOPE="INSTANCE" OPTIONAL="TRUE">ConvertFromCharset</Property>
      <Property NAME="needCharsetConvert" SCOPE="INSTANCE" OPTIONAL="TRUE">needCharsetConvert</Property>
  -->
      <Property NAME="ENVEM_TARGET_GUID" SCOPE="INSTANCE">GUID</Property>
      <Property NAME="ENVEM_AGENT_STATE_DIR" SCOPE="SYSTEMGLOBAL">agentStateDir</Property>
      <Property NAME="AdrHome" SCOPE="INSTANCE">AdrHome</Property>
      <Property NAME="ARGS" SCOPE="USER" OPTIONAL="TRUE">ARGS</Property>
      <Property NAME="STDINLARGE_ARGS" SCOPE="USER" OPTIONAL="TRUE">LARGE_ARGS</Property>
      <Property NAME="command" SCOPE="GLOBAL">
        %perlBin%/perl %scriptsDir%/alertlogAdrViewer.pl %AdrHome% "%ARGS%"
      </Property>
    </QueryDescriptor>
  </Metric>

    <!--
      ======================================================================
      == Metric: cluster_resource_name
      ======================================================================
      -->

  <Metric NAME="cluster_resource_name" TYPE="TABLE" IS_METRIC_LONG_RUNNING="TRUE" USAGE_TYPE="COLLECT_UPLOAD">
    <Display>
      <Label NLSID="cluster_resource_name">Cluster Resource</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor NAME="resource_name" TYPE="STRING" IS_KEY="FALSE" >
        <Display>
          <Label NLSID="resource_name">Resource Name</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
      <QueryDescriptor FETCHLET_ID="OSLineToken" >
        <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
        <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
        <Property NAME="command" SCOPE="GLOBAL"><![CDATA[
%perlBin%/perl %scriptsDir%/has/has_metrics.pl resource_name %OracleHome% asm
]]></Property>  
        <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
        <Property NAME="warningStartsWith" SCOPE="GLOBAL">em_warning=</Property>
        <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
        <Property NAME="ENVEM_CRS_HOME" SCOPE="INSTANCE" OPTIONAL="TRUE">OracleHome</Property>
        <Property NAME="OracleHome" SCOPE="INSTANCE" OPTIONAL="TRUE">OracleHome</Property>
        <Property NAME="SID" SCOPE="INSTANCE">SID</Property>

        <Property NAME="STDINEM_TARGET_USERNAME" SCOPE="INSTANCE">UserName</Property>
        <Property NAME="STDINEM_TARGET_PASSWORD" SCOPE="INSTANCE">password</Property>
        <Property NAME="ENVEM_PERLBIN_DIR" SCOPE="SYSTEMGLOBAL">perlBin</Property>
        <Property NAME="ENVEM_SCRIPTS_DIR" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
        <Property NAME="ENVEM_TARGET_ORACLE_HOME" SCOPE="INSTANCE">OracleHome</Property>
        <Property NAME="ENVEM_TARGET_ROLE" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
        <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
        <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
        <Property NAME="ENVEM_TARGET_ADDRESS" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SID=%SID%)))</Property>
      </QueryDescriptor> 
  </Metric>


  <CredentialInfo>
    <!-- Credential type for ASM credentials: username/password/role -->
   <CredentialType NAME="ASMCreds">
      <Display>
        <Label NLSID="CREDS_ASM_CREDS">ASM Credentials</Label>
      </Display>
        <CredentialTypeRef REF_NAME="DBRef" REF_TYPE="DBCreds" REF_TARGETTYPE="oracle_database" ASSOCIATION="self">
            <CredentialTypeRefColumn NAME="DBUserName" REF_TYPECOLUMN="DBUserName"/>
            <CredentialTypeRefColumn NAME="DBPassword" REF_TYPECOLUMN="DBPassword"/>
            <CredentialTypeRefColumn NAME="DBRole" REF_TYPECOLUMN="DBRole"/>
        </CredentialTypeRef> 
    </CredentialType>

    <!-- Credential type for ASM Host credentials, refers to credentials on the host the database is on -->
    <CredentialType NAME="DBHostCreds">
      <Display>
        <Label NLSID="CREDS_ASM_HOSTCREDS">ASM Host Credentials</Label>
      </Display>
      <CredentialTypeRef REF_NAME="HostRef" REF_TYPE="HostCreds" REF_TARGETTYPE="host" ASSOCIATION="host">
        <CredentialTypeRefColumn NAME="HostUserName" REF_TYPECOLUMN="HostUserName"/>
        <CredentialTypeRefColumn NAME="HostPassword" REF_TYPECOLUMN="HostPassword"/>
      </CredentialTypeRef>
    </CredentialType>

    <!-- The SYSDBA credential set -->
    <CredentialSet NAME="DBCredsSYSDBA" CREDENTIAL_TYPE="ASMCreds" USAGE="PREFERRED_CRED">
      <Display>
        <Label NLSID="CREDS_ASM_DBCREDS_SYSDBA">SYSDBA ASM Credentials</Label>
      </Display>
      <CredentialSetColumn TYPE_COLUMN="DBUserName" SET_COLUMN="sysDBAUserName">
        <Display>
          <Label NLSID="CREDS_SYSDBA_USER">SYSDBA Username</Label>
        </Display>
      </CredentialSetColumn>
      <CredentialSetColumn TYPE_COLUMN="DBPassword" SET_COLUMN="sysDBAPassword">
        <Display>
	  <Label NLSID="CREDS_SYSDBA_PASSWORD">SYSDBA Password</Label>
	</Display>
      </CredentialSetColumn>
      <CredentialSetColumn TYPE_COLUMN="DBRole" SET_COLUMN="sysDBARole">
        <Display>
	  <Label NLSID="CREDS_SYSDBA_ROLE">SYSDBA Role</Label>
	</Display>
        <CredentialSetColumnValue IS_DEFAULT="FALSE">SYSDBA</CredentialSetColumnValue>
      </CredentialSetColumn>
    </CredentialSet>

    <!-- The SYSASM credential set -->
    <CredentialSet NAME="DBCredsSYSASM" CREDENTIAL_TYPE="ASMCreds" USAGE="PREFERRED_CRED">
      <Display>
        <Label NLSID="CREDS_ASM_DBCREDS_SYSASM">SYSASM ASM Credentials</Label>
      </Display>
      <CredentialSetColumn TYPE_COLUMN="DBUserName" SET_COLUMN="sysASMUserName">
        <Display>
	  <Label NLSID="CREDS_SYSASM_USER">SYSASM Username</Label>
	</Display>
      </CredentialSetColumn>
      <CredentialSetColumn TYPE_COLUMN="DBPassword" SET_COLUMN="sysASMPassword">
        <Display>
	  <Label NLSID="CREDS_SYSASM_PASSWORD">SYSASM Password</Label>
        </Display>
      </CredentialSetColumn>
      <CredentialSetColumn TYPE_COLUMN="DBRole" SET_COLUMN="sysASMRole">
        <Display>
          <Label NLSID="CREDS_SYSASM_ROLE">SYSASM Role</Label>
	</Display>
        <CredentialSetColumnValue IS_DEFAULT="TRUE">SYSASM</CredentialSetColumnValue>
      </CredentialSetColumn>
    </CredentialSet>

    <!-- The ASM host credentials credential set -->
    <CredentialSet NAME="DBHostCreds" CREDENTIAL_TYPE="DBHostCreds" USAGE="PREFERRED_CRED">
      <Display>
        <Label NLSID="CREDS_ASM_DBHOSTCREDS">ASM Host Credentials</Label>
      </Display>
      <CredentialSetColumn TYPE_COLUMN="HostUserName" SET_COLUMN="HostUsername">
        <Display>
          <Label NLSID="CREDS_HOST_USER">Host Username</Label>
	</Display>
      </CredentialSetColumn>
      <CredentialSetColumn TYPE_COLUMN="HostPassword" SET_COLUMN="HostPassword">
        <Display>
	  <Label NLSID="CREDS_HOST_PASSWORD">Host Password</Label>
	</Display>
      </CredentialSetColumn>
    </CredentialSet>

    <!-- The ASM monitoring credential set -->
    <CredentialSet NAME="ASMCredsMonitoring" CREDENTIAL_TYPE="ASMCreds" USAGE="MONITORING">
      <Display>
        <Label NLSID="CREDS_ASM_CREDS_MON">ASM Monitoring Credentials</Label>
      </Display>
      <CredentialSetColumn TYPE_COLUMN="DBUserName" SET_COLUMN="UserName">
        <Display>
           <Label NLSID="CREDS_ASM_USERNAME_MON">ASM Monitoring Username</Label>
	 </Display>
       </CredentialSetColumn>
       <CredentialSetColumn TYPE_COLUMN="DBPassword" SET_COLUMN="password">
         <Display>
           <Label NLSID="CREDS_ASM_PASSWORD_MON">ASM Monitoring Password</Label>
         </Display>
       </CredentialSetColumn>
       <CredentialSetColumn TYPE_COLUMN="DBRole" SET_COLUMN="Role">
         <Display>
           <Label NLSID="CREDS_ASM_ROLE_MON">ASM Monitoring Role</Label>
         </Display>
       </CredentialSetColumn>
     </CredentialSet> 
  </CredentialInfo>

   <InstanceProperties>
    <InstanceProperty NAME="OracleHome" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="oracle_database_OracleHome_iprop">Oracle home path</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="UserName" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="oracle_database_UserName_iprop">Username</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="password" CREDENTIAL="TRUE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="oracle_database_password_iprop">Password</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="Role" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="oracle_database_role_iprop">Role</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="MachineName" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="oracle_database_MachineName_iprop">Machine name</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="Port" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="oracle_database_Port_iprop">Port</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="SID" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="oracle_database_SID_iprop">SID</Label>
      </Display>
    </InstanceProperty>

    <!--
    ======================================================================
    == Dynamic Properties: Config
    ======================================================================
    -->

    <DynamicProperties NAME="Config" FORMAT="ROW"
                       PROP_LIST="InstanceID;InstanceName;StartTime;Version;TimedStatistics;HostName;TimeFormat">
      <QueryDescriptor FETCHLET_ID="SQL">
        <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select to_char(gv.inst_id), i.instance_name,
        TO_CHAR(i.startup_time,f.time_format), i.version,
        p.value,i.host_name, f.time_format "TimeFormat"
 from
v$instance i, v$version v, v$parameter p, gv$instance gv,
  (SELECT :1 time_format
    FROM dual) f
where v.banner like 'Oracle%' and p.name = 'timed_statistics'
and i.instance_number = gv.instance_number
and i.instance_name = gv.instance_name
and i.host_name = gv.host_name
]]>
        </Property>
        <Property NAME="SQLINPARAM1" SCOPE="GLOBAL">YYYY-MM-DD HH24:MI:SS</Property>
        <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
        <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
        <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
        <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
        <Property NAME="password" SCOPE="INSTANCE">password</Property>
        <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
        <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
      </QueryDescriptor>
    </DynamicProperties>


    <DynamicProperties NAME="GetDumpDestination"
                       PROP_LIST="background_dump_dest;user_dump_dest;core_dump_dest">
      <QueryDescriptor FETCHLET_ID="SQL">
        <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select name, value from v$parameter where name like '%_dump_dest'
]]>
        </Property>
        <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
        <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
        <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
        <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
        <Property NAME="password" SCOPE="INSTANCE">password</Property>
        <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
      </QueryDescriptor>
    </DynamicProperties>

  <!--
    ======================================================================
    == Dynamic Properties: DeduceAlertLogFile
    ======================================================================
    -->
  <DynamicProperties NAME="DeduceAlertLogFile" FORMAT="ROW" PROP_LIST="alert_log_file">
    <QueryDescriptor FETCHLET_ID="OSLineToken">
      <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
      <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
      <Property NAME="background_dump_dest" SCOPE="INSTANCE">background_dump_dest</Property>
      <Property NAME="command" SCOPE="GLOBAL"><![CDATA[
%perlBin%/perl %scriptsDir%/alertlog_find.pl %background_dump_dest%
]]></Property>
      <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
      <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
      <Property NAME="ENVEM_TARGET_ORACLE_HOME" SCOPE="INSTANCE">OracleHome</Property>
      <Property NAME="ENVEM_TARGET_ORACLE_SID" SCOPE="INSTANCE">SID</Property>
    </QueryDescriptor>
  </DynamicProperties>

    <DynamicProperties NAME="RacLocknamespaceMemberInfo" FORMAT="ROW"
                       PROP_LIST="db_unique_name">
      <QueryDescriptor FETCHLET_ID="SQL">
        <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select value from v$parameter where name='db_unique_name'
]]>
        </Property>
        <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
        <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
        <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
        <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
        <Property NAME="password" SCOPE="INSTANCE">password</Property>
        <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
      <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
      </QueryDescriptor>
    </DynamicProperties>

    <DynamicProperties NAME="RacClusterMemberInfo" FORMAT="ROW"
                       PROP_LIST="cluster_database">
      <QueryDescriptor FETCHLET_ID="SQL">
        <Property NAME="STATEMENT" SCOPE="GLOBAL">
<![CDATA[
select value from v$parameter where name='cluster_database'
]]>
        </Property>
        <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
        <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
        <Property NAME="SID" SCOPE="INSTANCE" OPTIONAL="TRUE">SID</Property>
        <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
        <Property NAME="password" SCOPE="INSTANCE">password</Property>
        <Property NAME="Role" SCOPE="INSTANCE">Role</Property>
        <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
      </Property>
      </QueryDescriptor>
    </DynamicProperties>

    <!--
    ======================================================================
    == Dynamic Properties: GetD(ata)B(ase)Version
    ======================================================================
      -->

    <DynamicProperties NAME="GetDBVersion" FORMAT="ROW" PROP_LIST="DBVersion">
      <QueryDescriptor FETCHLET_ID="SQL">
        <Property NAME="STATEMENT" SCOPE="GLOBAL"><![CDATA[
select version from v$instance
]]></Property>
        <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
        <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
        <Property NAME="SID" SCOPE="INSTANCE">SID</Property>
        <Property NAME="UserName" SCOPE="INSTANCE">UserName</Property>
        <Property NAME="password" SCOPE="INSTANCE">password</Property>
        <Property NAME="Role" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
        <Property NAME="ConnectDescriptor" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))
        </Property>
      </QueryDescriptor>
    </DynamicProperties>

    <!--
    ======================================================================
    == Dynamic Properties: ComputeV(ersion)C(ategory)
    ======================================================================
      -->
    <DynamicProperties NAME="ComputeVC" FORMAT="ROW" IS_CRITICAL="TRUE" PROP_LIST="VersionCategory">
      <QueryDescriptor FETCHLET_ID="VersionRangeComputer">
        <Property NAME="Version" SCOPE="INSTANCE">DBVersion</Property>
        <Property NAME="10gR1" SCOPE="GLOBAL">10.1.0.2;</Property>
        <Property NAME="10gR2" SCOPE="GLOBAL">10.2.0;</Property>
        <Property NAME="11gR1" SCOPE="GLOBAL">11.1.0.7;</Property>
        <Property NAME="11gR2" SCOPE="GLOBAL">11.2.0;</Property>
      </QueryDescriptor>
    </DynamicProperties>


  <!--
    ======================================================================
    == Dynamic Properties: GetAdrBase
    ======================================================================
    -->
    <DynamicProperties NAME="GetAdrBase" FORMAT="ROW" PROP_LIST="AdrBase">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
      </ValidIf>
      <QueryDescriptor FETCHLET_ID="OSLineToken">
        <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
        <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
        <Property NAME="command" SCOPE="GLOBAL"><![CDATA[
%perlBin%/perl %scriptsDir%/dbGetAdrBase.pl
]]></Property>
        <Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
        <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
        <Property NAME="ENVEM_TARGET_GUID" SCOPE="INSTANCE">GUID</Property>
        <Property NAME="ENVEM_AGENT_STATE_DIR" SCOPE="SYSTEMGLOBAL">agentStateDir</Property>
        <Property NAME="ENVEM_TARGET_NAME" SCOPE="INSTANCE">NAME</Property>
        <Property NAME="STDINEM_TARGET_USERNAME" SCOPE="INSTANCE">UserName</Property>
        <Property NAME="STDINEM_TARGET_PASSWORD" SCOPE="INSTANCE">password</Property>
        <Property NAME="ENVEM_TARGET_ROLE" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
        <Property NAME="ENVEM_TARGET_ORACLE_HOME" SCOPE="INSTANCE">OracleHome</Property>
        <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
        <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
        <Property NAME="SID" SCOPE="INSTANCE">SID</Property>
        <Property NAME="ENVEM_TARGET_ADDRESS" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SID=%SID%)))</Property>
      </QueryDescriptor>
    </DynamicProperties>

    <!--
    ======================================================================
    == Dynamic Properties: GetAdrHome
    ======================================================================
    -->
    <DynamicProperties NAME="GetAdrHome" FORMAT="ROW" PROP_LIST="AdrHome">
      <ValidIf>
        <CategoryProp NAME="VersionCategory" CHOICES="11gR1;11gR2"/>
      </ValidIf>
      <QueryDescriptor FETCHLET_ID="OSLineToken">
        <Property NAME="perlBin" SCOPE="SYSTEMGLOBAL">perlBin</Property>
        <Property NAME="scriptsDir" SCOPE="SYSTEMGLOBAL">scriptsDir</Property>
	<Property NAME="command" SCOPE="GLOBAL"><![CDATA[
%perlBin%/perl %scriptsDir%/dbGetAdrHome.pl
]]></Property>
	<Property NAME="startsWith" SCOPE="GLOBAL">em_result=</Property>
	<Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
        <Property NAME="ENVEM_TARGET_GUID" SCOPE="INSTANCE">GUID</Property>
        <Property NAME="ENVEM_AGENT_STATE_DIR" SCOPE="SYSTEMGLOBAL">agentStateDir</Property>
        <Property NAME="ENVEM_TARGET_NAME" SCOPE="INSTANCE">NAME</Property>
        <Property NAME="STDINEM_TARGET_USERNAME" SCOPE="INSTANCE">UserName</Property>
        <Property NAME="STDINEM_TARGET_PASSWORD" SCOPE="INSTANCE">password</Property>
        <Property NAME="ENVEM_TARGET_ROLE" SCOPE="INSTANCE" OPTIONAL="TRUE">Role</Property>
        <Property NAME="ENVEM_TARGET_ORACLE_HOME" SCOPE="INSTANCE">OracleHome</Property>
        <Property NAME="MachineName" SCOPE="INSTANCE">MachineName</Property>
        <Property NAME="Port" SCOPE="INSTANCE">Port</Property>
        <Property NAME="SID" SCOPE="INSTANCE">SID</Property>
        <Property NAME="ENVEM_TARGET_ADDRESS" SCOPE="GLOBAL">(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%MachineName%)(Port=%Port%))(CONNECT_DATA=(SERVICE_NAME=%SID%)(INSTANCE_NAME=%SID%)(UR=A)))</Property>
      </QueryDescriptor>
    </DynamicProperties>

   </InstanceProperties>


</TargetMetadata>

