Forum Discussion
Oracle: ORA-12154: Cannot connect to database... error on Service
Hi yaman123,
I’d build on what’s already in the thread with two points:
1) ORA-12154 in the Service almost always means the gateway machine can’t resolve your Oracle connect identifier.
2) the September Desktop bug people are seeing is real, but Desktop and the Service take different paths. Desktop uses the PC you’re on; the Service uses the on-premises data gateway and whatever Oracle client and environment that server has.
Here's some troubleshooting steps:
- Bypass TNS and test Easy Connect
Edit the Oracle data source in the Service and set Server to this format:
host:port/service_name
Example: db01.yourcorp.local:1521/SALES. If Test Connection succeeds, your TNS name resolution on the gateway is the culprit. Docs: Power Query Oracle connector and Oracle’s Easy Connect syntax here. - Check if your gateway updated
Many orgs update the gateway monthly. If your issue began recently, that can align with an update or a service restart that dropped environment variables. Check the gateway version and consider testing July or August 2025 on a spare node or rollback if needed (supported versions and downloads are listed here): gateway monthly updates. - Reassert TNS on the gateway server
On the gateway box, set a system environment variable TNS_ADMIN to the folder with tnsnames.ora and sqlnet.ora, ensure the gateway service account can read it, then restart the “On-premises data gateway” Windows service. Guide: Manage your Oracle data source via gateway. - Prove it from the gateway as the service account
On the gateway host, run tnsping <your_alias> and connect with SQL*Plus or SQL Developer using that alias. If tnsping fails, ORA-12154 is expected. Oracle’s definition of 12154 is clear that it’s a name resolution problem: Oracle ORA-12154. - Rebind and test in the Service
In the dataset settings, bind to the validated gateway data source and hit Test Connection. Reference: gateway binding steps.
If you confirm Easy Connect works in the Service, I’d leave it in place and circle back to TNS later. If neither Easy Connect nor TNS works and you’ve validated firewall and listener, I’d open a Microsoft ticket and include gateway version, Oracle client version, TNS_ADMIN path, the exact Server value you used, and tnsping output from the gateway host.
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
Hi tayloramy
Thanks - i will try those steps. Its a bit strange how this occured all of a sudden as no changes are made to our connections, tnsnames, firewalls, vpns or servers. Refreshes were ok until yesterday.
- tayloramy11 months agoSuper User
Hi yaman123,
This is been a frustration with me with Fabric for a little bit. Sometimes Microsoft updates things on their end and it breaks existing things. At my org I update the gateways monthly to try and prevent this, but somethings that brings up other issues.
I love Fabric, but the change management around it could be a little better.
Let me know if those suggestions don't work and we can figure out another solution for you.
If you found my suggestions helpful, I would approciate some kudos (gotta earn those ranks somehow :P)
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.