Open Bart-De-Pauw opened 1 year ago
Hello @Bart-De-Pauw
Ok, I can reproduce this issue.
As a workaround - you can click on the "Test Connection" button in your Connection Settings after the TNS file changing. "Test Connection" reads the file again.
Would be great if the TNS-file is always used. (That's the idea of the TNS). Why is there any cache between at all?
This will make problems if we change TNS that all DBeaver users have to refresh all their connections.
Thanks for any effort.
Hello, I experience a similar issue when copying an existing (working) TNS connection. The new connection returns the error message
Listener refused the connection with the following error: ORA-12504, TNS:listener was not given the SID in CONNECT_DATA
The intention of the operation is copying an existing connection, then changing the user / password to access a different schema in the new connection.
When comparing the connection properties of the existing and new connections, I see the copied one has lost a part ot the connection string:
ORIGINAL: "url": "jdbc:oracle:thin:@(DESCRIPTION\u003d(ADDRESS_LIST\u003d(FAILOVER\u003don)(LOAD_BALANCE\u003doff)(ADDRESS\u003d(PROTOCOL\u003dTCP)(HOST\u003dfrgnbrac02-scan.XXX.com)(PORT\u003d1521))(ADDRESS\u003d(PROTOCOL\u003dTCP)(HOST\u003dfrgnbora31.XXX.com)(PORT\u003d1521)))(CONNECT_DATA\u003d(FAILOVER_MODE\u003d(TYPE\u003dselect)(METHOD\u003dbasic)(RETRIES\u003d20)(DELAY\u003d15))(SERVER\u003ddedicated)(SERVICE_NAME\u003dNG_DG)))",
COPIED: "url": "jdbc:oracle:thin:@(DESCRIPTION\u003d(ADDRESS_LIST\u003d(FAILOVER\u003don)(LOAD_BALANCE\u003doff)(ADDRESS\u003d(PROTOCOL\u003dTCP)(HOST\u003dfrgnbrac02-scan.XXX.com)(PORT\u003d1521)))",
(a) I've not managed to update that string via the user interface (b) The "Test Connection" button workaround described above does not work for me.
Steps to reproduce: Pre: you need to have a working Oracle connection based on TNS
Workaround:
Thanks very much for dbEaver, it is the best!
Description
I'm connecting to an an Oracle database using the TNS Network Alias. This alias is defined in a tnsnames.ora file.
DBALIAS=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dbservice)))
This file is present in the Oracle Client subfolder %ORACLE_HOME%/network/admin/tnsnames.ora It is working as expected.
Whenever you create a connection using TNS, it generates a Custom JDBC URL Template like jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dbservice)))
The problem is when you change the alias in your tnsnames.ora, I notice that my connection is no longer working, because of the Custom JDBC URL.
Could you refresh the Custom JDBC URL automatically?
DBeaver Version
Community Edition Version 22.3.2.202301060755
Operating System
Windows Server 2019
Database and driver
Database: Oracle 19.16.0 Driver: Oracle Thin Client 12.2.0.1
Steps to reproduce
Edit tnsnames.ora and create an alias (see issue description)
Create a Oracle connection using TNS network alias DBALIAS no problem to establish a connection here, and I see that the Custom JDBC URL is created
For the purpose of this issue, I create a new database service and stop the old service
Change the tnsnames.ora alias and let it point to SERVICE_NAME=newdbservice DBALIAS=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=newdbservice)))
Disconnect and reconnect the Oracle connection. You will get an connection error.
Only when you change the TNS entry, it is regenerating the Custom JDBC URL, but thats not the intention imho.
Can you check and provide a possible solution?
Much appreciated. Best regards, Bart
Additional context
No response