This discussion is archived
1 2 Previous Next 19 Replies Latest reply: Mar 12, 2013 11:33 AM by Gary Graham RSS

Can't connect to Oracle using localhost

993830 Newbie
Currently Being Moderated
Hi,

I am trying to use Oracle SQL Developer to connect to Oracle 11g using localhost on my laptop. Oracle is started, I am using the exact same settings as the rest of the students in my class, and my instructor, but it just times out when trying to connect. I have uninstalled and reinstalled Oracle, Java, anything I can think that would be connected. My instructor had me put in his machine's IP address to connect to instead, and that worked. But localhost will not.

I use SYSTEM as the username (I have also tried SYS), and the password is the one I used when I installed Oracle. Port is default of 1521, hostname of localhost, SID is default of xe.

I have also tried PostgreSQL, with it's default settings, and the same thing happens.

The exact error code I am getting is: Status: Failure - Test failed: IO Error: Socket read timed out


Does anyone know what could be causing this?

If there is any other information I can provide that may help narrow down the issues, just let me know.

Thank you in advance,

Brad
  • 1. Re: Can't connect to Oracle using localhost
    rp0428 Guru
    Currently Being Moderated
    Welcome to the forum!

    Whenever you post provide your full sql developer version and for Oracle DB issues your 4 digit Oracle version.
    >
    I am trying to use Oracle SQL Developer to connect to Oracle 11g using localhost on my laptop. Oracle is started, I am using the exact same settings as the rest of the students in my class, and my instructor, but it just times out when trying to connect. I have uninstalled and reinstalled Oracle, Java, anything I can think that would be connected. My instructor had me put in his machine's IP address to connect to instead, and that worked. But localhost will not.

    I use SYSTEM as the username (I have also tried SYS), and the password is the one I used when I installed Oracle. Port is default of 1521, hostname of localhost, SID is default of xe.

    I have also tried PostgreSQL, with it's default settings, and the same thing happens.

    The exact error code I am getting is: Status: Failure - Test failed: IO Error: Socket read timed out

    Does anyone know what could be causing this?

    If there is any other information I can provide that may help narrow down the issues, just let me know.
    >
    What OS and version are you using? Is it 32bit or 64 bit?

    What sql developer version are you using? Is it 32 bit or 64 bit?

    What kind of connection are you trying to create? Basic, TNS, other?

    Did you install sql*plus or another Oracle client? Can you connect with that?

    What info is in your 'hosts' file for your pc?
  • 2. Re: Can't connect to Oracle using localhost
    993830 Newbie
    Currently Being Moderated
    Thanks!

    I am running Windows 7 64-bit.
    SQL Developer version 3.2.20.09. I am using the 32-bit version because the 64-bit version couldn't find the java.exe file even when I pointed it right to it.
    I have Oracle 11.2.0
    I am trying to create a basic connection
    I had not tried with sql*plus, but I just tried it and it did let me connect with SYSTEM and my password.

    My host file is full of tons of entries added by spybot, what exactly should I be seeing there? It has 127.0.0.1 for localhost

    Brad
  • 3. Re: Can't connect to Oracle using localhost
    970358 Newbie
    Currently Being Moderated
    Can you try user name as "sys as sysdba" (with out " )

    Regards,
    Thees
  • 4. Re: Can't connect to Oracle using localhost
    993830 Newbie
    Currently Being Moderated
    That did not work either.

    Brad
  • 5. Re: Can't connect to Oracle using localhost
    Jeff Smith SQLDev PM ACE Moderator
    Currently Being Moderated
    Instead of localhost, try 127.0.0.1

    I'm just curious, what happens if you try to ping localhost?
  • 6. Re: Can't connect to Oracle using localhost
    993830 Newbie
    Currently Being Moderated
    I can ping localhost with no issues.

    Using 127.0.0.1 instead of localhost also does not work.

    Brad
  • 7. Re: Can't connect to Oracle using localhost
    Jeff Smith SQLDev PM ACE Moderator
    Currently Being Moderated
    Can you reboot your machine or check your network config?

    Something is up, and it's not SQL Developer.
  • 8. Re: Can't connect to Oracle using localhost
    993830 Newbie
    Currently Being Moderated
    This has been going on for about a month, so the PC has been rebooted many times. Network config looks fine as far as I can tell.

    Yeah it is definitely not SQL Developer, I just can't figure out what's keeping it all from working the way it should.
  • 9. Re: Can't connect to Oracle using localhost
    Gary Graham Expert
    Currently Being Moderated
    Hi Brad,

    It would be interesting to know what changed on your system about a month ago. Not sure if it will help, but here is a very similar thread from the XE forum:
    can't connect to Express Edition 11g by sql developer

    Note the comments about "network configuration error or interference (like antivirus or firewall)", and the suggestion to verify SQL*Plus access:
    What's the command and output from connecting with sqlplus using:
    
    sqlplus user@'hostname:1521/xe'
    
    Try hostname=localhost and hostname=<actual host name>.
    You can use the hostnames command to get the actual hostname. Note that, in the sqlplus call, you probably will need to provide SERVICE_NAME (fully qualified, something like xe.yourcompany.com), rather than just the SID (xe).

    Also, you might want to verify if you really have a need for the hosts file, or if it is bad in someway. There are reasons to map IP addresses to host names in a hosts file, but my Windows 7 hosts file only contains the Microsoft boilerplate comments -- it has no actual mappings. DNS servers know that localhost means 127.0.0.1.

    Regards,
    Gary
    SQL Developer Team

    Edited by: Gary Graham on Mar 5, 2013 10:17 PM
    Changed hostnames to hostname
  • 10. Re: Can't connect to Oracle using localhost
    993830 Newbie
    Currently Being Moderated
    Hi Gary,

    Nothing should have changed a month ago, but that is when we started using SQL in class, so it is when I installed the program and tried to connect for the first time hehe. It never worked.

    I am not trying to use SQL*plus, so I am not sure if the issues will be for the same reason. The only thing I can think of is whether it could have to do with the fact that after a virus I got about 6 months back, my windows firewall isn't able to be turned on OR off. It just tells me "Windows Security Center cannot be started". Could that have anything to do with this? The firewall doesn't appear to be turned on, so as far as I can tell that shouldn't be it, but maybe I'm wrong.

    I do not know whether I really need the hosts file, scans from Spybot S&D seem to be what adds to it.

    Thanks,

    Brad
  • 11. Re: Can't connect to Oracle using localhost
    rp0428 Guru
    Currently Being Moderated
    >
    The only thing I can think of is whether it could have to do with the fact that after a virus I got about 6 months back, my windows firewall isn't able to be turned on OR off. It just tells me "Windows Security Center cannot be started". Could that have anything to do with this?
    >
    Let me see if I understand your question.

    You want to know if the fact that your computer is screwed up and some software that should work doesn't work at all could be the reason that other software doesn't work at all.

    There should be enough information there for you to answer you own question. Why would you even consider continuing to use a system that you know for certain has been corrupted?

    Reimage your machine and start over. You are wasting your time trying to get things to work on such a system and you will never know for sure if they work properly or are doing more damage.
  • 12. Re: Can't connect to Oracle using localhost
    993830 Newbie
    Currently Being Moderated
    My question specifically was whether the firewall being off and not able to be turned back on due to an issue I resolved except for Windows Security Center aspect could explain my problem. If I wasn't in my last semester of grad school, reimaging might be an option, but with the work-load I currently have and the software I have installed that is working just fine and which I need, it isn't a very good suggestion to wipe my entire machine.

    My PC is having no other issues except this, and since it was able to connect to my professors machine, but just won't connect to localhost (as I said in the original post), that points to a specific issue that should be able to be resolved, but which I do not have the answer to. Thus coming here for help.

    Thanks for trying to help rp0428, but my question is aimed at those who are actually trying to help me with the problem.

    Sorry if that seems harsh, but this should be a place for helping those with issues, not suggesting that they are wasting their time.
  • 13. Re: Can't connect to Oracle using localhost
    Gary Graham Expert
    Currently Being Moderated
    Brad,

    I was hoping you would try a couple of the things mentioned above in order to provide a bit more feedback so I could either confirm or dismiss a couple of suspicions. Understand completely about being busy -- I'll bet all who have posted here are (or believe they are) equally busy.

    So...
    1. The link I referenced above never got a final answer.
    2. Probably since the poster reported the hostname command failed on that system due to a MSWSOCK.dll error.
    3. Case closed? Not really. A web search on the MSWSOCK error...
    4. "entry point s_perror could not be located in the dynamic link library MSWSOCK.dll" yields these:
    http://www.orafaq.com/forum/t/184139/0/
    http://www.youneedabudget.com/forum/ynab-f96/hostname-exe-entry-point-not-found-error-t17087.html

    In the first thread, the poster can connect (or not) to Oracle via SQL*Plus when bypassing the listener (or not). My point is that even if you do not use SQL*Plus, we can use it to simulate connecting to the database in the way SQL Developer does. And if your hostname command also fails due to the MSWSOCK error, perhaps you can patch it and have the system working to your complete satisfaction.

    Best Wishes,
    Gary

    Edited by: Gary Graham on Mar 5, 2013 10:16 PM
    Changed hostnames to hostname
  • 14. Re: Can't connect to Oracle using localhost
    rp0428 Guru
    Currently Being Moderated
    We can only advise based on what you post and, based on that, you are wasting your time.
    >
    My question specifically was whether the firewall being off and not able to be turned back on due to an issue I resolved except for Windows Security Center aspect could explain my problem.
    >
    And that is 'specifically' what I responded to. That, and this
    >
    The only thing I can think of is whether it could have to do with the fact that after a virus I got about 6 months back, my windows firewall isn't able to be turned on OR off. It just tells me "Windows Security Center cannot be started". Could that have anything to do with this?
    >
    By definition your machine has a SERIOUS problem when a basic windows component, especially one directly related to the security of your machine and software, does not work properly.

    You CANNOT reliably diagnose the problems like that, let alone fix them without cleansing the machine of bugs and reinstalling the OS. If you think you can you are mistaken.
    >
    If I wasn't in my last semester of grad school, reimaging might be an option, but with the work-load I currently have and the software I have installed that is working just fine and which I need, it isn't a very good suggestion to wipe my entire machine.
    >
    SIX MONTHS! You've known about the problem for at least SIX MONTHS. Unless your semesters are longer than usual you weren't in your last semester when your machine got clobbered.

    Quit making excuses and fix the problem! That's good advice whether you choose to believe it or not. There is not a reputable company I know of that would try to provide support for your use case knowing the history you provided her.
    >
    My PC is having no other issues except this, and since it was able to connect to my professors machine, but just won't connect to localhost (as I said in the original post), that points to a specific issue that should be able to be resolved, but which I do not have the answer to. Thus coming here for help.
    >
    And that means that is is YOU that could be spreading a virus or other problem to your professors machine and then on to ANY other machine that it connects to. That is how viruses spread.

    Before you connnected to your professors machine did you tell your professor that your machine had a virus and that some of your windows OS never worked properly after that?

    Now its my turn to sound harsh.

    You are acting irresponsibly and someone needs to point that out to you before you do more damage to your own machine and especially before you spread your damage to others machines.

    The problem with the virus was RED FLAG #1. The problem you have now where Windows doesn't work AND your connection won't work is RED FLAG #2.

    The fact that you can't easily and quickly recover your OS and software is RED FLAG #3.

    The root cause of your inability to recover your machine is that you have NO BACKUP. You can easily recover the OS on a machine from a simple GHOST backup image or linux 'dd' partition copy. This can be done if less than 10 minutes for a 30 GB partition.

    Time to bite the bullet. Fix the machine by reimaging it. Then take a backup. Then reinstall your software. Then take a backup.

    In this day and age of $30 thumb drives and USB3 there is no excuse for not having a backup of your system.

    That is good advice whether you want to acknowledge it or not.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points