There are several ways to access Oracle databases, and we have chosen to go the route of TNS naming. On every client PC there is a file called TNSNAMES.ORA that looks like this:
This file contains the syntax information for
# the entries to be put in any tnsnames.ora file
# The entries in this file are need based.
# There are no defaults for entries in this file
# that Sqlnet/Net3 use that need to be overridden
#
# Typically you could have two tnsnames.ora files
# in the system, one that is set for the entire system
# and is called the system tnsnames.ora file, and a
# second file that is used by each user locally so that
# he can override the definitions dictated by the system
# tnsnames.ora file.
# The entries in tnsnames.ora are an alternative to using
# the names server with the onames adapter.
# They are a collection of aliases for the addresses that
# the listener(s) is(are) listening for a database or
# several databases.
# The following is the general syntax for any entry in
# a tnsnames.ora file. There could be several such entries
# tailored to the user's needs.
<alias>= [ (DESCRIPTION_LIST = # Optional depending on whether u have
# one or more descriptions
# If there is just one description, unnecessary ]
(DESCRIPTION=
[ (SDU=2048) ] # Optional, defaults to 2048
# Can take values between 512 and 32K
[ (ADDRESS_LIST= # Optional depending on whether u have
# one or more addresses
# If there is just one address, unnecessary ]
(ADDRESS=
[ (COMMUNITY=<community_name>) ]
(PROTOCOL=tcp)
(HOST=<hostname>)
(PORT=<portnumber (1521 is a standard port used)>)
)
[ (ADDRESS=
(PROTOCOL=ipc)
(KEY=<ipckey (PNPKEY is a standard key used)>)
)
]
[ (ADDRESS=
[ (COMMUNITY=<community_name>) ]
(PROTOCOL=decnet)
(NODE=<nodename>)
(OBJECT=<objectname>)
)
]
... # More addresses
[ ) ] # Optional depending on whether ADDRESS_LIST is used or not
[ (CONNECT_DATA=
(SID=<oracle_sid>)
[ (GLOBAL_NAME=<global_database_name>) ]
)
]
[ (SOURCE_ROUTE=yes) ]
)
(DESCRIPTION=
[ (SDU=2048) ] # Optional, defaults to 2048
# Can take values between 512 and 32K
[ (ADDRESS_LIST= ] # Optional depending on whether u have more
# than one address or not
# If there is just one address, unnecessary
(ADDRESS
[ (COMMUNITY=<community_name>) ]
(PROTOCOL=tcp)
(HOST=<hostname>)
(PORT=<portnumber (1521 is a standard port used)>)
)
[ (ADDRESS=
(PROTOCOL=ipc)
(KEY=<ipckey (PNPKEY is a standard key used)>)
)
]
... # More addresses
[ ) ] # Optional depending on whether ADDRESS_LIST
# is being used
[ (CONNECT_DATA=
(SID=<oracle_sid>)
[ (GLOBAL_NAME=<global_database_name>) ]
)
]
[ (SOURCE_ROUTE=yes) ]
)
[ (CONNECT_DATA=
(SID=<oracle_sid>)
[ (GLOBAL_NAME=<global_database_name>) ]
)
]
... # More descriptions
[ ) ] # Optional depending on whether DESCRIPTION_LIST is used or not
in a real application it might look like this:
# TNSNAMES.ORA Network Configuration File: C:\oracle\ora92\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
GTPD.G-T-P.LOCAL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = testserver)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = GTPD)
)
)
in my connect string i simply provide GTPD as the datasource, though differening network configurations require that sometimes GTPD.G-T-P.LOCAL is specified.
Additionally, there is a SQLNET.ORA file that looks like this:
# SQLNET.ORA Network Configuration File: C:\oracle\ora92\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DEFAULT_DOMAIN = G-T-P.LOCAL
SQLNET.AUTHENTICATION_SERVICES= (NONE)
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
it is likely that systems requiring the fully specified name do not have this SQLNET.ORA
In this SQLNET.ORA there is also a specifier of how authentication is handled with the oracle database. We have encountered issues with username/password authentication when
SQLNET.AUTHENTICATION_SERVICES= (NONE) was set to some other value. The sample SQLNET.ORA looks like:
# - Oracle Advanced Security Authentication Adapters ----------------
#sqlnet.authentication_services
#
# Syntax: A single value or a list from {beq, none, all, kerberos5,
# radius, nts}
# Default: NONE
#
# Enables one or more authentication services. If
# Oracle Advanced Security has been installed with Kerberos5
# support, using (beq, kerberos5) would enable authentication via
# Kerberos.
#
#sqlnet.authentication_services=(beq, kerberos5)
for this entry. if you have these auth services enabled, simple username/password may be rejected.
On my system the SQLNET and TNSNAMES are found in
C:\oracle\product\10.2.0\client\network\ADMIN
if you have a different client version installed you may have a different path. however the paths are arranged, they should end in network\ADMIN
I hope this will be enough information for you to investigate your system and possibly switch to using TNS names to test whether there is a problem elsewhere. I have no experience of forming an oracle connection string with anything other than a TNSname, but I will attempt to do so shortly for additional understanding of your problem