Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit c11c47e

Browse files
committed
📝 Update doc after changing Oracle driver
1 parent 694d501 commit c11c47e

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

README.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Pre-compiled versions for Linux 64 bit and Mac OSX 64 bit can be found under [re
101101
In order to run, you'll need the [Oracle Instant Client Basic](http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html)
102102
for your operating system. Only the basic version is required for execution.
103103

104-
# Running
104+
## Running
105105
Ensure that the environment variable DATA_SOURCE_NAME is set correctly before starting.
106106
DATA_SOURCE_NAME should be in Oracle Database connection string format:
107107

@@ -125,6 +125,20 @@ export DATA_SOURCE_NAME=oracle://user:password@primaryhost:1521,standbyhost:1521
125125
# Then run the exporter
126126
/path/to/binary/oracledb_exporter --log.level error --web.listen-address 0.0.0.0:9161
127127
```
128+
129+
Version 0.5+ of the exporter is using a go lang driver that don't need the binaries from Oracle. As a side effect, you must transform your string version in order to be compatible with this driver.
130+
131+
Basicaly, it consist to follow this convention:
132+
- Add a string `oracle://` in front of the string
133+
- Replace the slash (`/`) between user and password by a colon (`:`)
134+
135+
Here is some example:
136+
137+
| Old string format | New string format |
138+
|-------------------------------------|----------------------------------------------|
139+
| `system/password@oracle-sid` | `oracle://system:password@oracle-sid` |
140+
| `user/password@myhost:1521/service` | `oracle://user:password@myhost:1521/service` |
141+
128142
## Default-metrics requirement
129143
Make sure to grant `SYS` privilege on `SELECT` statement for the monitoring user, on the following tables.
130144
```
@@ -142,27 +156,26 @@ v$resource_limit
142156

143157
# Integration with System D
144158

145-
Create **oracledb_exporter** user with disabled login and **oracledb_exporter** group\
146-
mkdir /etc/oracledb_exporter\
159+
Create `oracledb_exporter` user with disabled login and `oracledb_exporter` group then run the following commands:
160+
161+
```bash
162+
mkdir /etc/oracledb_exporter
147163
chown root:oracledb_exporter /etc/oracledb_exporter
148164
chmod 775 /etc/oracledb_exporter
149165
Put config files to **/etc/oracledb_exporter**
150166
Put binary to **/usr/local/bin**
167+
```
151168

152169
Create file **/etc/systemd/system/oracledb_exporter.service** with the following content:
153170

154-
```bash
171+
```
155172
[Unit]
156173
Description=Service for oracle telemetry client
157174
After=network.target
158175
[Service]
159176
Type=oneshot
160177
#!!! Set your values and uncomment
161178
#User=oracledb_exporter
162-
#Group=oracledb_exporter
163-
#Environment="DATA_SOURCE_NAME=dbsnmp/Bercut01@//primaryhost:1521,standbyhost:1521/myservice?transport_connect_timeout=5&retry_count=3"
164-
#Environment="LD_LIBRARY_PATH=/u01/app/oracle/product/19.0.0/dbhome_1/lib"
165-
#Environment="ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1"
166179
#Environment="CUSTOM_METRICS=/etc/oracledb_exporter/custom-metrics.toml"
167180
ExecStart=/usr/local/bin/oracledb_exporter \
168181
--default.metrics "/etc/oracledb_exporter/default-metrics.toml" \
@@ -171,7 +184,7 @@ ExecStart=/usr/local/bin/oracledb_exporter \
171184
WantedBy=multi-user.target
172185
```
173186

174-
Then tell System D to read files:
187+
Tell System D to refresh:
175188

176189
systemctl daemon-reload
177190

@@ -481,8 +494,11 @@ You can increase the log level (`--log.level debug`) in order to get the stateme
481494

482495
## error while loading shared libraries: libclntsh.so.xx.x: cannot open shared object file: No such file or directory
483496

484-
This exporter use libs from Oracle in order to connect to Oracle Database. If you are running the binary version, you
485-
must install the Oracle binaries somewhere on your machine and **you must install the good version number**. If the
497+
Version before 0.5 use libs from Oracle in order to connect to Oracle Database. After 0.5 release, the oracle exporter use an pure Go DB driver and don't need binaries from Oracle anymore.
498+
499+
Please switch to version 0.5.
500+
501+
For older version, you must install the Oracle binaries somewhere on your machine and **you must install the good version number**. If the
486502
error talk about the version 18.3, you **must** install 18.3 binary version. If it's 12.2, you **must** install 12.2.
487503

488504
An alternative is to run this exporter using a Docker container. This way, you don't have to worry about Oracle binaries

0 commit comments

Comments
 (0)