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.

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.

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

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.

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.

>
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.

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.

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.

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.