oracledb_exporter
oracledb_exporter copied to clipboard
error Errorpingingoracle:="address c: missing port in address"
I run oracledb_exporter to report an error,How to solve it?
-
run: DATA_SOURCE_NAME='oracle://c##exporter:ora@[email protected]:1521/cms1' ./oracledb_exporter --default.metrics "/oracle/oracledb_exporter-0.5.1.linux-amd64/default-metrics.toml" --web.listen-address 0.0.0.0:9161
-
error: caller=collector.go:262 level=error Errorpingingoracle:="address c: missing port in address"
What is the current behavior?
oracle版本: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production TNS for Linux: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production
配置: export DATA_SOURCE_NAME=oracle://system:[email protected]:1521/orcl 问题: ts=2023-07-20T04:16:41.049Z caller=collector.go:262 level=error Errorpingingoracle:="missing port in address"
遇到了一样的问题解决了吗
export DATA_SOURCE_NAME=oracle://system:[email protected]:1521/orcl 将这个变量添加到/etc/profile 或者用户的.bash_profile中即可解决上述问题。 或者 vim /usr/lib/systemd/system/oracledb_exporter.service ... 启用环境变量 Environment="DATA_SOURCE_NAME=oracle://system:[email protected]:1521/orcl" ...
https://github.com/iamseth/oracledb_exporter/issues/345#issuecomment-1651987462
I have the same problem like original submitter, i.e. I get an error: address c: missing port in address but only when I connect using Oracle common user (i.e. user which name starts with "c##..." It seems like first "#" terminates the string and I can't figure out how to escape this :(
EDIT: I've made some tests and older versions (i.e. those using go-oci8 and instant client) - work fine. The problem is with newer versions which use pure Go client (go-ora)
修改上述的的环境变量也不行吗?参考https://github.com/iamseth/oracledb_exporter/issues/352#issuecomment-1645008849
This is also reproducible from my side: version 0.5.1 -> C##APP_PROMETHEUS user connection fails with "address c: missing port in address" version 0.4.3 -> C##APP_PROMETHEUS user can connect.
Please note that these user names are not some funny naming schema from my weird brain, but they are part of Oracles CDB/PDB architecture: Oracle common User Accounts
我的问题解决结果是:用户名中'#'要使用转义,换成'%23'就好了
I get this error too, connecting as dbsnmp, with 0.5.0 and 0.5.1, but working with 0.4.3.
I am getting the same DATA_SOURCE_NAME="user/password@hostname:1521/dbname"
Use format DATA_SOURCE_NAME=oracle://user:[email protected]:1521/dbname it is working for me
Have the same issue. Not working when username is CDB C##... Also i'm trying to configure as Environment="DATA_SOURCE_NAME=...." in systemd service file and no combination works... i've tryied "%%23%%23" with no luck.
Switching down to previous version