Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3570505
  • 博文数量: 715
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7745
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(715)

文章存档

2023年(75)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客

分类: Oracle

2016-04-08 17:53:50

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使用率
...

阅读(2714) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~