AIX Oracle
AIX Oracle input 通过 sqlplus 执行 SQL,采集数据库状态、会话、表空间、ASM、FRA、等待事件和高级指标。
配置¶
[inputs]
# 中间件 input 总开关。
enabled = true
[[inputs.oracle]]
# 实例名,会作为 instance tag。
name = "orcl"
# 是否启用该 Oracle 实例采集。
enabled = true
# 采集间隔。
interval = "60s"
# 可选,采集前加载实例环境变量。
env_file = ""
# 是否采集 DataGuard、实例信息和 invalid objects 等高级指标。
collect_advanced = false
# 可选,自定义指标命令,输出 key=value 行。
deep_metrics_command = ""
# Oracle 环境和连接信息。
oracle_home = "/u01/app/oracle/product/19c/dbhome_1"
oracle_sid = "ORCL"
sqlplus = "/u01/app/oracle/product/19c/dbhome_1/bin/sqlplus"
user = "datakitaix"
# 密码从环境变量读取,不写入配置文件。
password_env = "DATAKITAIX_ORACLE_PASSWORD"
如果 user 为空,会使用 connect / as sysdba。否则从 password_env 指定的环境变量读取密码。
命令依赖¶
| 命令 | 说明 |
|---|---|
sqlplus -s /nolog |
执行 Oracle SQL。 |
deep_metrics_command |
自定义命令,输出 key=value 行,采集自定义指标。 |
指标¶
所有指标都会追加 host、input=oracle、instance=<name> 标签。
oracle¶
| Tags & Fields | Description |
|---|---|
| oracle_sid ( tag) |
Oracle SID。 |
| open_mode ( tag) |
数据库 open mode。 |
| up | SQL 执行是否成功。 Type: int | (gauge) |
| open | 数据库是否处于 READ WRITE/READ ONLY。 Type: int | (gauge) |
| sessions | 当前 session 数。 Type: float | (gauge) Unit: count |
| processes | 当前 process 数。 Type: float | (gauge) Unit: count |
| archive_errors | 归档目的端异常数量。 Type: float | (gauge) Unit: count |
| redo_log_groups | redo log group 数量。 Type: float | (gauge) Unit: count |
oracle_tablespace¶
| Tags & Fields | Description |
|---|---|
| oracle_sid ( tag) |
Oracle SID。 |
| tablespace ( tag) |
表空间名。 |
| used_pct | 表空间使用率。 Type: float | (gauge) Unit: percent |
oracle_asm_diskgroup¶
| Tags & Fields | Description |
|---|---|
| diskgroup ( tag) |
ASM diskgroup 名称。 |
| total_mb | 总容量。 Type: float | (gauge) Unit: digital,MB |
| free_mb | 空闲容量。 Type: float | (gauge) Unit: digital,MB |
| used_pct | 使用率。 Type: float | (gauge) Unit: percent |
oracle_recovery_area¶
| Tags & Fields | Description |
|---|---|
| area ( tag) |
FRA 名称,默认 default。 |
| space_limit_mb | FRA 限额。 Type: float | (gauge) Unit: digital,MB |
| space_used_mb | FRA 已用空间。 Type: float | (gauge) Unit: digital,MB |
| reclaimable_mb | 可回收空间。 Type: float | (gauge) Unit: digital,MB |
| used_pct | 使用率。 Type: float | (gauge) Unit: percent |
oracle_wait_class¶
| Tags & Fields | Description |
|---|---|
| wait_class ( tag) |
wait class。 |
| waits | 等待次数。 Type: int | (count) Unit: count |
| time_waited_cs | 等待时间,单位 centisecond。 Type: int | (count) |
oracle_datafile_status¶
| Tags & Fields | Description |
|---|---|
| status ( tag) |
datafile 状态。 |
| count | 对应状态的数据文件数量。 Type: int | (gauge) Unit: count |
oracle_dataguard¶
| Tags & Fields | Description |
|---|---|
| oracle_sid ( tag) |
Oracle SID。 |
| name ( tag) |
DataGuard 指标名称。 |
| unit ( tag) |
指标单位。 |
| value | DataGuard 数值型指标值。 Type: float | (gauge) |
| value_seconds | DataGuard 时间间隔型指标值。 Type: float | (gauge) Unit: time,s |
| count | 非数值型 DataGuard 指标占位。 Type: int | (gauge) Unit: count |
oracle_instance¶
| Tags & Fields | Description |
|---|---|
| oracle_sid ( tag) |
Oracle SID。 |
| instance ( tag) |
RAC/GV$INSTANCE 实例名。 |
| host ( tag) |
实例所在主机。 |
| status ( tag) |
实例状态。 |
| parallel ( tag) |
实例 parallel 状态。 |
| up | 实例状态是否为 OPEN。 Type: int | (gauge) |
oracle_invalid_objects¶
| Tags & Fields | Description |
|---|---|
| oracle_sid ( tag) |
Oracle SID。 |
| owner ( tag) |
对象 owner。 |
| count | 非 VALID 对象数量。 Type: float | (gauge) Unit: count |
自定义指标¶
自定义指标字段由 deep_metrics_command 输出决定。表中列出的字段会作为 tag;其他 key=value 中数字会作为 float | (gauge) field 上报,非数字会作为 tag。如果没有数字 field,会补充 count=1,单位为 count。
| Measurement | Tags | Description |
|---|---|---|
oracle_awr_metric |
metric, unit, oracle_sid |
自定义 AWR 指标。 |
oracle_ash_wait |
event, wait_class, oracle_sid |
自定义 ASH 等待指标。 |
oracle_sql |
sql_id, module, schema, oracle_sid |
自定义 SQL 指标。 |
oracle_segment |
segment, owner, segment_type, tablespace, oracle_sid |
自定义 segment 指标。 |
oracle_deep_metric |
metric, unit, oracle_sid |
通用 Oracle 自定义指标。 |