Forum Discussion
Oracle connection error
Error on establishing connection with credentials.
user credentials are accurate and gateway also updated
Failed to update data source credentials: Oracle: ORA-12154: Cannot connect to database. Cannot find alias **** in DataSources, , EZConnect. https://docs.oracle.com/error-help/db/ora-12154/Hide details
Status code: 400
ORA-12154 typically indicates that Oracle cannot resolve the service name, TNS alias, or connection identifier being used, rather than an issue with the username or password. Even if the gateway is up to date and the credentials are correct, Power BI and the gateway must be able to resolve the Oracle alias specified in the connection string.
A few things to check:
- Verify that the server/database value in the Power BI data source exactly matches an entry in the tnsnames.ora file.
- Confirm that the Oracle client and gateway are using the same tnsnames.ora file and Oracle Home.
- If you're using a TNS alias, test the connection directly from the gateway server using SQL*Plus or another Oracle tool.
- Consider using an EZConnect string (for example, host:port/service_name) instead of a TNS alias if your environment supports it.
- After making any changes, restart the On-premises Data Gateway service and try updating the credentials again.
Since the error specifically says it cannot find the alias in DataSources or EZConnect, I would focus on validating the Oracle network configuration and TNS name resolution on the gateway machine rather than the Power BI credentials themselves.
3 Replies
- sannavajjalaResolver II
ORA-12154 typically indicates that Oracle cannot resolve the service name, TNS alias, or connection identifier being used, rather than an issue with the username or password. Even if the gateway is up to date and the credentials are correct, Power BI and the gateway must be able to resolve the Oracle alias specified in the connection string.
A few things to check:
- Verify that the server/database value in the Power BI data source exactly matches an entry in the tnsnames.ora file.
- Confirm that the Oracle client and gateway are using the same tnsnames.ora file and Oracle Home.
- If you're using a TNS alias, test the connection directly from the gateway server using SQL*Plus or another Oracle tool.
- Consider using an EZConnect string (for example, host:port/service_name) instead of a TNS alias if your environment supports it.
- After making any changes, restart the On-premises Data Gateway service and try updating the credentials again.
Since the error specifically says it cannot find the alias in DataSources or EZConnect, I would focus on validating the Oracle network configuration and TNS name resolution on the gateway machine rather than the Power BI credentials themselves.
- AH7AWBNew Member
I had the same issue since the last update last week, and have solved it now.
Please add the TNS_ADMIN system environment variable on the gateway server:
- Open System Properties (sysdm.cpl).
- Go to Advanced → Environment Variables.
- Under System variables, click New.
- Add:
- Variable name: TNS_ADMIN
- Variable value: C:\Program Files\Oracle Client for Microsoft Tools\network\admin
- Click OK to save the changes.
- Restart the On-premises data gateway service (PBIEgwService).
After completing these steps, test the gateway connection again.
- AH7AWBNew Member
Please add the TNS_ADMIN system environment variable on the gateway server:
- Open System Properties (sysdm.cpl).
- Go to Advanced → Environment Variables.
- Under System variables, click New.
- Add:
Variable name: TNS_ADMIN
Variable value: C:\Program Files\Oracle Client for Microsoft Tools\network\admin - Click OK to save the changes.
- Restart the On-premises data gateway service (PBIEgwService).
- After completing these steps, test the gateway connection again.