zrabbix无法获取Oracle DB Size和DB Files Size的解决方法

rabbix无法获取Oracle DB Size和DB Files Size的解决方法

这几天在研究Orabbix时发现在Zabbix中无法获取DB Size和DB Files Size的大小,后来发现问题出在/opt/orabbix/conf/query.props文件的配置上: 因为最新的Orabbix 1.2.3版本在解压安装后,默认的query.props文件内没有配置这两个选项的检测,所以需要手动加上,分别在此文件中两个地方加入配置,具体如下:

1. 在"QueryList="的最后加上",dbfilesize,dbsize",注意要用逗号格开;

2. 另外加上,dbfilesize,dbsize的检测语句,如下:

dbfilesize.Query=select to_char(sum(bytes/1024/1024), 'FM99999999999999990') retvalue from dba_data_files

SELECT to_char(sum(NVL(a.bytes/1024/1024 - NVL(f.bytes/1024/1024/10, 0),0)),'FM99999999999999990') retvalue FROM sys.dba_tablespaces d,(select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name) a,(select tablespace_name, sum(bytes) bytes from dba_free_space group by tablespace_name) f WHERE d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = f.tablespace_name(+) AND NOT (d.extent_management like 'LOCAL' AND d.contents like 'TEMPORARY')

修改后结果如下:

QueryList=archive,audit,dbblockgets,dbconsistentgets,dbhitratio,dbphysicalread,dbversion,hitratio_body,hitratio_sqlarea,hitratio_table_proc, \
lio_current_read,locks,maxprocs,maxsession,miss_latch,pga_aggregate_target, pga,phio_datafile_reads,phio_datafile_writes,phio_redo_writes,pinhitratio_body,pinhitratio_sqlarea,pinhitratio_table-proc,pinhitratio_trigger, \pool_dict_cache,pool_free_mem,pool_lib_cache,pool_misc,pool_sql_area,procnum,session_active,session_inactive,session,session_system,sga_buffer_cache, \ sga_fixed,sga_java_pool,sga_large_pool,sga_log_buffer,sga_shared_pool,tbl_space,userconn,waits_controfileio,waits_directpath_read, \ waits_file_io,waits_latch,waits_logwrite,waits_multiblock_read,waits_singleblock_read,hitratio_trigger,lio_block_changes,lio_consistent_read,waits_other,

waits_sqlnet,users_locked,uptime,dbfilesize,dbsize


DataGuardPrimaryQueryList=dg_error,dg_sequence_number
DataGuardStandbyQueryList=dg_sequence_number_stby
RmanQueryList=rman_check_status

dbfilesize.Query=select to_char(sum(bytes/1024/1024), 'FM99999999999999990') retvalue from dba_data_files


SELECT to_char(sum(NVL(a.bytes/1024/1024 - NVL(f.bytes/1024/1024/10, 0),0)),'FM99999999999999990') retvalue FROM sys.dba_tablespaces d,(select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name) a,(select tablespace_name, sum(bytes) bytes from dba_free_space group by tablespace_name) f WHERE d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = f.tablespace_name(+) AND NOT (d.extent_management like 'LOCAL' AND d.contents like 'TEMPORARY')

 

原文地址:

http://www.92cto.com/blog/1450.html

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值