Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am attempting to connect to an Oracle 10g server (remote host on LAN) from within a Windows XP VM hosted by VMWare Fusion on OSX. While I can connect to the service using Oracle Net Manager, I can NOT do so using SQL Plus.

What am I missing?

I am currently using NAT mode.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Assume your database is on the node with the hostname "dbhost"

Firstly, can you ping dbhost ? If not, then it is network not Oracle.

If you can, can you telnet to port 1521 on that host. If not, either it is a firewall style issue or there is no Oracle listener running on the remote node (or it is a different port).

Assuming it is running, you want a SID or SERVICE_NAME from the DBA. They are generally the same and, if it is a *nix system, doing a "ps -ef | grep smon" will show you the SID(s) of the running instances. The free Express Edition database normally has the SID of XE

If 1521 is receiving traffic, try

sqlplus user/pass@dbhost:1521/XE

replacing XE with whatever your SID is.

============================================================================ After comment below. I'd suspect a firewall somewhere.

At the database server end, the listener should be listening on port 1521. There are settings in sqlnet (tcp_invited_nodes, I think) that can act as a firewall, telling the listener only to accept connections from whitelisted IP addresses (or exclude ones from blacklisted IPs).

If the listener accepts the connection, it then tries to find the SID or SERVICE that the connection is requesting. If no such service exists it returns an error.

If the service does exist, the listener will attempt to pass the connection to the database, returning a different port through which the connection will actually talk to the database (ie port 1521 is only used during the initial connection). [There's an exception for shared server connections, but they are uncommon.]

Potentially the database may be in a mode where it doesn't accept connections (RESTRICTED mode or in the process of STARTUP or SHUTDOWN). The database also performs authentication (eg checking the username and password).

My guess is that either the listener is rejecting the connection based on some setting or (more likely) that it is failing to pass the new network connection through the NAT. Try using the OSX Instant Client from the host and see if that gets through. The instant client is pretty much and unzip and run, so isn't a big install and doesn't need admin rights or anything.

If the host works and the VM doesn't work, then try Bridged instead of NAT. That means the VM guest gets its own IP address and looks, to the network, like an independent device rather than hiding behind the VM host as it does in NAT.

PS. Made a community wiki as others can contribute

share|improve this answer
    
i can ping the host. i can also telnet to the host on port 23. if i attempt to telnet on 1521, i get a message that reads 'connection closed by foreign host'. the 'official' tnsnames.ora file (given to me by one of the administrators) uses port 1521 for each SID. I've disabled the firewall on the VM and on my workstation. –  Craig Feb 17 '11 at 13:20
    
If you get 'Connection closed by foreign host' then I think Gary has hit on it when he guesses the listener is rejecting the connection or failing to get back through the NAT. Telnet to 1521 should just sit there waiting. –  DCookie Feb 28 '11 at 23:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.