Click to See Complete Forum and Search --> : sql net


Yokenthwate
01-29-2003, 06:54 PM
am using oracle 92 and i'm trying to link my java programs to it. however since i got a cable internet connection my java programs keep throwing oracle errors. ORA-12547: TNS:lost contact or /and ORA-12570: TNS:packet reader failure. However if i physically disconnect the internet (pull it out of the usb) they work fine. Im thinking i have a problem with sql net. (i tried using toad but also came up with similar tns problems). Also looked in the process manager and (an assumption) i don't see a process for sql net. there is one for sql plus though. Any ideas how to fix this problem. If i have to reinstall oracel is there a way i can just install the necessary components instead of the whole bloody thing.

cheers

Jules
:confused:

rotem_fo
02-02-2003, 03:00 AM
Hi,
You need to determine the Oracle Net connection methods.
There are several ways to configure Oracle Network:
1. Host Naming - In order to use host naming, clients must have TCP/IP protocol and Oracle Net installed on their client machines and hostnames are resolved through DNS, NIS or hosts file. This method eliminates the need for the use of the tnsnames.ora file and identifies only one SID per node. On the server side, TCP/IP must be installed and Oracle Net software as well. A listener must be started on port 1521 and the listener.ora file must contain the GLOBAL_DBNAME=<host name> parameter.
2. Local Naming – Local naming provides a simple way of resolving name addresses. Can use different protocols and can easily be configured using the Oracle Net Configuration Assistant.
Both methods update the sqlnet.ora file
3. Local Net Service Names - is used to resolve the name addresses. When working with local net service names, you must specify the database version, name of the host the database reside on, the network protocol, the database server address and port and the database SID name. A name is given to each Name Service. This method updates the tnsnames.ora file, adding a service entry in it.
This method uses both sqlnet.ora and tnsnames.ora files.

in the SQLNET.ORA file, insert this line:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, HOSTNAME)

configure the LISTENER.ORA file:
listener=(address_list=
(address=
(protocol=ipc)
(key=$SID)
)
(address=
(protocol=tcp)
(host=$IP)
(port=1521)
)
)

sid_list_listener=(sid_list=
(sid_desc=
(sid_name=$SID)
(oracle_home=$ORACLE_HOME)
)
)

configure the tnsnames.ora:
MY_CONNECTION =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = $IP)(PORT = 1521))
(CONNECT_DATA =
(SID = $SID)
)
)

replace the $SID,$IP and $ORACLE_HOME to your server's SID,IP & Oracle Home.

Cheers.

slimdave
02-02-2003, 10:10 AM
For the IP address for a local database, you could use ...

LOCAL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = LOCAL)
)
)