You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Configuring connections for multiple databases using Oracle Database wallet(s)](#configuring-connections-for-multiple-databases-using-oracle-database-wallets)
63
+
*[Scraping metrics from specific databases](#scraping-metrics-from-specific-databases)
#### Configuring connections for multiple databases using Oracle Database wallet(s)
850
+
851
+
The Oracle Database Metrics exporter uses ODPI-C, which can only initalize the TNS aliases from a `tnsnames.ora` file once per process. To work around this, the exporter can be configured to read from a "combined"`tnsnames.ora` file containing all TNS aliases forconnectionsin a multi-database configuration.
852
+
853
+
1. For each database the exporter will connect to, download the corresponding wallet files. If you're using ADB/ATP-S, download the regional wallet instead of the instance wallet if the databases are in the same region.
854
+
855
+
2. Copy the TNS aliases the `tnsnames.ora` file from each wallet, and combine them into one file, so all your database service names are in one file together
856
+
857
+
3. In the combined `tnsnames.ora` file, and add the following snippet to each TNS alias connection string, to tell the client where the wallet directory is:
The combined `tnsnames.ora` file, which contains the TNS aliases for both databases, and their corresponding wallet location in the `security` configuration will look something like the following:
4. Take wallet files (cwallet.sso, ewallet.p12, & ewallet.pem) for each database, and place them in separate directories. For example, `db1` gets its own directory, `db2` gets its own directory, and so forth.
872
+
873
+
The resulting directory structure should look like the following, with wallet information separate from the combined `tnsnames.ora` file:
874
+
875
+
```
876
+
wallets
877
+
├── combined
878
+
│ ├── sqlnet.ora
879
+
│ └── tnsnames.ora // Combined tnsnames.ora
880
+
├── db1
881
+
│ ├── cwallet.sso
882
+
│ ├── ewallet.p12
883
+
│ └── ewallet.pem
884
+
└── db2
885
+
├── cwallet.sso
886
+
├── ewallet.p12
887
+
└── ewallet.pem
888
+
```
889
+
890
+
5. Set the `TNS_ADMIN` environment variable where the exporter is running to the directory containing your combined `tnsnames.ora` file:
891
+
892
+
```
893
+
export TNS_ADMIN=/wallets/combined/tnsnames.ora
894
+
```
895
+
896
+
6. Finally, update the exporter configuration file to include the TNS aliases for all databases you will be connecting to. Ensure your database configuration file does not use the `tnsAdmin` property, as we are using the global `TNS_ADMIN` environment variable to point to the combined `tnsnames.ora` file:
0 commit comments