Oracle is an enterprise database server so you shouldnt need any strange setup to get it working, just the correct configuration on the DB server or client will be enough.
When you get connection errors, i suggest first ensuring that the client machine can ping the database server where is the name or ip address - try both as it's possible the name may not be configured in the hosts file of the client machine. (Note that ping may be disabled due to security but if you get a reply back, you know the connection is good.A non reply may not mean the network is missing but you can try to ssh or telnet to the dbhost from the client machine as an alternative)
unix> ping <dbhost>
Once you have confirmed the client machine can see the db server, you can check the configuration on the DB server.
On the DB server, if you connect with the following, you are connecting directly to the database without using TNS.
unix> sqlplus user/pass
If you connect instead with
unix> sqlplus user/pass@ORACLE_SID
where ORACLE_SID is the identifier of the database, you will be using TNS, the same as your client machine. If this doesnt work locally, then it's also not going to work on the remote machine.
Check the listener is running
unix> lsnrctl status
and if it's not, start it as the oracle user
unix> lsnrctl start
and try again to connect using user/pass@ORACLE_SID
If this connects OK, then check your JDBC configuration to ensure you have specified the connection string correctly.
see http://javaeesupportpatterns.blogspot.de/2011/08/network-adapter-could-not-establish.html for assistance with the correct jdbc connection string.
Step by step:
- There is no way to test a dblink other than select a dummy over it
- A network timeout affects only the running transaction that is currently the dblink. There is no recorded state about the dblink, there is no status like ACTIVE or BROKEN. DBLink creation simply instruct the DB about remote host, port, tns, user and password. Hence drop and recreate the dblink does not affect or change the network or ODBC problem. A pratical case is:
select sysdate from dual@dblink
. A firewall is in place between both databases. Source DB opens the connection, retrieve data and leave connection opened. After 15mins the firewall drop the connection. At minute 20 another user performs the same query. The database will reopen the connection.
- The best automatic way should be to query a table; this only if we are experiecing a simple network issue.
Apart from this I understand that you get the connection dropped and you have to way to re-establish it without drop and recreate the database. Metalink (formerly My Oracle Support) suggest to check if HS=OK
is correctly set in the tnsnames.ora. Attention: the HS=OK
argument needs to be outside of the CONNECT_DATA
portion of the entry. Here an example:
MSSQL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = tcp)
(HOST = 192.168.36.18)
(PORT = 1522)
)
)
(CONNECT_DATA =
(SID = MSSQL)
)
(HS=OK)
)
Moreover I suggest you to check (and eventually post) logs on both sides. You can also increase the level of HS_FDS_TRACE_LEVEL
parameter.
In addition MOS reports some issue with DG4ODBC and suggest to debug them (and fill a bug if necessary) using trace on the ODBC layer.
Best Answer
why do you need windows at all? you even do not need sql developer.
/etc/oratab
PS: this assumes that the Oracle version (including fixpack) is exactly the same.