1 Reply Latest reply on May 16, 2013 9:48 PM by Gary Graham-Oracle

    Connection via ip fails while 'localhost' works

    1009434
      Hi everybody!
      Its my first post, so please forgive me being a beginner;)

      My aim is to connect from windows 7 64 bit using 'toad for oracle' to my database which is on the virtual machine( win xp 32 bit ) on my computer (The DataBase is on vm and is working well).
      Ok that's seems at least for me a big problem, because after installing oracle database 11g r2 client I still cannot connect.

      I've got message: TNS: no listener.
      So i thought i will connect to my database from vm using not 'localhost' but typing the ip address of my vm.

      I've got: Status:Failure - Test Failed: The network adapter could not establish the connection
      Could you help me guys?
      I would be very grateful.

      P.S.
      Sorry for mistakes.

      Edited by: 1006431 on May 16, 2013 1:10 PM

      Edited by: 1006431 on May 16, 2013 1:11 PM
        • 1. Re: Connection via ip fails while 'localhost' works
          Gary Graham-Oracle
          Hi,

          I cannot speak to any Toad issues (that would be a different forum, of course), but the way SQL Developer connects to an Oracle database running in a VM goes as follows for the VM running under Oracle VirtualBox:

          Case A - you want to use localhost in the SQL Developer connection definition
          1. In the VM guest's network settings, for Attach To select the NAT type.
          2. Next, click the Port Forwarding button and define a rule
          3. Type in a name for the rule, use tcp for the protocol, then map the db's port on the VM (say, guest port 1521) to an unused port on the host (say, host port 1522).
          4. Finally, create the SQL Developer connection as a basic type with host=localhost, port=1522, plus the sid or service for the database on the VM

          Case B - you want to use the VM's ip address in the SQL Developer connection definition
          1. In the VM guests network settings, for Attach To select the Bridged Adapter type.
          2. Next, for the Promiscuous Mode setting, select Allow Any
          3. Find the ip address of the VM
          4. Finally, create the SQL Developer connection as a basic type with host=<vm-ip-address>, port=1521, plus the sid or service for the database on the VM

          Most users prefer Case A. With Case B, if you save the state of the VM then connect your pc / laptop to a different network, the ip address will change and you must update the SQL Developer connection definition. Perhaps these scenarios will be similar for your environment with Toad and whatever VM product you use.

          Cheers,
          Gary