How to connect to Oracle database on AWS EC2












0















I have an Oracle 12C database on an EC2 instance running Oracle Linux 7.
The EC2 instance is in a public subnet and it has a public dns name and a public IP address.



The listner.ora has proper host name of the server( ip-x.x.x.x.ec2.internal).



SQLnet.ora on server has below entry -



NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)



I have configured the EC2 security group with inbound rule to allow port 1521 from anywhere.



I can connect to the database using SQL Developer tool and sqlplus on the server it self. But I cannot connect from other EC2 instance ( bound to the same security group) or another Windows 10 machine outside AWS.



telnet 1521 never succeeds..



My question: Do I need to open port 1521 in the firewall on the Linux server in addition to having the inbound rules in the security groups ?










share|improve this question




















  • 1





    If there is a firewall on the Linux server then of course it needs to have the necessary ports open. Also check the output of netstat and see what IP the oracle DB server is bound to. If I remember right it only binds to localhost by default, but I don’t remember the details right now.

    – Appleoddity
    Jan 3 at 2:04











  • Is there a way to verify if firewall is blocking the 1521 traffic? From AWS documentation it appears Security Group inbound rules are sufficient to open the ports.

    – Ravi Kumar
    Jan 3 at 2:07






  • 1





    If the firewall is on the server it doesn’t have anything to do with AWS. Just like all servers and computers they have the option to install a firewall. Your server might have iptables or something else. You’re going to have to do some research as opening your database server up to the world is not something you should do nonchalantly and you need to understand these things.

    – Appleoddity
    Jan 3 at 2:11











  • Thanks! This is just a test machine with no real data. Will post back the netstat output.

    – Ravi Kumar
    Jan 3 at 2:17






  • 1





    netstat -ln that’s the whole command

    – Appleoddity
    Jan 3 at 2:21
















0















I have an Oracle 12C database on an EC2 instance running Oracle Linux 7.
The EC2 instance is in a public subnet and it has a public dns name and a public IP address.



The listner.ora has proper host name of the server( ip-x.x.x.x.ec2.internal).



SQLnet.ora on server has below entry -



NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)



I have configured the EC2 security group with inbound rule to allow port 1521 from anywhere.



I can connect to the database using SQL Developer tool and sqlplus on the server it self. But I cannot connect from other EC2 instance ( bound to the same security group) or another Windows 10 machine outside AWS.



telnet 1521 never succeeds..



My question: Do I need to open port 1521 in the firewall on the Linux server in addition to having the inbound rules in the security groups ?










share|improve this question




















  • 1





    If there is a firewall on the Linux server then of course it needs to have the necessary ports open. Also check the output of netstat and see what IP the oracle DB server is bound to. If I remember right it only binds to localhost by default, but I don’t remember the details right now.

    – Appleoddity
    Jan 3 at 2:04











  • Is there a way to verify if firewall is blocking the 1521 traffic? From AWS documentation it appears Security Group inbound rules are sufficient to open the ports.

    – Ravi Kumar
    Jan 3 at 2:07






  • 1





    If the firewall is on the server it doesn’t have anything to do with AWS. Just like all servers and computers they have the option to install a firewall. Your server might have iptables or something else. You’re going to have to do some research as opening your database server up to the world is not something you should do nonchalantly and you need to understand these things.

    – Appleoddity
    Jan 3 at 2:11











  • Thanks! This is just a test machine with no real data. Will post back the netstat output.

    – Ravi Kumar
    Jan 3 at 2:17






  • 1





    netstat -ln that’s the whole command

    – Appleoddity
    Jan 3 at 2:21














0












0








0








I have an Oracle 12C database on an EC2 instance running Oracle Linux 7.
The EC2 instance is in a public subnet and it has a public dns name and a public IP address.



The listner.ora has proper host name of the server( ip-x.x.x.x.ec2.internal).



SQLnet.ora on server has below entry -



NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)



I have configured the EC2 security group with inbound rule to allow port 1521 from anywhere.



I can connect to the database using SQL Developer tool and sqlplus on the server it self. But I cannot connect from other EC2 instance ( bound to the same security group) or another Windows 10 machine outside AWS.



telnet 1521 never succeeds..



My question: Do I need to open port 1521 in the firewall on the Linux server in addition to having the inbound rules in the security groups ?










share|improve this question
















I have an Oracle 12C database on an EC2 instance running Oracle Linux 7.
The EC2 instance is in a public subnet and it has a public dns name and a public IP address.



The listner.ora has proper host name of the server( ip-x.x.x.x.ec2.internal).



SQLnet.ora on server has below entry -



NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)



I have configured the EC2 security group with inbound rule to allow port 1521 from anywhere.



I can connect to the database using SQL Developer tool and sqlplus on the server it self. But I cannot connect from other EC2 instance ( bound to the same security group) or another Windows 10 machine outside AWS.



telnet 1521 never succeeds..



My question: Do I need to open port 1521 in the firewall on the Linux server in addition to having the inbound rules in the security groups ?







linux firewall amazon-web-services






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 4 at 3:55







Ravi Kumar

















asked Jan 3 at 0:55









Ravi KumarRavi Kumar

1386




1386








  • 1





    If there is a firewall on the Linux server then of course it needs to have the necessary ports open. Also check the output of netstat and see what IP the oracle DB server is bound to. If I remember right it only binds to localhost by default, but I don’t remember the details right now.

    – Appleoddity
    Jan 3 at 2:04











  • Is there a way to verify if firewall is blocking the 1521 traffic? From AWS documentation it appears Security Group inbound rules are sufficient to open the ports.

    – Ravi Kumar
    Jan 3 at 2:07






  • 1





    If the firewall is on the server it doesn’t have anything to do with AWS. Just like all servers and computers they have the option to install a firewall. Your server might have iptables or something else. You’re going to have to do some research as opening your database server up to the world is not something you should do nonchalantly and you need to understand these things.

    – Appleoddity
    Jan 3 at 2:11











  • Thanks! This is just a test machine with no real data. Will post back the netstat output.

    – Ravi Kumar
    Jan 3 at 2:17






  • 1





    netstat -ln that’s the whole command

    – Appleoddity
    Jan 3 at 2:21














  • 1





    If there is a firewall on the Linux server then of course it needs to have the necessary ports open. Also check the output of netstat and see what IP the oracle DB server is bound to. If I remember right it only binds to localhost by default, but I don’t remember the details right now.

    – Appleoddity
    Jan 3 at 2:04











  • Is there a way to verify if firewall is blocking the 1521 traffic? From AWS documentation it appears Security Group inbound rules are sufficient to open the ports.

    – Ravi Kumar
    Jan 3 at 2:07






  • 1





    If the firewall is on the server it doesn’t have anything to do with AWS. Just like all servers and computers they have the option to install a firewall. Your server might have iptables or something else. You’re going to have to do some research as opening your database server up to the world is not something you should do nonchalantly and you need to understand these things.

    – Appleoddity
    Jan 3 at 2:11











  • Thanks! This is just a test machine with no real data. Will post back the netstat output.

    – Ravi Kumar
    Jan 3 at 2:17






  • 1





    netstat -ln that’s the whole command

    – Appleoddity
    Jan 3 at 2:21








1




1





If there is a firewall on the Linux server then of course it needs to have the necessary ports open. Also check the output of netstat and see what IP the oracle DB server is bound to. If I remember right it only binds to localhost by default, but I don’t remember the details right now.

– Appleoddity
Jan 3 at 2:04





If there is a firewall on the Linux server then of course it needs to have the necessary ports open. Also check the output of netstat and see what IP the oracle DB server is bound to. If I remember right it only binds to localhost by default, but I don’t remember the details right now.

– Appleoddity
Jan 3 at 2:04













Is there a way to verify if firewall is blocking the 1521 traffic? From AWS documentation it appears Security Group inbound rules are sufficient to open the ports.

– Ravi Kumar
Jan 3 at 2:07





Is there a way to verify if firewall is blocking the 1521 traffic? From AWS documentation it appears Security Group inbound rules are sufficient to open the ports.

– Ravi Kumar
Jan 3 at 2:07




1




1





If the firewall is on the server it doesn’t have anything to do with AWS. Just like all servers and computers they have the option to install a firewall. Your server might have iptables or something else. You’re going to have to do some research as opening your database server up to the world is not something you should do nonchalantly and you need to understand these things.

– Appleoddity
Jan 3 at 2:11





If the firewall is on the server it doesn’t have anything to do with AWS. Just like all servers and computers they have the option to install a firewall. Your server might have iptables or something else. You’re going to have to do some research as opening your database server up to the world is not something you should do nonchalantly and you need to understand these things.

– Appleoddity
Jan 3 at 2:11













Thanks! This is just a test machine with no real data. Will post back the netstat output.

– Ravi Kumar
Jan 3 at 2:17





Thanks! This is just a test machine with no real data. Will post back the netstat output.

– Ravi Kumar
Jan 3 at 2:17




1




1





netstat -ln that’s the whole command

– Appleoddity
Jan 3 at 2:21





netstat -ln that’s the whole command

– Appleoddity
Jan 3 at 2:21










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1390002%2fhow-to-connect-to-oracle-database-on-aws-ec2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1390002%2fhow-to-connect-to-oracle-database-on-aws-ec2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Paul Cézanne

UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

Angular material date-picker (MatDatepicker) auto completes the date on focus out