http://www.taodudu.cc/news/show-4845374.html docker run -d --name oracledb_exporter --restart=always -p 9161:9161 -e DATA_SOURCE_NAME='sys/Test20131127@10.110.80.116/oradb as sysdba' ghcr.io/iamseth/oracledb_exporter:0.4.3 SQLNET.ALLOWED_LOGON_VERSION_SERVER=8 SQLNET.ALLOWED_LOGON_VERSION=8 # export Oracle location: export DATA_SOURCE_NAME=system/password@oracle-sid # or using a complete url: export DATA_SOURCE_NAME=user/password@//myhost:1521/service # 19c client for primary/standby configuration export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/service # 19c client for primary/standby configuration with options export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/service?connect_timeout=5&transport_connect_timeout=3&retry_count=3 # 19c client for ASM instance connection (requires SYSDBA) export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/+ASM?as=sysdba # Then run the exporter /path/to/binary/oracledb_exporter --log.level error --web.listen-address 0.0.0.0:9161 export DATA_SOURCE_NAME=sys/Test20131127@oradb
最近帮公司安装监控系统,就是prometheus+grafana+各种exporter
然后启动oracledb_exporter的时候,出现了许多问题
最后一一都解决了,记录下,希望帮助下一个为此烦恼的孩子
对了,你装监控组件,一定要配置好组件的日志输出设置
运行环境:centos 7.5
数据库版本:19c
exporter版本:0.2.9
确保oracledb_exporter的启动用户与oracle启动用户保持一致,这一点尤为重要
./oraceldb_exporter: error while loading shared libraries: libclntsh.so.18.1:can not shared object file: No such file or directory
将oracle的信息加入到环境变量中,运行如下命令
vim ~/.bash_profile
# oracle环境变量
export ORACLE_SID=ORCLCDB
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
# oracledb_exporter环境变量
export DATA_SOURCE_NAME=<用户名><密码>@<数据库服务名>
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
修改bash_profile完成后,执行
source ~/.bash_profile
下面这步由root用户执行
然后编辑/etc/ld.so.conf
文件,将LD_LIBRARY_PATH
的路径加入最后一行/opt/oracle/product/19c/dbhome_1/lib
再执行ldconfig
应用配置
Error pinging oracle: ORA-12162:TNS:net service name is incorrectly specified
增加一个TNS_ADMIN环境变量
vim ~/.bash_profile
# oracle环境变量
export ORACLE_SID=ORCLCDB
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
# oracledb_exporter环境变量
export TNS_ADMIN=$ORACLE_HOME/network/admin
export DATA_SOURCE_NAME=<用户名><密码>@<数据库服务名>
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
修改bash_profile完成后,执行
source ~/.bash_profile
Error scraping for sessions ... : ORA-00942: table or view does not exist
修改一个DATA_SOURCE_NAME环境变量为system用户
vim ~/.bash_profile
# oracle环境变量
export ORACLE_SID=ORCLCDB
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
# oracledb_exporter环境变量
export TNS_ADMIN=$ORACLE_HOME/network/admin
export DATA_SOURCE_NAME=system/system的密码
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
修改bash_profile完成后,执行
source ~/.bash_profile
确保oracledb_exporter的启动用户与oracle启动用户保持一致,这一点尤为重要