Jennifer
Jennifer

Reputation: 91

Cannot establish connection with AWS RDS Oracle database instance from Oracle SQL Developer

I created an Oracle database in the AWS RDS console. I'm unable to connect to it from the Oracle SQL Developer program despite following all the instructions in the Amazon Developer Guides (see item #3 in this webpage in particular).

I get this error: IO Error: the network adapter could not establish the connection (vendor code 17002).

I have opened Port 1521 in my firewall settings.

Screenshots of my SQL Developer connection properties pane and the database properties from the AWS RDS console:

Edit:

AWS Security Group Rules Update: I took people's suggestions and ensured that Port 1521 was added to the Security Group inbound and outbound rules.

Inbound Rules screenshot For the inbound, I tried multiple things such as allowing the port for all IP addresses or just my IP address, but allowing it on the security group is the ONLY option that doesn't give me a SQL Developer connection error of "Listener refused the connection with the following error: TNS:listener does not currently know of SID given in connector descriptor. Vendor code 12505".

I don't believe I should have to have any rule for opening Port 1521 on the Inbound Rules because the default setting accepts all traffic, which I would think would include Port 1521.

Outbound Rules screenshot For the outbound, I added Port 1521 for my IP address.

I still get the same error despite all of these changes.

Any guidance would be appreciated! Thanks!

Upvotes: 2

Views: 8507

Answers (3)

LukeSolar
LukeSolar

Reputation: 3865

In addition to providing ORCL as SID / Database Name (see Mbuotidem Isaac's answer, this is not the database identifier) I had to configure the security group on Amazon RDS, by adding this for public access: Inboud rules for allowing public access to oracle db

Upvotes: 0

Mbuotidem Isaac
Mbuotidem Isaac

Reputation: 914

One or more of the steps outlined below may solve your problem.

  1. Make sure that your SID in SQL Developer is your database name. To avoid frustration, forget about whatever you set when creating the database. Verify the correct database name by going to the Configuration tab and copying the string below DB Name as you see in the screenshot below. As you can see the DB Name here is DATABASE. I thought I had set it to ofaoes but I was wrong. The AWS flow to create a database, at least at the time of writing this answer, does not help at all because there is no specific field to enter the database name.

Screenshot of AWS RDS Configurationpage

  1. Verify that your database is Publicly Accessible.

    1. Verify that your VPC has an internet gateway attached to it and that the inbound rules for the security group allow connections. (See link 2 below for help on this)

    2. Open the Amazon RDS console.

    3. Choose Databases from the navigation pane, and then select the DB instance.

    4. Choose Modify.

    5. Under Network & Security, choose Yes for Public accessibility.

    6. Choose Continue.

    7. Choose Modify DB Instance.

Here is a screenshot of that window:

enter image description here

For more info, or if the above doesn't work, visit the links for more current info:

  1. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Troubleshooting.html#CHAP_Troubleshooting.Connecting
  2. https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html#Add_IGW_Attach_Gateway
  3. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html#USER_VPC.Hiding

  4. https://aws.amazon.com/premiumsupport/knowledge-center/rds-connectivity-instance-subnet-vpc/

  5. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html

  6. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Scenarios.html

Upvotes: 9

Juned Ahsan
Juned Ahsan

Reputation: 68715

There can be multiple reasons for it. Here are a couple of them that I can think of

  1. Make sure that security group attached to your RDS instance allows the incoming connection on port 1521 for your client machine ip address
  2. If you are using the Windows client machine, make sure that you have allowed the outgoing connection to port 1521.

Upvotes: 1

Related Questions