Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DATA_SOURCE_NAME without the password #450

Open
1 task done
iwonaclk opened this issue May 13, 2024 · 4 comments
Open
1 task done

DATA_SOURCE_NAME without the password #450

iwonaclk opened this issue May 13, 2024 · 4 comments

Comments

@iwonaclk
Copy link

iwonaclk commented May 13, 2024

  • question

What is the current behavior?

According to the documentation, the DATA_SOURCE_NAME needs to have the following string format (containing the user and pass):

"Ensure that the environment variable DATA_SOURCE_NAME is set correctly before starting. DATA_SOURCE_NAME should be in Oracle Database connection string format:
oracle://user:pass@server/service_name[?OPTION1=VALUE1[&OPTIONn=VALUEn]...]"

What is the expected behavior?

Is there an easy way to set the DATA_SOURCE_NAME without telling the user and pass openly?

What is the motivation / use case for changing the behavior?

I would like to avoid showing the user and pass in DATA_SOURCE_NAME because of security purposes.

I can add an entry with the user and password into the Oracle Wallet, but how should look the DATA_SOURCE_NAME then?

Please tell us about your environment:

OracleDB_Exporter 0.5.2
Oracle Client FULL 19.3.0
Oracle Database 19

@lucian-vanghele
Copy link
Contributor

I also tried this, documentation found is a bit confusing/unclear, some people pretend they made it work however for me it didn't work. Try playing with TNS_ADMIN, DATA_SOOURCE_NAME, WALLET_PATH ...

@lucian-vanghele
Copy link
Contributor

I made it work, it is about how you define your entry inside the wallet:
mkstore -wrl <wallet_location> -createCredential <db_connect_string>

The db_connect_string must be identical to the connection string that you specify in the URL used in the datasource definition (the part of the string that follows the @). It can be either the short form or the long form of the URL.

@Jansy-rm
Copy link

Relieved to read someone has got it working. Any chance you could provide an example of a URL and db_connect_string that works for you?

@Jansy-rm
Copy link

Jansy-rm commented May 30, 2024

Managed to get it working using a SEP Wallet.

export DATA_SOURCE_NAME='oracle://username@hostname:1521/service?TRACE FILE=/tmp/trace.log&wallet=wallet_location'

mkstore -wrl <wallet_location> -create
mkstore -wrl <wallet_location> -createCredential '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=service)))' username "password"

/usr/local/bin/oracledb_exporter --default.metrics "/etc/oracledb_exporter/default-metrics.toml" --log.level debug --web.listen-address 0.0.0.0:9110`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants