Oracle Network Products Getting Started for Windows Platforms | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
A sample file is shown in Figure E-1:
################
# Filename......: tnsnames.ora
# Name..........: LOCAL_REGION.world
# Date..........: 04-DEC-96 13:50:40
################
<service_name>.world = <---world is the domain name
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = <---listener address
(COMMUNITY = TCP.world)
(PROTOCOL = TCP)
(HOST = <server _name>) <---or, use IP address of NT server
(PORT = 1521) <---must match port in LISTENER.ORA file
)
)
(CONNECT_DATA =
(SID = <SID>)) <---database name, default is ORCL
(SOURCE_ROUTE=yes)
)
)
TNSNAMES.ORA is comprised of two parts:
For SQL*Net use, sample CONNECT_DATA contents can look like:
(CONNECT_DATA =
(SID = ORCL)
<Alias>.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = community_name)
(protocol adapter information)
)
)
(CONNECT_DATA =
(SID = SID)
)
)See Table E-1, "Oracle Protocol Adapter Parameters" in this appendix for a description of the keywords.
If you are using Oracle Names, the service name for a database must be exactly the same as the global database name defined by the system administrator. SQL*Net limits the total length of a global database name to 64 characters. Of these, up to eight are the DB_NAME as defined by the database administrator, and the remainder show the service's place in the domain hierarchy (DB_DOMAIN). The name part of the service name can be longer than eight characters only if the DBA changes the name of the database with a RENAME GLOBAL_NAME parameter. The total global database name, or service name, must remain at or below 64 characters.
|
Alternate service names can be assigned to a database service through the TNSNAMES.ORA file. The alternate service names can be names you choose because you find them convenient and easy to remember. For example, if a database is used by two different divisions of a company, Human Resources and Finance, you can map two different service name aliases, hr and finance to the database. The TNSNAMES.ORA file has three separate entries:
|
(ADDRESS =
(COMMUNITY = TCP.world)
(PROTOCOL = TCP)
(HOST = server_name)
(PORT = port_number)
|
GREEN.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP.world)
(PROTOCOL = TCP)
(HOST = GREENWOOD)
(PORT = 1521)
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
(ADDRESS =
(COMMUNITY = SPX.world)
(PROTOCOL = SPX)
(SERVICE = tns_application)
|
GREEN.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = SPX.world)
(PROTOCOL = SPX)
(SERVICE = ORCL_LSNR)
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
(ADDRESS =
(COMMUNITY = NMP.world)
(PROTOCOL = NMP)
(SERVER = server_name)
(PIPE = pipe _name)
GREEN.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = NMP.WORLD)
(PROTOCOL = NMP)
(SERVER = GREENWOOD)
(PIPE = dbpipe0)
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
(ADDRESS =
(COMMUNITY = community_name)
(PROTOCOL = DECNet)
(NODE = DecNet_node_name)
(OBJECT = database_alias)
testdnt.sample =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = desktopdecnet.sample)
(PROTOCOL = DECnet)
(NODE = 19.470)
(OBJECT = ORACLE733)
)
(CONNECT_DATA =
(SID = ORACLE7)
)
)
)
(ADDRESS =
(COMMUNITY = NTB.world)
(PROTOCOL = NTB)
(NTBNAME = ntb_name)
|
GREEN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = NTB.world)
(PROTOCOL = NTB)
(NTBNAME = GREENWOOD)
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL=LU62)
(TPN= tpn_name)
(MODE=ORAPLU62)
(PARTNER_LU_NAME = "partner_lu_name")
(LLU_NAME = local_lu_name)
|
|
mvs.world = (DESCRIPTION =
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL=LU62)
(TPN=RECVTP)
(MODE=ORAPLU62)
(PARTNER_LU_NAME = "ORACLE.TNSORAK")
(LLU = SENDLU)
)
(CONNECT_DATA=(SID=ORCL)
)
)
nt.world = (DESCRIPTION =
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL=LU62)
(TPN=RECVTP)
(MODE=ORAPLU62)
(PARTNER_LU_NAME = "ORACLE.HQEW001")
(LLU = SENDLU)
)
(CONNECT_DATA=(SID=ORCL)
)
)
To contact an Oracle7 server using the LU6.2 protocol, the following parameters are needed:
Parameter | Description |
PLU_LA | |
Logical unit (LU) partner name, LU_NAME | |
Transaction program (TP) name, TP_NAME | |
MODE |
When using the Oracle LU6.2 Protocol Adapter for Windows 3.1x, specify the address of a TNS-based application as follows:
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL = LU62)
(LU_NAME = lu_name)
(TP_NAME = tpn_name)
(MODE = mode_name)When using the NSD.INI file (for NS/WIN), specify the TNS-based application as follows:
If you choose NSD.INI file (for NS/WIN), the TP_NAME, LU_NAME, and MODE are taken from the PLU_LA alias, and your TNSNAMES.ORA entry is simpler:
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL = LU6.2)
(PLU_LA = partner_lu_alias)TP_NAME, LU_NAME, and MODE are specified in the NSD.INI file.
|
(ADDRESS =
(COMMUNITY = beq.world)
(PROTOCOL = BEQ)
(PROGRAM = oracle73)
(ARGV0 = oracle73SID)
(ARGS = `(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')
GREEN.world =
(DESCRIPTION =
(ADDRESS_LIST =
(COMMUNITY = beq.world)
(PROTOCOL = BEQ)
(PROGRAM = oracle73)
(ARGV0 = oracle73SID)
(ARGS = `(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
|
A sample file is shown in Figure E-2
################
# Filename......: sqlnet.ora
# Name..........: TCP.world
# Date..........: 04-DEC-96 13:50:40
################
AUTOMATIC_IPC = OFF <---set this to OFF if you do not wish to use IPC
TRACE_LEVEL_CLIENT = OFF <---set this to 16 if tracing is required
names.directory_path = (TNSNAMES)
names.default_domain = world
name.default_zone = world
Specify this parameter in the Connection Expire Time field of the Client Profile property sheet of Oracle Network Manager for Windows. Enter the time, in minutes, between probes for a dead connection. The range of possible values is from one to a very large number. However, a value of approximately 10 is recommended. If no value is entered in this field, the broken connections remain indefinitely.
Dead connection detection has costs associated with it:
|
|
All errors that occur in SQL*Net are written to log files, while detailed sequences of events as they happen are written to trace files. Trace files provide more information than log files.
You can also manually add the following optional tracing parameters for the TNSPING utility to SQLNET.ORA. TNSPING determines whether or not a service (such as a database, Oracle Names Server, or other TNS services) on a SQL*Net network can be successfully reached.
|
To modify this parameter, use Oracle Network Manager (if SQLNET.ORA was originally configured with it), an editor (such as Notepad), or the SQLNET.ORA Editor.
|
|
###########
# FILENAME: listener.ora
# NAME....: Sever name
# Date..........: 04-DEC-96 13:50:40
###########
LISTENER =
(ADDRESS_LIST =
(ADDRESS=
(PROTOCOL=IPC) <---IPC is the internal protocol
(KEY= service_name) <---automatically added, but necessary
)
(ADDRESS=
(PROTOCOL=IPC)
(KEY =SID)
)
(ADDRESS =
(COMMUNITY = TCP.world)
(PROTOCOL = TCP)
(HOST = host_name) <---or, use the IP address of NT server
(PORT = 1521)
)
)
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = ADMIN
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = SID) <---Database system identifier, default is ORCL
)
)
PASSWORDS_LISTENER = (oracle)
The IPC address format, which is the same across platforms, is as follows:
(ADDRESS=Oracle Network Manager and SQL*Net Easy Configuration create two IPC addresses for each database for which a listener queries. In one, the key value is equal to the service name. This IPC address is used for connections from other applications on the same node. Service names are described in the section "Understanding the TNSNAMES.ORA File" in this appendix. In the other IPC address, the key value is equal to the database SID, which is described in the next section. This IPC address is used by the database dispatcher to identify the listener.
(PROTOCOL=IPC)
(KEY=string)
|
(ADDRESS=
(PROTOCOL= LU62)
(TPN = RECVTP)
(LLU_NAME = "ORACLE.HQEW001")
(MODE = ORAPLU62)
)
SID_LIST_listener_name=
(SID_LIST =
(SID_DESC =
(SID_NAME = SID)
)
)
The SID is the Oracle SID of the database server.
(SID_NAME = db2)
)
)
|
|
SID_LIST_listener_name=
(SID_LIST =
(SID_DESC =
(SID_NAME = ORCL)
(GLOBAL_DBNAME = ORCL.world)
)
USE_PLUG_AND_PLAY_listener_name=ONwhere listener_name is the name of the listener. LISTENER is the name of the default listener.
GLOBAL_DBNAME | Specifies the names of the database instance. It must be globally unique. |
USE_PLUG_AND_PLAY | Instructs the listener to find and register with a well-known Oracle Names Server. |
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |