em12c监控的数据记录在资料库中,一般都放在sysman用户下,以mgmt$开头的表或视图。可以通过一些简单的查询提取想要的数据,供其他系统使用,例如:
--查看各类平台数量
col type_qualifier1 for a10
select type_qualifier1, count(*) cnt
from mgmt$target
where target_type = 'host'
group by type_qualifier1
结果如下:
type_quali cnt
---------- ----------
hp-ux 6
sunos 2
linux 137
windows 94
aix 59
--查数据库审计设置
col value for a20
select target_name,value from mgmt$db_init_params a
where name='audit_trail' and value <>'none'
and collection_timestamp>sysdate-1 and rownum<100
order by 1;
--检查所有数据库端口
col target_name for a30
col property_value for a10
set pages 200
select target_name, property_value
from mgmt$target_properties
where target_type = 'oracle_database'
and property_name = 'port'
--查看数据库在各平台上的数量
col platform for a10
select p3.property_value "platform", p1.property_value "version", count(*) "total"
from mgmt$target_properties p1, mgmt$target_properties p2, mgmt$target_properties p3
where p1.target_type = 'oracle_database'
and p1.target_guid = p2.target_guid
and p3.target_name = p2.property_value
and p3.target_type = 'host'
and p1.property_name = 'versioncategory'
and p2.property_name = 'machinename'
and p3.property_name = 'os'
group by p3.property_value, p1.property_value
order by p3.property_value, p1.property_value;
结果如下:
platform version total
---------- ---------- ----------
aix 10gr2 1
aix 11gr202 2
hp-ux 10gr205 1
linux 10gr204 1
linux 10gr205 1
linux 11gr1 1
linux 11gr202 16
windows 10gr2 4
windows 11gr202 2
--代理部署位置、版本
--查看cpu使用率
...
阅读(2629) | 评论(0) | 转发(0) |