Connect to Oracle on Virtual PC

130 pts.
Tags:
Oracle
Virtual PC
Hi all, I don’t make it to connect from my Win7 host to Oracle 11g SE running under XP mode. Neither SQL-Plus nor SQL Developer get a connection, although the db is running and locally reachable as tested with SQL-Plus on the guest system. SQL Developer says ”The network Adapter could not establish the connection.” when I click Test connection or Connect. So far I’ve opened port 1521 in the Virtual PC’s windows firewall and also allowed SQL Developer through the firewall of the Win7 host. I’ve set up the network on the guest system and checked that one can browse the internet. What else could it be that blocks the connection to the guest system? Many thanks in advance Matthias

Software/Hardware used:
Oracle SE 11g, Windows XP, Windows 7, SQL Developer

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 21  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    Can you ping the VM ? Have you ran a tnsping to the database ? Have you tried disabling both firewalls (host and guest) completely ?
    69,225 pointsBadges:
    report
  • MatBlume
    Yes within the guest tnsping gets a quick repsonse, but not from the host. I also switched off completely the guest firewall without getting a better connection. I'll try switching off both firewalls.
    130 pointsBadges:
    report
  • carlosdl
    What do you get when tnspinging from the host ?
    69,225 pointsBadges:
    report
  • MatBlume
    While the Guest system says: C:>tnsping orcl TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 - Production on 07-JAN-2010 20:12:03 Copyright (c) 1997, 2007, Oracle. All rights reserved. Used parameter files: C:appXPMUserproduct11.1.0db_1networkadminsqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = VirtualXP-19744) (PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl))) OK (70 msec) The host system complains: C:>tnsping orcl 'tnsping' is not recognized as an internal or external command, operable program or batch file. The instantclient only has: Directory of C:Oracleinstantclient 07.01.2010 20:36 <DIR> . 07.01.2010 20:36 <DIR> .. 29.10.2008 07:09 14'336 adrci.exe 29.10.2008 07:09 4'648 adrci.sym 29.10.2008 07:09 335 BASIC_README 29.10.2008 07:09 47'104 genezi.exe 29.10.2008 07:09 26'272 genezi.sym 12.01.2006 23:36 342 glogin.sql 15.10.2008 07:11 1'470'464 mfc42.dll 15.10.2008 07:11 1'060'864 mfc71.dll 15.10.2008 07:11 348'160 msvcr71.dll 29.10.2008 07:06 659'968 oci.dll 29.10.2008 07:06 426'200 oci.sym 07.10.2008 23:58 132'608 ocijdbc11.dll 07.10.2008 23:58 22'712 ocijdbc11.sym 26.10.2008 13:10 468'480 ociw32.dll 26.10.2008 13:10 73'024 ociw32.sym 31.10.2003 13:00 93'273 ODBCRelnotesJA.htm 24.07.2008 02:11 39'638 ODBCRelnotesUS.htm 04.09.2007 00:52 22'504 ODBC_IC_Readme_Win.html 26.10.2008 12:29 51'712 odbc_install.exe 26.10.2008 12:29 49'664 odbc_uninstall.exe 07.10.2008 23:00 1'890'262 ojdbc5.jar 07.10.2008 23:00 1'988'193 ojdbc6.jar 14.10.2008 23:47 1'527'296 orannzsbb11.dll 14.10.2008 23:47 382'728 orannzsbb11.sym 27.10.2008 13:41 1'330'176 oraocci11.dll 29.10.2008 07:09 421'472 oraocci11.sym 29.10.2008 07:08 126'414'336 oraociei11.dll 29.10.2008 07:08 7'200'336 oraociei11.sym 29.10.2008 07:09 426'496 orasql11.dll 29.10.2008 07:09 35'744 orasql11.sym 02.10.2008 23:24 1'685'504 Orasqlplusic11.dll 02.10.2008 23:24 757'760 sqlplus.exe 29.10.2008 07:10 135'976 sqlplus.sym 29.10.2008 07:10 339 SQLPLUS_README 26.06.2007 22:05 192'149 sqora.chm 25.10.2008 08:05 638'464 sqora32.dll 21.04.2007 00:48 227'459 sqoraja.chm 25.10.2008 08:05 107'008 sqoras32.dll 25.05.2007 00:32 21'504 sqresja.dll 25.10.2008 08:05 22'016 sqresus.dll 07.01.2010 12:29 342 tnsnames.ora 29.10.2008 07:09 <DIR> vc71 07.01.2010 10:53 <DIR> vc8 41 File(s) 150'417'868 bytes
    130 pointsBadges:
    report
  • MatBlume
    Already the plain ping is without response: C:Oracleinstantclient>ping VirtualXP-19744 Ping request could not find host VirtualXP-19744. Please check the name and try again. So I ran the internet connection wizard from within IE, but without success. Still no conncetion and no ping answer.
    130 pointsBadges:
    report
  • carlosdl
    I see you are using Instant Client. Instant client doesn't include the tnsping utility. Have you defined the TNS_ADMIN environment variable ?
    69,225 pointsBadges:
    report
  • MatBlume
    Yes the TNS_ADMIN environment variable is set to C:Oracleinstantclient where the client resides. The problem seems to be with the simple network connection between hist and guest. (no ping answer)
    130 pointsBadges:
    report
  • carlosdl
    Well, if you can't ping the guest, then let's forget about oracle for a while. How did you configure the network for the virtual machine (in the virtual pc settings window) ? Have you tried using the guest's ip-address instead of the name ?
    69,225 pointsBadges:
    report
  • MatBlume
    The guest has at least an ip address. But pinging it gives me Pinging 169.254.0.16 with 32 bytes of data: Reply from 192.168.1.20: Destination host unreachable. In the virtual pc network settings I put Adapter 1 to 'Internal Network', which had been the 'Intel .... Gigabit Connection' before. But I prefer having the VM hidding to others and the laptop has only WLAN active at the moment.
    130 pointsBadges:
    report
  • MatBlume
    When putting the virtual pc network settings for Adapter 1 to NAT the pings in both directions to and from the VM get a time out but at least the VM sees the internet.
    130 pointsBadges:
    report
  • carlosdl
    Sorry for the delay. That is the expected behavior. 'Internal Network' provides networking between the VMs, but isolate them from the external network and from the host. 'NAT' allows the VM to use some networking services from the host (such as internet access) but I believe it does not allow networking between the host and the guest, so if you want to access your database server on the guest, from the host, you will have to configure the VM to use the physical network adapter. You can use the firewall and file system security to retrict access to the VM if that's the reason why you didn't want to use bridged mode.
    69,225 pointsBadges:
    report
  • MatBlume
    Thanks Carlos for your continued help. Now when using the active WLAN Adapter in the VM configuration. The pings get answered in both directions -- Normal you will say ;-) but big progress for me. Then I try to connect from SQL Developer to Oracle on the VM using the VM's ip address as hostname. But still: Network adapter could not connect. A thought: could it be due to the fact that Oracle on the VM is 32 bit whereas SQL Developer is 64 bit?
    130 pointsBadges:
    report
  • carlosdl
    Sql Developer should work even without the instant client. Are you using the 'Basic' tab when setting your connection in Sql Developer ?
    69,225 pointsBadges:
    report
  • MatBlume
    Yes I'm using the <Basic> Connection Type in SQL Developer. The <TNS> Connection Type also gives me a connection error, probably because I didn't register the VM's name as a network host.
    130 pointsBadges:
    report
  • carlosdl
    Are you sure the SID or service name you are using is correct ? Compare it to the one specified in the tnsnames.ora file of the VM where you can successfully connect from. Also, can you telnet to port 1521 of your VM, from the host ?
    69,225 pointsBadges:
    report
  • MatBlume
    The SID name (default: orcl) is correct. But the telnet connection fails: Microsoft Telnet> open 192.168.1.21 1521 Connecting To 192.168.1.21...Could not open connection to the host, on port 1521 : Connect failed This remains the case when both firewalls are turned off.
    130 pointsBadges:
    report
  • carlosdl
    Are you sure the database is up ? If you can ping the machine, and no firewall is turned on, and the database is up, but you can't telnet to port 1521, then I can only think of 2 possibilities: -The listener is not running. -The listener is configured to listen on a port different than 1521. Uste the LSNRCTL tool to check the listener status, and check the port configured in your listener.ora file.
    69,225 pointsBadges:
    report
  • MatBlume
    Thanks for your help again. Sorry, I had not understood that telnetting on port 1521 will try to talk to Oracle, which I could have guessed of course. And yes the db was not running, since I start the services only manually with a script, when I need them. After having started them C:>net start These Windows services are started: ... ... OracleOraDb11g_home1TNSListener OracleServiceORCL and C:>LSNRCTL LSNRCTL for 32-bit Windows: Version 11.1.0.6.0 - Production on 13-JAN-2010 20:39:40 Copyright (c) 1991, 2007, Oracle. All rights reserved. Welcome to LSNRCTL, type "help" for information. ... and when trying a telnet connection to the VM on port 1521 it doesn't come back right away with an error message as it did before but says only after quite a few seconds of Connecting To 192.168.1.21... Press any key to continue... followed by Connection to host lost. I take that for a postive sign, that 2 programs actively try talking to each other, but don't make it. But there is at least connection. Does that help for the diagnosis?
    130 pointsBadges:
    report
  • carlosdl
    Once in LSNRCTL, type:
    status
    and post the results. If possible, post the contents of your listener.ora file as well.
    69,225 pointsBadges:
    report
  • MatBlume
    C:>LSNRCTL LSNRCTL for 32-bit Windows: Version 11.1.0.6.0 - Production on 14-JAN-2010 19:17:35 Copyright (c) 1991, 2007, Oracle. All rights reserved. Welcome to LSNRCTL, type "help" for information. LSNRCTL> status Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for 32-bit Windows: Version 11.1.0.6.0 - Production Start Date 14-JAN-2010 17:58:41 Uptime 0 days 1 hr. 18 min. 58 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File C:appXPMUserproduct11.1.0db_1networkadminlistener.ora Listener Log File c:appxpmuserdiagtnslsnrVirtualXP-19744listeneralertlog.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.pipeEXTPROC1521ipc))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=VirtualXP-19744)(PORT=1521))) Services Summary... Service "orcl" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Service "orclXDB" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Service "orcl_XPT" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... The command completed successfully = = = = = = = = = = = = These are the cofig files: # listener.ora Network Configuration File: C:appXPMUserproduct11.1.0db_1networkadminlistener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = VirtualXP-19744)(PORT = 1521)) ) ) # tnsnames.ora Network Configuration File: C:appXPMUserproduct11.1.0db_1networkadmintnsnames.ora # Generated by Oracle configuration tools. ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = VirtualXP-19744)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
    130 pointsBadges:
    report
  • carlosdl
    Well, everything seems to be fine. The client should be able to connect. At this point, I can only think of a networking problem between the host and the guest.
    69,225 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following