# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring category: db # The monitoring type eg: linux windows tomcat mysql aws... app: oracle # The monitoring i18n name name: zh-CN: Oracle数据库 en-US: Oracle DB ja-JP: Oracle データベース # The description and help of this monitoring type help: zh-CN: HertzBeat 使用 JDBC 协议 通过配置 SQL 对 Oracle 数据库的通用性能指标(表空间、性能状态、用户连接、缓存、慢SQL等)进行采集监控。
您可以点击“新建 Oracle 数据库”并进行配置,或者选择“更多操作”,导入已有配置。 en-US: HertzBeat uses JDBC Protocol to configure SQL for collecting general metrics of Oracle database (tablespace、user connect、performance、slow SQL etc.).
You can click "New Oracle Database" and configure it, or select "More Operations" to import the existing configuration. zh-TW: HertzBeat 使用 JDBC 協議 通過配置 SQL 對 Oracle 數據庫的通用性能指標(表空間、性能狀態、用戶連接、緩存、慢SQL等)進行采集監控。
您可以點擊“新建 Oracle 數據庫”並進行配置,或者選擇“更多操作”,導入已有配置。 ja-JP: Hertzbeat は JDBCプロトコルを介して Oracle データベースの一般的なパフォーマンスのメトリクスを監視します。
新規 Oracle データベース」をクリックしてパラメタを設定した後、新規することができます。 helpLink: zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/oracle/ en-US: https://hertzbeat.apache.org/docs/help/oracle/ # Input params define for monitoring(render web ui by the definition) params: # field-param field key - field: host # name-param field display i18n name name: zh-CN: 目标Host en-US: Target Host ja-JP: 目標ホスト # type-param field type(most mapping the html input type) type: host # required-true or false required: true # field-param field key - field: port # name-param field display i18n name name: zh-CN: 端口 en-US: Port ja-JP: ポート # type-param field type(most mapping the html input type) type: number # when type is number, range is required range: '[0,65535]' # required-true or false required: true # default value defaultValue: 1521 - field: timeout name: zh-CN: 查询超时时间(ms) en-US: Query Timeout(ms) ja-JP: クエリタイムアウト(ms) type: number range: '[400,200000]' required: false hide: true defaultValue: 6000 - field: reuseConnection name: zh-CN: 复用连接 en-US: Reuse Connection ja-JP: 接続再利用 type: boolean required: false defaultValue: true - field: database name: zh-CN: 服务名 en-US: Service Name ja-JP: サービス名 type: text required: false - field: username name: zh-CN: 用户名 en-US: Username ja-JP: ユーザー名 type: text limit: 50 required: false - field: password name: zh-CN: 密码 en-US: Password ja-JP: パスワード type: password required: false - field: url name: zh-CN: URL en-US: URL ja-JP: URL type: text required: false hide: true # collect metrics config list metrics: # metrics - basic - name: basic i18n: zh-CN: 基本信息 en-US: Basic Info ja-JP: 基礎情報 # metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel # priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue priority: 0 # collect metrics content fields: # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field - field: database_version type: 1 label: true i18n: zh-CN: 数据库版本 en-US: Database Version ja-JP: データベースバージョン - field: hostname type: 1 i18n: zh-CN: 主机名 en-US: Host Name ja-JP: ホスト名 - field: instance_name type: 1 i18n: zh-CN: 实例名 en-US: Instance Name ja-JP: インスタンス名 - field: startup_time type: 1 i18n: zh-CN: 启动时间 en-US: Startup Time ja-JP: 起動時間 - field: status type: 1 i18n: zh-CN: 状态 en-US: Status ja-JP: ステータス # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field aliasFields: - VERSION - HOST_NAME - INSTANCE_NAME - STARTUP_TIME - STATUS # (optional)mapping and conversion expressions, use these and aliasField above to calculate metrics value # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime calculates: - database_version=VERSION - hostname=HOST_NAME - instance_name=INSTANCE_NAME - startup_time=STARTUP_TIME - status=STATUS # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: jdbc # the config content when protocol is jdbc jdbc: # host: ipv4 ipv6 host host: ^_^host^_^ port: ^_^port^_^ # database platform name platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ # SQL Query Method:oneRow, multiRow, columns queryType: oneRow # sql sql: "select * from sys.v_$instance" # JDBC url url: ^_^url^_^ - name: tablespace i18n: zh-CN: 表空间 en-US: Tablespace ja-JP: 表領域 priority: 1 fields: - field: file_id type: 1 label: true i18n: zh-CN: 文件ID en-US: File ID ja-JP: ファイルID - field: file_name type: 1 i18n: zh-CN: 文件名 en-US: File Name ja-JP: ファイル名 - field: tablespace_name type: 1 i18n: zh-CN: 表空间名 en-US: Tablespace Name ja-JP: 表領域名 - field: status type: 1 i18n: zh-CN: 状态 en-US: Status ja-JP: ステータス - field: bytes type: 0 i18n: zh-CN: 字节数 en-US: Bytes ja-JP: バイト数 unit: MB - field: blocks type: 0 i18n: zh-CN: 块数 en-US: Blocks ja-JP: ブロック数 unit: 块 protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: multiRow sql: "select file_id, file_name, tablespace_name, status, bytes / 1024 / 1024 as bytes, blocks from dba_data_files" url: ^_^url^_^ - name: total_sessions i18n: zh-CN: 会话总数 en-US: Total Sessions ja-JP: セッション総数 priority: 2 fields: - field: count type: 0 i18n: zh-CN: 总数 en-US: Count ja-JP: 総数 protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: oneRow sql: "select count(*) as count from v$session" url: ^_^url^_^ - name: active_sessions i18n: zh-CN: 活动会话 en-US: Active Sessions ja-JP: アクティブなセッション priority: 3 fields: - field: count type: 0 i18n: zh-CN: 总数 en-US: Count ja-JP: 総数 protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: oneRow sql: "select count(*) as count from v$session where username is not null and status = 'ACTIVE'" url: ^_^url^_^ - name: background_sessions i18n: zh-CN: 后台会话 en-US: Background Sessions ja-JP: バックグラウンドセッション priority: 4 fields: - field: count type: 0 i18n: zh-CN: 总数 en-US: Count ja-JP: 総数 protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: oneRow sql: "select count(*) as count from v$session where username is null" url: ^_^url^_^ - name: connection i18n: zh-CN: 连接 en-US: Connection ja-JP: 接続 priority: 5 fields: - field: username type: 1 i18n: zh-CN: 用户名 en-US: Username ja-JP: ユーザー名 label: true - field: count i18n: zh-CN: 总数 en-US: Count ja-JP: 総数 type: 0 protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: oneRow sql: "SELECT username, count( username ) as count FROM v$session WHERE username IS NOT NULL GROUP BY username" url: ^_^url^_^ - name: performance i18n: zh-CN: 性能 en-US: Performance ja-JP: パフォーマンス priority: 6 fields: - field: qps type: 0 i18n: zh-CN: 每秒查询数 en-US: QPS ja-JP: QPS unit: qps - field: tps type: 0 i18n: zh-CN: 每秒事务数 en-US: TPS ja-JP: TPS unit: tps - field: mbps type: 0 i18n: zh-CN: 每秒IO读写 en-US: MBPS ja-JP: MBPS unit: mbps aliasFields: - I/O Requests per Second - User Transaction Per Sec - I/O Megabytes per Second calculates: - qps=I/O Requests per Second - tps=User Transaction Per Sec - mbps=I/O Megabytes per Second protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: columns sql: "select metric_name, value from gv$sysmetric where metric_name = 'I/O Megabytes per Second' or metric_name = 'User Transaction Per Sec' or metric_name = 'I/O Requests per Second'" url: ^_^url^_^ - name: percentage i18n: zh-CN: 表空间百分比 en-US: Percentage ja-JP: パーセント priority: 7 fields: - field: tablespace_name type: 1 i18n: zh-CN: 表空间名 en-US: Tablespace Name ja-JP: 表領域名 label: true - field: total i18n: zh-CN: 全部 en-US: Total ja-JP: 合計 type: 0 - field: used i18n: zh-CN: 已用 en-US: Used ja-JP: 使用済み type: 0 - field: free i18n: zh-CN: 空闲 en-US: Free ja-JP: 利用可能 type: 0 - field: used_percentage type: 0 i18n: zh-CN: 已用百分比 en-US: Used Percentage ja-JP: 使用した比率 unit: '%' - field: free_percentage type: 0 i18n: zh-CN: 空闲百分比 en-US: Free Percentage ja-JP: 利用可能な比率 unit: '%' protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: multiRow sql: "SELECT tablespace_name,ROUND ( (TABLESPACE_SIZE * 8 / 1024), 0) AS total,ROUND ( (USED_SPACE * 8 / 1024), 0) AS used,ROUND ( ( (TABLESPACE_SIZE * 8 / 1024) - (USED_SPACE * 8 / 1024)), 0) AS free,ROUND ( (USED_PERCENT), 0) AS used_percentage,100 - ROUND ( (USED_PERCENT), 0) AS free_percentage FROM sys.dba_tablespace_usage_metrics ORDER BY used_percent DESC" url: ^_^url^_^ - name: process i18n: zh-CN: 进程 en-US: Process ja-JP: プロセス priority: 8 fields: - field: process_count type: 0 i18n: zh-CN: 进程数 en-US: Process Count ja-JP: プロセス数 protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: oneRow sql: "select count(*) as process_count from v$process" url: ^_^url^_^ - name: transaction i18n: zh-CN: 事务 en-US: Transaction ja-JP: トランザクション priority: 9 fields: - field: commits type: 0 unit: 't/s' i18n: zh-CN: 提交数 en-US: Commits ja-JP: コミット回数 - field: rollbacks type: 0 unit: 't/s' i18n: zh-CN: 回滚数 en-US: Rollbacks ja-JP: ロールバック回数 aliasFields: - User Commits Per Sec - User Rollbacks Per Sec calculates: - commits=User Commits Per Sec - rollbacks=User Rollbacks Per Sec protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: columns sql: "select metric_name, value from gv$sysmetric where metric_name = 'User Commits Per Sec' or metric_name = 'User Rollbacks Per Sec'" url: ^_^url^_^ - name: wait i18n: zh-CN: 等待 en-US: Wait ja-JP: 待機 priority: 10 fields: - field: concurrent_wait_time type: 0 unit: ms i18n: zh-CN: 并发等待时间 en-US: Concurrent Wait Time ja-JP: 同時実行の待機時間 - field: commit_wait_time type: 0 unit: ms i18n: zh-CN: 提交等待时间 en-US: Commit Wait Time ja-JP: コミット待機時間 - field: app_wait_time type: 0 unit: ms i18n: zh-CN: 应用等待时间 en-US: Application Wait Time ja-JP: 応用待機時間 - field: network_wait_time type: 0 unit: ms i18n: zh-CN: 网络等待时间 en-US: Network Wait Time ja-JP: ネットワーク待機時間 - field: system_io_wait_time type: 0 unit: ms i18n: zh-CN: 系统I/O等待时间 en-US: System I/O Wait Time ja-JP: システムI/O待機時間 - field: user_io_wait_time type: 0 unit: ms i18n: zh-CN: 用户I/O等待时间 en-US: User I/O Wait Time ja-JP: ユーザーI/O待機時間 - field: configure_wait_time type: 0 unit: ms i18n: zh-CN: 配置等待时间 en-US: Configure Wait Time ja-JP: 配置待機時間 - field: scheduler_wait_time type: 0 unit: ms i18n: zh-CN: 调度等待时间 en-US: Scheduler Wait Time ja-JP: Scheduler待機時間 aliasFields: - System I/O - Application - User I/O - Commit - Concurrency - Configuration - Idle - Other calculates: - system_io_wait_time=System I/O - app_wait_time=Application - user_io_wait_time=User I/O - commit_wait_time=Commit - concurrent_wait_time=Concurrency - configure_wait_time=Configuration - scheduler_wait_time=Idle - network_wait_time=Other protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: columns sql: "select wait_class, sum(time_waited) total_wait_time from v$active_session_history where session_state = 'WAITING' GROUP BY wait_class ORDER BY total_wait_time DESC" url: ^_^url^_^ - name: cpu_stats i18n: zh-CN: CPU状态 en-US: CPU Stats ja-JP: CPU状態 priority: 11 fields: - field: type type: 1 label: true i18n: zh-CN: 类型 en-US: Type ja-JP: タイプ - field: num type: 1 i18n: zh-CN: 数量 en-US: Num ja-JP: 数量 protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: multiRow sql: "select stat_name as type, value as num from v$osstat where stat_name like '%CPU%' or stat_name like '%TIME'" url: ^_^url^_^ - name: mem_stats i18n: zh-CN: 内存状态 en-US: Memory Stats ja-JP: メモリ状態 priority: 12 fields: - field: type type: 1 label: true i18n: zh-CN: 类型 en-US: Type ja-JP: タイプ - field: num type: 1 i18n: zh-CN: 数量 en-US: Num ja-JP: 数量 protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: multiRow sql: "select stat_name as type, value as num from v$osstat where stat_name like '%BYTES'" url: ^_^url^_^ - name: cache_hit_ratio i18n: zh-CN: 缓存命中率 en-US: Cache Hit Ratio ja-JP: キャッシュ命中率 priority: 13 fields: - field: lib_cache_hit_ratio type: 0 i18n: zh-CN: 库缓存命中率 en-US: LIB CACHE HIT RATIO ja-JP: LIBキャッシュ命中率 - field: buffer_cache_hit_ratio type: 0 i18n: zh-CN: 缓冲区缓存命中率 en-US: BUFFER CACHE HIT RATIO ja-JP: バッファキャッシュ命中率 aliasFields: - Library Cache Hit Ratio - Buffer Cache Hit Ratio calculates: - lib_cache_hit_ratio=Library Cache Hit Ratio - buffer_cache_hit_ratio=Buffer Cache Hit Ratio protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: columns sql: "select metric_name, value from gv$sysmetric where metric_name like '%Cache Hit Ratio' order by end_time asc" url: ^_^url^_^ - name: slow_query i18n: zh-CN: 慢查询 en-US: Slow Query ja-JP: スロークエリ priority: 14 fields: - field: sql_id type: 1 i18n: zh-CN: sql 主键 en-US: SQL ID ja-JP: SQL ID - field: child_number type: 1 i18n: zh-CN: 子编号 en-US: Child Number ja-JP: 子カーソルの番号 - field: executions type: 1 i18n: zh-CN: 执行数 en-US: EXECUTIONS ja-JP: 行われた実行数 unit: 次 - field: per_secs type: 1 i18n: zh-CN: 每秒执行数 en-US: Per Secs ja-JP: 1秒当たりの実行数 unit: 秒 - field: cpu_secs type: 1 i18n: zh-CN: 每秒CPU en-US: CPU Secs ja-JP: 使用したCPU時間 unit: 秒 - field: buffer_gets type: 1 i18n: zh-CN: 获得的缓冲区 en-US: Buffer Gets ja-JP: バッファ取得数 - field: disk_reads type: 1 i18n: zh-CN: 磁盘读取 en-US: Disk Reads ja-JP: ディスク読取り数 - field: fetches type: 1 i18n: zh-CN: 获取数量 en-US: Fetches ja-JP: SQL文に関連するフェッチ数 - field: parse_calls type: 1 i18n: zh-CN: 解析调用 en-US: Parse Calls ja-JP: 解析コール数 - field: optimizer_cost type: 1 i18n: zh-CN: 优化器成本 en-US: Optimizer Cost ja-JP: オプティマイザによるこの問合せのコスト - field: sql_text type: 1 i18n: zh-CN: SQL文本 en-US: SQL Text ja-JP: SQLテキスト protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: multiRow sql: "SELECT * FROM (SELECT sql_id, child_number, executions, ROUND(CASE WHEN executions = 0 THEN NULL ELSE elapsed_time / (executions*1000000) END,4) AS per_secs, cpu_time / 1000000 AS cpu_secs, buffer_gets, disk_reads, fetches, parse_calls, optimizer_cost, sql_text FROM v$sql ) where rownum <= 10 ORDER BY per_secs DESC" url: ^_^url^_^ - name: users i18n: zh-CN: 用户信息 en-US: Users ja-JP: スロークエリ priority: 15 fields: - field: username type: 1 i18n: zh-CN: 用户名 en-US: User Name ja-JP: ユーザー名 - field: account_status type: 1 i18n: zh-CN: 账号状态 en-US: Account Status ja-JP: アカウントのステータス - field: lock_date type: 1 i18n: zh-CN: 锁定时间 en-US: Lock Date ja-JP: ロック日付 - field: expiry_date type: 1 i18n: zh-CN: 密码失效时间 en-US: Password Expiry Date ja-JP: パスワードの有効期限 - field: expiry_seconds type: 0 i18n: zh-CN: 密码剩余有效时间 en-US: Password Validity Period Remaining ja-JP: パスワードの有効期間残り unit: 秒 - field: created type: 1 i18n: zh-CN: 创建时间 en-US: Creation Date ja-JP: 作成日 - field: authentication_type type: 1 i18n: zh-CN: 认证类型 en-US: Authentication Type ja-JP: 認証タイプ protocol: jdbc jdbc: host: ^_^host^_^ port: ^_^port^_^ platform: oracle username: ^_^username^_^ password: ^_^password^_^ database: ^_^database^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ queryType: multiRow sql: "SELECT username,account_status,lock_date,expiry_date,ceil((expiry_date-sysdate)* 24 * 60 * 60) as expiry_seconds,created,authentication_type FROM DBA_USERS ORDER BY expiry_date ASC" url: ^_^url^_^