I have an Oracle RDS instance running on AWS and I need to access the tnsnames.ora
file and check its configuration since I am getting this error
Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
which is directly connected these two following resolutions
- How to Fix 'ORA-12505, TNS:listener does not currently know of SID given in connect descriptor'
- TNS:listener does not currently know of SID given in connect descriptor
the problem is that AWS does NOT allow remote access to the Oracle RDS and I cannot find anything in the AWS console which would help me change or even access the contents of the tnsnames.ora
.
Can I maybe do it using SQL? I'm at my wits end here... This error does not even seem to be consistent since for example some queries do work....
/// Adding more info after reading some comments:
Queries like the following are successfully executed:
SELECT COUNT(*) FROM (
SELECT
DISTINCT tab.column_a, tab.column_a AS L0, tab.column_a AS L1, tab.column_a AS L2
FROM
ADMIN.table_something tab
WHERE
tab.column_a IS NOT NULL
)
the ones that fail look like this
SELECT
DISTINCT tab.column_a, tab.column_a AS L0, tab.column_a AS L1, tab.column_a AS L2
FROM
ADMIN.table_something tab
WHERE
tab.column_a IS NOT NULL
and by fail I mean producing the error I mentioned above. Executing these from a SQL command prompt produces no errors.
I am using this jdbc URL:
jdbc:oracle:thin:@<host_URL>:1521:SID
I also tried using this format
jdbc:oracle:thin:@<host_URL>:1521/ServiceNames
But apparently the AWS RDS instance is not configured with service names. Most of the answers I've found refer to the tnsnames.ora
as the place where the service names and sids are configured and therefore includes information on how to actually form a connection string. This is why I want to access it and if I find something suspicious then modify it.
ORA-12505
error and why do you think changingtnsnames.ora
will solve that.