search
数据采集 采集源配置 Oracle 监控指标采集

Oracle 监控指标采集

简介

该采集器通过运行内置的一些 SQL 语句,采集 Oracle 指标相关数据,如监控类、备份信息、快照数据等。

前置条件

配置

Oracle数据库授权监控账号

# 创建监控账号
create user dbmonitor identified by dbmonitor;
grant connect,resource,dba,sysdba to dbmonitor;

# 测试权限
echo 'select count(*) from dba_objects;' | sqlplus dbmonitor/dbmonitor@localhost:1521/testdb.zhuyun | awk '{printf("%-10d%-30s%-20s\n",NR,$1,$2);}'

安装依赖包

根据操作系统和oracle版本选择安装对应的安装包,参考这里,如:

$ cat /etc/redhat-release
$ rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
$ echo /usr/lib/oracle/11.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf
$ ldconfig

$ yum install libaio # 对应 ubuntu: apt-get install libaio1

采集器配置

进入 DataKit 安装目录下的 conf.d/db 目录,复制 oraclemonitor.conf.sample 并命名为 oraclemonitor.conf。示例如下:

[[inputs.external]]
        daemon = true
        name = 'oraclemonitor'
        cmd  = "/usr/local/cloudcare/dataflux/datakit/externals/oraclemonitor"
        args = [
                '-data-type'      , '<Metric/Logging>'          ,
                '-instance-id'    , '<your-instance-id>'        ,
                '-metric-name'    , 'oracle_monitor'            ,
                '-internal'       , '1m'                        ,
                '-instance-desc'  , '<your-oracle-description>' ,
                '-host'           , '<your-oracle-host>'        ,
                '-port'           , '1521'                      ,
                '-username'       , '<oracle-user-name>'        ,
                '-password'       , '<oracle-password>'         ,
                '-service-name'   , '<oracle-service-name>'     ,
                '-cluster-type'   , 'single'                    ,
                '-oracle-version' , '11g'                       ,
        ]
        envs = [
                'LD_LIBRARY_PATH=/opt/oracle/instantclient_19_8:$LD_LIBRARY_PATH',
        ]

        #############################
        # 参数说明(标 * 为必选项)
        #############################
        # *-interval       : 采集的频度,最小粒度5m
        #  -metric-name    : 指标集名称,默认值oracle_monitor
        #  -instance-id    : 实例ID
        #  -instance-desc  : 实例描述
        # *-host           : oracle实例地址(ip)
        #  -port           : oracle监听端口
        # *-username       : oracle 用户名
        # *-password       : oracle 密码
        # *-service-name   : oracle的服务名
        # *-cluster-type   : 实例类型(例如 single/dg/rac)
        # *-oracle-version : 采集的oracle版本(支持10g, 11g, 12c)

配置好后,重启 DataKit 即可生效

指标集 oracle_monitor

标签

标签 描述
backup_types
dbid
group_no
host
instance_desc
instance_id
message_num
name
ora_db_id
oracle_port
oracle_server
parameter
process_seq
product
sequence_no
sid
snap_id
tablespace_name
type
user_id
username

指标

指标 描述 类型
account_status
activeblks
all_count
allocation_type
archived
authentication_type
avg_undo_size
backup_recid
begin_interval_time
begin_time
bigfile
block_size
blocking_instance
blocking_session
blocks
broken_value
client_dbid
client_process
contents
created
database_role
db_create_time
db_name
db_unique_name
def_tab_compression
default_tablespace
delay_mins
editions_enabled
end_interval_time
end_time
error_code
event
expiredblks
expiry_date
extent_management
external_name
failures_value
flashback_mod
force_logging
group_no
host_name
initial_extent
initial_rsrc_consumer_group
instance_number
invaid_count
is_rac
last_call_et
lock_date
log_mod
log_time
logging
logon_time
longest_trans
max_backup_start_time
max_extents
max_id
max_undo_size
members
message
min_backup_start_time
min_extents
min_extlen
name
next_extent
num_files
num_trans
number_of_files
object_type
open_mode
ora_sid
p1
p2
p3
password
password_versions
pct_increase
platform
plugged_in
prev_sql_id
process
profile
program
protection_level
protection_mode
retention
row_wait_obj
segment_space_management
sequence_no
severity
size_bytes
snap_in_second
snap_startup_time
space_extensible
space_limit
space_reclaimable
space_total
space_used
sql_id
startup_time
status
sum_free_blocks
sum_max_blocks
sum_total_blocks
sum_used_blocks
switchover_status
t_free
t_percent
t_size
t_use
tablespace_name
temporary_tablespace
terminal
thread_no
txncount
undoblks
unexpiredblks
unit
usage
vaid_count
value
version
wait_class
waits_value