While creating access token for Oracle database if you get the error message as shown in screenshot then this solution applies to you :
One of the possible reason is that the system doesn’t rely on the tnsnames.ora file in the local system, so to overcome that we need to frame the connection string omitting tnsnames.ora file. Refer here:
https://www.connectionstrings.com/net-framework-data-provider-for-oracle/omiting-tnsnamesora/
The solution is as follows,
- Change the Database Server name to the below format,
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<MyHost>)(PORT=<MyPort>))(CONNECT_DATA=(SERVICE_NAME=<servicename>)))
Note: You can copy the content from tnsnames.ora if it exists else you can create it. Also if you want to use SID instead of Service Name then the above string will be different.
- Remove the port number in the configuration (leave it blank)
Tip: The above format can easily get it from the tnsnames.ora file, which is located in oracle client installation folder as “~\11.2.0\dbhome_1\NETWORK\ADMIN”.
After copying the above format in Database Server Name field, click on “Test Connection”