Monday, February 27, 2017

Get Oracle License usage/related data from OEM management View

Oracle Options/Components/Features usage data:


select pack.name, pack.total, sum(cpu.physical_cpu_count) as physical_cpu_count, sum(cpu.cpu_count) as core_count
from
    (select Pack_count.name, count(Pack_count.name) as total
       from  (select MDF.host, MDF.name, mdf.instance_name, count(MDF.host) as total
                     from MGMT$DB_FEATUREUSAGE MDF
                 where MDF.currently_used = 'TRUE'
                group by MDF.HOST, MDF.name, mdf.instance_name) Pack_count
     group by Pack_count.name) pack
, (select distinct MDF.host, MDF.name, cpu.physical_cpu_count, cpu.cpu_count
    from MGMT$DB_FEATUREUSAGE MDF, MGMT$OS_HW_SUMMARY cpu
  where MDF.currently_used = 'TRUE'
      and mdf.host = cpu.HOST_NAME ) cpu
where pack.name = cpu.name
group by pack.name, pack.total
order  by 1

OEM pack usage data:

select cpu_count.pack, sum(cpu_count.physical_cpu_count) as physical_cpu_count, sum(cpu_count.cpu_count) as core_count
from (select distinct mld.pack_label as PackLabel, mld.PACK_DISPLAY_LABEL as pack, mt.HOST_NAME, cpu.physical_cpu_count, cpu.cpu_count /*, mld.PACK_DESCRIPTION as DESCRIPTION*/
      from sysman.MGMT_LICENSE_VIEW mlv, sysman.MGMT_LICENSE_DEFINITIONS mld, MGMT$TARGET_TYPE_DEF mttd, mgmt$target mt, MGMT$OS_HW_SUMMARY cpu
      where mlv.PACK_NAME = mld.pack_label
      and mlv.target_type = mld.target_type
      and mlv.target_type = mttd.target_type
      and mlv.target_name = mt.target_name
      and mlv.target_type = mt.target_type
      and cpu.host_name = mt.host_name
      group by mld.pack_label, mttd.TYPE_DISPLAY_NAME, mld.PACK_DISPLAY_LABEL, mt.HOST_NAME, cpu.physical_cpu_count, cpu.cpu_count /*, mld.PACK_DESCRIPTION*/) cpu_count
group by cpu_count.pack

No comments:

Post a Comment