sql*net v2 user's guide - bull on-line support...

46
SQL*NET V2 User's Guide DPS7000/XTA NOVASCALE 7000 Database Products: ORACLE REFERENCE 47 A2 17UR 00

Upload: lythuan

Post on 09-May-2018

214 views

Category:

Documents


1 download

TRANSCRIPT

SQL*NET V2

User's Guide

DPS

7000/XTA

NO

VASC

ALE

7000

Database Products: ORACLE

REFERENCE47 A2 17UR 00

DPS7000/XTANOVASCALE 7000

SQL*NET V2User's Guide

Database Products: ORACLE

June 1995

BULL CEDOC

357 AVENUE PATTON

B.P.20845

49008 ANGERS CEDEX 01

FRANCE

REFERENCE47 A2 17UR 00

The following copyright notice protects this book under Copyright laws which prohibit such actions as, but notlimited to, copying, distributing, modifying, and making derivative works.

Copyright Bull SAS 1995

Printed in France

Suggestions and criticisms concerning the form, content, and presentation of thisbook are invited. A form is provided at the end of this book for this purpose.

To order additional copies of this book or other Bull Technical Publications, youare invited to use the Ordering Form also provided at the end of this book.

Trademarks and Acknowledgements

We acknowledge the right of proprietors of trademarks mentioned in this book.

Intel® and Itanium® are registered trademarks of Intel Corporation.

Windows® and Microsoft® software are registered trademarks of Microsoft Corporation.

UNIX® is a registered trademark in the United States of America and other countries licensed exclusively throughthe Open Group.

Linux® is a registered trademark of Linus Torvalds.

The information in this document is subject to change without notice. Bull will not be liable for errors containedherein, or for incidental or consequential damages in connection with the use of this material.

47 A2 17UR Rev00 iii

Preface

MANUAL OBJECTIVES

This document provides information on names and locations of SQL *Net V2 files andutilities, configuration on SQL *Net V2, and general description, parameters and connectdescriptors for the TCP/IP Protocol Adapter.

INTENDED READERS

Users of SQL *Net V2.

SQL*Net V2 with GCOS 7 User's Guide

iv 47 A2 17UR Rev00

STRUCTURE OF THIS DOCUMENT

Section 1 introduces the SQL * Net V2 Files and Utilities.

Section2 describes the ORACLE Protocol Adapters.

Section 3 describes the functions of the TNS LISTENER and COR Version 2.

Section 4 describes an example using SQL *Net V2.

An Index follows.

RELATED DOCUMENTS

SQL *Net V2 Administrator's Guide .....................................................86 A2 84CR Rev00Oracle Network Products Error Messages Manual ..............................86 A2 85CR Rev00Understanding SQL *Net .....................................................................86 A2 86CR Rev00

47 A2 17UR Rev00 v

Table of Contents

1. Introduction to SQL*Net V2 Files and Utilitie s ....................................... 1-1

1.1 FILENAMES OF CONFIGURATION FILE S ............................................................... 1-1

1.2 SQL*NET CONFIGURATION TOOL .......................................................................... 1-2

1.3 SQL*NET V2 FILES.................................................................................................... 1-3

1.3.1 TNSNAMES_ORA ...................................................................................................... 1-31.3.1.1 Declaring a dedicated server....................................................................................... 1-3

1.3.2 SQLNET_ORA ............................................................................................................ 1-41.3.3 LISTENER_ORA......................................................................................................... 1-41.3.3.1 Setting your current working directory (#WD) ............................................................. 1-6

1.3.4 Modification of SQL *Net V2 File s ........................................................................... 1-7

1.4 THE TNS LISTENER CONTROL UTILITY: LSNRCT L ............................................. 1-8

1.4.1 LSNRCTL SYNTA X .................................................................................................... 1-81.4.2 LSNRCTL PARAMETER S ......................................................................................... 1-81.4.3 LSNRCTL Execution Note s ...................................................................................... 1-9

1.5 CONFIGURING A CLIENT ......................................................................................... 1-10

1.6 CONFIGURING A SERVER ....................................................................................... 1-11

1.7 SETTING UP DISPATCHERS FOR DIFFERENT PROTOCOLS .............................. 1-12

2. ORACLE Protocol Adapter s ........................................................................... 2-1

SQL*Net V2 with GCOS 7 User's Guide

vi 47 A2 17UR Rev00

2.1 OVERVIEW ................................................................................................................. 2-1

2.2 TCP/IP ADAPTER ....................................................................................................... 2-1

2.2.1 ETC_HOSTS file ........................................................................................................ 2-22.2.2 ETC_SERVICES file ................................................................................................... 2-3

2.3 GXTI CONFIGURATION RULE .................................................................................. 2-4

3. Functions of the TNS LISTENER and COR Version 2 ......................... 3-1

3.1 FUNCTIONS OF THE TNS LISTENER ...................................................................... 3-1

3.2 FUNCTIONS OF THE COR V2................................................................................... 3-2

3.3 FUNCTIONS OF AN SQLNET ADAPTER ................................................................. 3-3

3.3.1 SQLNET_ADAPTER SYNTAX ................................................................................... 3-33.3.2 SQLNET_ADAPTER PARAMETERS ........................................................................ 3-43.3.3 SQLNET_ADAPTER EXECUTION NOTES ............................................................... 3-4

4. Using SQL*Net V2: An Example .................................................................. 4-1

4.1 OVERVIEW ................................................................................................................. 4-1

4.2 CREATING CONFIGURATION FILES ....................................................................... 4-2

4.3 CREATING ETC_HOSTS FILE .................................................................................. 4-3

4.4 CREATING ETC_SERVICES FILE ............................................................................ 4-4

4.5 STARTING THE ORACLE DATABASE ..................................................................... 4-4

4.6 STARTING THE TNS LISTENER ............................................................................... 4-5

4.7 CONNECT TO THE LOCAL SERVER ....................................................................... 4-6

4.8 REMARKS ON THE EXAMPLE ................................................................................. 4-7

Table of Contents

47 A2 17UR Rev00 vii

SQL*Net V2 with GCOS 7 User's Guide

viii 47 A2 17UR Rev00

Table of Contents

47 A2 17UR Rev00 ix

Illustrations

Figures

3-1 TNS Listener running on an ORACLE server ............................................................. 3-1

SQL*Net V2 with GCOS 7 User's Guide

x 47 A2 17UR Rev00

47 A2 17UR Rev00 1-1

1. Introduction to SQL*Net V2 Files andUtilities

1.1 FILENAMES OF CONFIGURATION FILES

In the generic SQL*Net documentation, many references are made to the SQL* Net V2files. On your system, these files are library members and have the following names:

• TNSNAMES.ORA has the filename TNSNAMES_ORA

• SQLNET.ORA has the filename SQLNET_ORA

• LISTENER.ORA has the filename LISTENER_ORA

The files TNSNAV.ORA, TNSNET.ORA, INTCHG.ORA are not used; MultiProtocolInterchange is not available on DPS 7000.

However, in order to avoid WARNING messages from appearing (inside the JOR of theCOR, the SQLNET_ADAPTER or each SQL *Net Client) that these files are missing, werecommend that you create empty TNSNAV_ORA, TNSNET_ORA, and INTCHG_ORAfiles.

SQL*Net V2 with GCOS 7 User's Guide

1-2 47 A2 17UR Rev00

1.2 SQL*NET CONFIGURATION TOOL

The SQL*Net configuration tool used to create the configuration files automatically is notavailable on the DPS 7000.

We recommend using this tool, if possible, on a UNIX system, to create the configurationfiles and transfer them to the DPS 7000. Otherwise, you can create these files using theGCOS 7 editor, but you must follow the rules for clause indentations as shown in theexamples.

See Chapters 5 and 6 of the SQL*Net V2 Administrator's Guide for a detailed descriptionof this tool and how to use it.

Introduction to SQL*Net V2 Files and Utilities

47 A2 17UR Rev00 1-3

1.3 SQL*NET V2 FILES

This section provides a brief description of SQL*Net V2 files, their default names andlocations on your system.

The system-specific information for the basic SQL*Net V2 configuration file is as follows:

1.3.1 TNSNAMES_ORA

This is the basic SQL*Net V2 file, referred to in the SQL*Net V2 documentation asTNSNAMES.ORA. It lists connect descriptors and aliases used to connect to networkapplications. Every client and server on the network must have access to this file.

This file is a library member and it must be located in the source library associated withthe current Working Directory. The name of this library is the current working directory,suffixed by .SL.

1.3.1.1 Declaring a dedicated server

ORACLE 7 provides a multi-threaded server which allows many users to share processesthrough a dispatcher. If you do not want your connection requests to go through adispatcher, you can declare your server a "dedicated server" by adding the following lineto the CONNECT_DATA section of the TNSNAMES_ORA file:

(SERVER=dedicated)

For example, an entry in TNSNAMES_ORA might look something like this:

alias = (DESCRIPTION= (ADDRESS_LIST = (ADDRESS = (PROTOCOL=tcp) (HOST=by63) (PORT=1521) ) ) (CONNECT_DATA= (SID=or16) (SERVER=dedicated) ) )

Refer to Chapter 4 of the SQL*Net V2 Administrator's Guide for more details.

SQL*Net V2 with GCOS 7 User's Guide

1-4 47 A2 17UR Rev00

1.3.2 SQLNET_ORA

This is the master configuration file for logging and tracing the server process and clientapplications on SQL*Net V2. The ORACLE Network Products Error Messages Manualrefers to this file SQLNET.ORA.

This file is a library member. It must be located in the source library associated with thecurrent Working Directory. The name of this library is the current working directory,suffixed by .SL.

TRACE_LEVEL_component:This parameter indicates the level of detail the trace facilityrecords for events. Default is OFF, the number 16 is the moredetailed trace. The syntax for this parameter is:

TRACE_LEVEL_component=OFF|number|ADMIN|USER

TRACE_DIRECTORY_component:This parameter is meaningless for DPS7000. The trace file isplaced in the current Working Directory source library.

TRACE_FILE_component:This parameter establishes the name of the library memberto which trace information is written. Default value is:SQLNET_TRC. The syntax for this parameter is:

TRACE_FILE_component=trace_filename.

LOG_DIRECTORY_component:This parameter is meaningless for DPS 7000. The log file isplaced in the current Working Directory source library.

LOG_FILE _component:This parameter sets the name of the log library member forthe listener. Default is SQLNET_LOG. The syntax for thisparameter is:

LOG_FILE_component=log_filename.

Example SQLNET_ORA file:

AUTOMATIC_IPC=OFFTRACE_LEVEL_CLIENT=OFFTRACE_FILE_CLIENT=CLIENTLOG_FILE_CLIENT=CLIENTTRACE_LEVEL_SERVER=OFFTRACE_FILE_SERVER=SERVERLOG_FILE_SERVER=SERVER

Note : The TRACE_LEVEL_component parameter will be different to OFF only in caseof debbuging.

Refer to Appendix A of the ORACLE Network Products Error Messages Manual for moredetails.

Introduction to SQL*Net V2 Files and Utilities

47 A2 17UR Rev00 1-5

1.3.3 LISTENER_ORA

Before a database server can receive connections from SQL*Net V2 clients, there mustbe a listener active on the server platform. The configuration file for the TNS listener isLISTENER_ORA.

This file includes the name and address of the listeners, a description of the databaseSIDs for which the listener listens, and parameters that influence the listener's behavior.

This file is a library member located in the source library associated with the currentWorking Directory. The name of this library is the current working directory, suffixed by.SL.

Refer to Chapter 4 of the SQL*Net V2 Administrator's Guide for details of how to defineTNS Listener Addresses.

The format of the listener address is:

listener_name = (ADDRESS_LIST = (ADDRESS = (PROTOCOL=tcp) (PORT=1521) (HOST=bc09) ) )

The format of the sids is:

SID_LIST_listener_name = (SID_LIST = (SID_DESC = (SID_NAME=sid) ) )

In this format, SID is the identifier of the database server (instance name as displayedwith the LIST_SVR command. Refer to ORACLE 7 Guide to Processors and Utilities).

ORACLE_HOME is meaningless for DPS 7000.

The parameters and their default are:

TRACE_LEVEL: This parameter indicates the level of detail the trace facilityrecords for events. Default is OFF, the number 16 is the moredetailed trace. The syntax for this parameter is:

TRACE_LEVEL_listener_name=OFF|number.

TRACE_DIRECTORY: This parameter is meaningless for DPS7000. The trace file isplaced in the current Working Directory.

TRACE_FILE: This parameter establishes the name of the file to which traceinformation is written. Default is LISTENER_TRC. Thesyntax for this parameter is:

TRACE_FILE_listener_name=trace_filename

SQL*Net V2 with GCOS 7 User's Guide

1-6 47 A2 17UR Rev00

LOG_DIRECTORY: This parameter is meaningless for DPS 7000. The log file isplaced in the current Working Directory.

LOG_FILE: This parameter sets the name of the log file for the listener.Default is LISTENER_LOG. The syntax for this parameter is:

LOG_FILE_listener_name=log_filename

Example: LISTENER_ORA file:

This file refers to a listener named LISTENER, accessed by TCP/IP protocol using portnumber 1521 on BC09.

This listener is able to manage an ORACLE instance named V7015.

LISTENER = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcp) (HOST = bc09) (PORT = 1521) ) )SID_LIST_LISTENER = (SID_DESC = (SID_DESC = (SID_NAME = V7015) ) )STARTUP_WAIT_TIME_LISTENER = 0CONNECT_TIMEOUT_LISTENER = 10TRACE_LEVEL_LISTENER= OFFTRACE_FILE_LISTENER= LISTENERLOG_FILE_LISTENER= LISTENER

1.3.3.1 Setting your current working directory (#WD)

The MODIFILE_PROFILE (MP) directive is used to set the value of the current workingdirectory (#WD) to the value where the configuration files are placed.

TNSNAMES_ORA LISTENER_ORA

service name= listener= (DESCRIPTION (ADDRESS_LIST= (ADDRESS_LIST= (ADDRESS= (ADDRESS= (PROTOCOL=protocol) (PROTOCOL=protocol (protocol specific information) (protocol specific information) ) ) ) ) SID_LIST_listener= (CONNECT_DATA= (SID_LIST= (SID=sid) (SID_DESC= ) (SID_NAME=sid)) ) )

Introduction to SQL*Net V2 Files and Utilities

47 A2 17UR Rev00 1-7

1.3.4 Modification of SQL *Net V2 Files

Modifications made to TNSNAMES_ORA or SQLNET_ORA files will only be taken intoaccount at the next restart of the client/server process group using it.

That is:

• At the next shutdown/initialization of the COR process group (when it is used toprocess SQL *Net V2 connections - e.g., an SQL *Net V2 connection issued under anORACLE7/TDS application. (Refer to Section 3.2));

• At the next shutdown/initialization of an SQLNET_ADAPTER process group (when it isused to process SQL *NET V2 connections - e.g. an SQL *Net V2 connection issuedunder an ORACLE7/TDS application. (Refer to Section 3.3));

• At the next shutdown/initialization of an ORACLE7 Server process group (whenDATABASE LINKS using SQL *Net V2 are processed by the server. (Refer toSection 3.3)).

SQL*Net V2 with GCOS 7 User's Guide

1-8 47 A2 17UR Rev00

1.4 THE TNS LISTENER CONTROL UTILITY: LSNRCTL

You use the LSNRCTL Utility to manage the TNS listener.

1.4.1 LSNRCTL SYNTAX

LSNRCTL [ ACTION = { HELP } ] [ { SET PASSWORD } ] [ { START } ] [ { STOP } ] [ { STATUS } ] [ { SERVICES } ] [ { RELOAD } ] [ { TRACE } ] [ { VERSION } ] [ PARAMETERS = { listener-alias } ] [ <standard-parameter-set> ]

1.4.2 LSNRCTL PARAMETERS

ACTION: specifies the type of LSNRCTL execution which is to takeplace. Choose one of the options described below:

SET PASSWORD performs administrator-only tasks on the listener. Thepassword should match one listed in the LISTENER_ORAfile. You may enter this command when you start yourLSNRCTL session or any time during your session.

HELP: gives the different commands.

START: starts a TNS listener.

STOP: stops a TNS listener.

STATUS: displays basic information: version, alias, time of start,uptime, what LISTENER_ORA file is used, and whethertracing is turned on.

SERVICES: provides detailed information about the services the listenerlistens for: how many connections have been established,how many refused. It displays two different types of services:dedicated servers from LISTENER_ORA and dispatcherinformation.

VERSION: provides version numbers for the following:

TNS listener executable version numberTNS version numberprotocol adapter version numbers

QUIT: quits the LSNRCTL domain.

Introduction to SQL*Net V2 Files and Utilities

47 A2 17UR Rev00 1-9

TRACE: turns on tracing for the listener. Choices are OFF, USER orADMIN.

RELOAD: shuts down everything except listener addresses and re-readthe LISTENER_ORA file.

PARAMETERS: Except when ACTION='set password', it specifies the listenername. If no listener name is entered, LISTENER is thedefault alias.When ACTION='SET PASSWORD', it specifies the passwordvalue.

Refer to the ORACLE 7 Guide to Processors and Utilities, Section1 for information aboutthe standard parameters.

Refer to the section "Using the Listener Control Utility" of the SQL *Net Administrator'sGuide to have complementary information about the meaning of the LSNRCTLparameters.

1.4.3 LSNRCTL Execution Notes

When the TNS listener is launched (LSNRCTL command), the SQL *Net V2 configurationfiles (LISTENER_ORA, SQLNET_ORA) must be accessible under its #WD.SL library.

Two modes allow you to use the TNS Listener Control Utility LSNRCTL:

• Direct command: LSNRCTL action listener-alias

Examples:

S: lsnrctl start listener_aliasS: lsnrctl status listener_alias

• Indirect command: LSNRCTL

You are on the LSNRCTL processor , prompt LSNRCTL>, you can entered the desiredcommands.

Examples:

S: lsnrctlLSNRCTL> start listener_aliasLSNRCTL> status listener_alias

If no listener name is entered, LISTENER is started by default.

SQL*Net V2 with GCOS 7 User's Guide

1-10 47 A2 17UR Rev00

1.5 CONFIGURING A CLIENT

Clients are applications that access information from servers. This means that evenserver applications are sometimes clients. Perform the procedures outlined in this sectionfor every client, including applications that are normally considered servers, if they haveoccasion to access, through database links, other servers.

1. Define the databases that are available to the client.

The TNSNAMES_ORA file lists the connect descriptors (locations) of all databases andapplication on the network available to the client, the aliases of these locations, and wherethe listener nodes are.

On client machines, the name of this file is TNSNAMES_ORA and is located in a sourcelibrary. The name of this library is the current user Working Directory, suffixed by .SL(#WD in use when the connect request is issued).

2. Set client application log and trace parameters, names of log and trace outputfile.

The SQLNET_ORA file configures logging and tracing of client applications and it islocated in a source library. The name of this library is the current Working Directory,suffixed by .SL (#WD in use when the connect request is issued ).

The trace levels are setting OFF (no trace) by default. For performance reasons, werecommend to set another level only in case of debugging.

On the DPS 7000, there isn't local IPC driver. For this reason you must add the followingparameter to the SQLNET_ORA file:

AUTOMATIC_IPC=OFF Default is ON

If you want your connection requests to go through a dispatcher, take care that thefollowing line is not in the SQLNET_ORA file:

USE_DEDICATED_SERVER=ON Default is OFF

Introduction to SQL*Net V2 Files and Utilities

47 A2 17UR Rev00 1-11

1.6 CONFIGURING A SERVER

1. Set up the TNSNAMES_ORA file.

Located in a source library. The name of this library is the current Working Directory,suffixed by .SL (#WD in use when the server was lauched, working directory displayed bythe LIST_SVR command. Refer to ORACLE 7 Guide to Processors and Utilities).

2. Create the TNS alias file.

The LISTENER_ORA file is the main configuration file for the listener. This must exist in asource library. The name of this library is the current Working Directory, suffixed by .SL(#WD in use when the server was lauched, working directory displayed by the LIST_SVRcommand. Refer to ORACLE 7 Guide to Processors and Utilities). Its function is to list alllistener addresses and set log and trace parameters for the listener.

3. Create the master server trace and log configuration file.

The SQLNET_ORA file configures logging and tracing of the server process and it islocated in a source library. The name of this library is the current Working Directory,suffixed by .SL (#WD.SL in use when the server was launched, working directorydisplayed by the LIST_SVR command. Refer to ORACLE 7 Guide to Processeurs andUtilities).

SQL*Net V2 with GCOS 7 User's Guide

1-12 47 A2 17UR Rev00

1.7 SETTING UP DISPATCHERS FOR DIFFERENT PROTOCOLS

When you select the muti_threaded server with SQL*Net V2, you must set themts_parameters, listed in the "Parameter Files and Initialization Parameters" appendix inthe ORACLE 7 Server Administrator's Guide.

You must change init_ora file, located in the #WD.SL library.

The example below shows how dispatcher handling TCP/IP protocol can be defined.

mts_dispatchers="tcp,1" #run one TCP/IP dispatchermts_service=sid #dispatcher service namemts_servers=1 #min. no. of shared serversmts_max_servers=10 #max. no. of shared serversmts_listener_address="(ADDRESS=(PROTOCOL=tcp)(HOST=host_name)(PORT=port_number))"

To find the correct address to use, look at the address as defined in the LISTENER_ORAfile and ensure that it matches the address in the INIT_ORA file.

Note that the mts_service parameter should have the same value as your SID.

For more information about dispatchers refer to the ORACLE 7 Server Administrator'sGuide.

47 A2 17UR Rev00 2-1

2. ORACLE Protocol Adapters

2.1 OVERVIEW

The GCOS 7 XTI (GCOS 7 X/OPEN Transport interface) specification defines a transportservice interface.

For SQL*Net V2 under GCOS 7, GCOS 7 XTI supplies a unique communication interface:

with local/remote applications through TCP, via FCP 7 on GCOS 7 .

2.2 TCP/IP ADAPTER

TCP/IP is a familly of related protocols that derives its name from two main components:the Transmission Control Protocol (TCP) and the Internet Protocol (IP). The IPcomponent dispatches information around the network, and the TCP component assuresreliable transfer of data from one point to another.

The application or client process initiates its TCP/IP connection with the remote hostprocess by specifying an address pair:

• a host IP address

• a TCP port on the host

Note : For more information on the TCP/IP protocol, refer to the manual that came withyour TCP/IP software.

SQL*Net V2 with GCOS 7 User's Guide

2-2 47 A2 17UR Rev00

The specific TCP/IP adapter connection parameters are part of the ADDRESS keyword-value pair. The three TCP/IP-specific parameters can be entered in any order within theADDRESS construct. The syntax for the TCP/IP adapter connection is:

(ADDRESS= (PROTOCOL=tcp) (HOST=hostname) (PORT=port#))

PROTOCOL specifies the specific adapter to be used. For TCP/IP, thevalue is tcp which can be in uppercase or lowercase.

HOST specifies the host name or the host IP address.

PORT specifies the TCP/IP port number or a service name.

Note: If you specify a service name in the PORT keyword , you must add an entry inthe ETC_SERVICES file located in the SYS.DSACONF library.

Example:

(ADDRESS= (PROTOCOL=tcp) (HOST=bc09) (PORT=tnslsnr))

In SERVICES file you add:

tnslsnr 1521/tcp

2.2.1 ETC_HOSTS file

The hostname will be resolved to an IP address using the ETC_HOSTS file.

This file must be created in the library SYS.DSACONF.

The structure of this file is:

IP Address hostname alias #comments

Example of ETC_HOSTS file:

129.182.131.23 oslo #null 0000A7103A66129.182.131.24 lisboa #null 0000A7103A79129.182.131.25 quito #null 0000A7103A90

Oracle Protocol Adapters

47 A2 17UR Rev00 2-3

2.2.2 ETC_SERVICES file

The service name will be resolved to a PORT number using the ETC_SERVICES file.

This file must be created in the library SYS.DSACONF.

The structure of this file is:

service name port/protocol

Example of ETC_SERVICES file:

# servicestnslsnr 1521/tcporasrv 1525/tcpORACLEor15 1600/tcp

SQL*Net V2 with GCOS 7 User's Guide

2-4 47 A2 17UR Rev00

2.3 GXTI CONFIGURATION RULE

The number of SQL *Net V2 connections simultaneously opened depends on the MAXTEparameter value of the VCAMSCN configuration clause. (Refer to System Installation,Configuration and Updating Guide.)

The following formula evaluates the MAXTE parameter value approximately:

MAXTE > TE ISO + 5xTE TCP + 3xTE UDP + 22

where, TE = Transport Endpoint = 1 connection

47 A2 17UR Rev00 3-1

3. Functions of the TNS LISTENER and CORVersion 2

3.1 FUNCTIONS OF THE TNS LISTENER

• SQL*Net V2 uses the TNS listener on a server to receive incoming connections fromSQL*Net V2 clients.

• The TNS listener spawns a dedicated server process and passes the control of theincoming connection to it, or the address of a shared dispatcher process is provided,and the incoming connection is directed to it.

• At the completion of a connection, the TNS listener continues to listen for additionalincoming connections.

The TNS listener must be run on an ORACLE server to receive incoming connectionsfrom SQL*Net V2 clients.

D edicatedS erver

S haredD ispatcher

TN SListener

Incom ing connection from S Q L*N et V 2 c lient

S paw n a P rocessand C onnect

H andoff to anE x is ting P rocess2

1

Figure 3-1. TNS Listener running on an ORACLE server

SQL*Net V2 with GCOS 7 User's Guide

3-2 47 A2 17UR Rev00

3.2 FUNCTIONS OF THE COR V2

The ORACLE Communication Manager (COR) V2 is a new version.

The COR is required:

• to use an ORACLE database server.

• to start a TNS listener

• to use ORACLE under TDS ( or to use SQL*Net V2 under TDS )

The COR V2 is used to manage the local protocol. This local protocol allows the TNSlistener to communicate with its dedicated server process or with a shared dispatcher.

The COR is used to convert the connect string V1/V2 and correspond with TDS.

The following example show the conversion of a connect string:

connect <username>/<password>@ALIAS1

If a local database named ALIAS1 (that is an instance named ALIAS1 is running on thelocal machine, the protocol SQL*NET V1 (local protocol) is used to connect it.

NOTE: Be careful that the checking of a local running instance is case sensitive:It must be in UPPERCASE letters.

Else, the protocol used is SQL*Net V2, ALIAS1 is a service name associated to a protocoland a remote database as defined in the TNSNAMES_ORA file.

The COR V2 must be run on an ORACLE server to manage incoming connections fromSQL*Net V2 clients.

Functions of the TNS LISTENER and COR Version 2

47 A2 17UR Rev00 3-3

3.3 FUNCTIONS OF AN SQLNET ADAPTER

The preceding paragraph shows that to handle SQL *Net V2 under ORACLE7/TDS, it isnecessary to have a COR running on the local machine.

Regardless of whether the Version is 1 or 2, the connect string issued by ORACLE7/TDSalways is received by the COR (SQL *Net V1 or V2 connect string). If it is an SQL *NetV2 connection, the COR will be in charge of managing this connection throughout theduration. It means that for an SQL *Net V2 connect string, the COR will act as the SQL*Net V2 client, so that TSNAMES_ORA and SQLNET_ORA files must be located in its#WD.SL library (Refer to section1.5), and CPU time will be consumed for each SQL *NetV2 exchange between ORACLE7/TDS and the server.

For an ORACLE7/TDS handling of numerous SQL *Net V2 connections, it may beadvisable (for performance and reliability reasons) to dedicate a process group to thehandling of a specific SQL *Net V2 connection. Otherwise, all the SQL Net V2connections will be continuously handled by the COR process group.

Such a dedicated SQL *Net V2 process group is named an SQLNET_ADAPTER.

An SQLNET_ADAPTER will have the charge to handle SQL *Net V2 connectionsassociated with one (and only this one) given SQL *Net V2 alias.

The handling alias is specified at the SQLNET_ADAPTER launching (ALIAS parameter).For each SQL *Net V2 handled by ORACLE7/TDS applications, a uniqueSQLNET_ADAPTER is launched.

For all the SQL *Net V2 connections handled by an SQLNET_ADAPTER, it will be thisprocess group which will act as the SQL *Net V2. Therefore, the TSNAMES_ORA andSQLNET_ORA files must be located in its #WD.SL library. (Refer to Section 1.5) CPUtime will be consumed for each SQL *Net V2 exchange associated to this alias betweenORACLE7/TDS and the server.

3.3.1 SQLNET_ADAPTER SYNTAX

SQLNET_ADAPTER [ ACTION = { INITIALIZE } ] [ = { I } ] [ = { SHUTDOWN } ] [ = { S } ]

ALIAS = <name-32>

<standard-parameter-set>

SQL*Net V2 with GCOS 7 User's Guide

3-4 47 A2 17UR Rev00

3.3.2 SQLNET_ADAPTER PARAMETERS

ACTION Specifies the type of SQLNET_ADAPTER execution which isto take place.

INITIALIZE Starts a SQLNET_ADAPTER process group.This process group is initialized when the message:

ORACLE adapter <alias> initialized

is displayed.

SHUTDOWN Stops a SQLNET_ADAPTER process group.

S This process group is stopped when the message:

ORACLE adapter <alias> shutdown complete

is displayed.

ALIAS Gives the name of the SQL *Net V2 alias which will behandled by the SQLNET_ADAPTER.This alias must exist in the TNSNAMES_ORA file located inthe #WD.SL library associated to the SQLNET_ADAPTERprocess group.

Refer to the ORACLE7 Guide to Processors and Utilities, Section 1 for information aboutthe standard parameters.

3.3.3 SQLNET_ADAPTER EXECUTION NOTES

Once the SQLNET_ADAPTER has been launched, it appears in the report given by theLIST_SVR command (Refer to the ORACLE7 Guide to Processors and Utilities).

The handling of the SQL *Net V2 alias dedicated to an SQLNET_ADAPTER is casesensitive:It must be specified in UPPERCASE letters in the SQL *Net V2 connection string.

Example:

S: SQLNET_ADAPTER ALIAS=ALIAS2;--> ORACLE adapter ALIAS2 initialized

An ORACLE7/TDS application running anEXEC SQL CONNECT :username IDENTIFIED BY :password

USING :db_string

Statement

a) with username=scott, password=tiger and db_string=ALIAS2will be executed using the SQLNET_ADAPTER

b) with username=scott, password=tiger and db_string=ALIAS2will be executed using the COR

47 A2 17UR Rev00 4-1

4. Using SQL*Net V2: An Example

4.1 OVERVIEW

The target of this chapter is to help you to test SQL*Net V2 product on your site.

In the following example your site is both client and server and the two applicationscommunicate through GXTI/TCP.

The ORACLE code has been installed under the directory named ORACLE.CODE.

An ORACLE database has been created under the ORACLE.DBV7 directory.

For the clients, server and listener, the current working directory (#WD) isORACLE.DBV7.

The name of the TNS listener is MY_LSNR.

The name associated to the IP entry point is my_IP.

Before testing your SQL*Net V2 product, the following operations must be completed:

SQL*Net V2 with GCOS 7 User's Guide

4-2 47 A2 17UR Rev00

4.2 CREATING CONFIGURATION FILES

You must create three SQL*NET V2 Configuration files in the source library associatedwith the current working directory, in your case: ORACLE.DBV7.SL

1. TNSNAMES_ORA file:

my_test = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcp) (HOST = my_IP) (PORT = 1521) ) ) (CONNECT_DATA = (SID = DBV7) ))

2. LISTENER_ORA file:

MY_LSNR = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = my_IP) (PORT = 1521) ) )SID_LIST_MY_LSNR = (SID_LIST = (SID_DESC = (SID_NAME = DBV7) ) )STARTUP_WAIT_TIME_MY_LSNR = 0CONNECT_TIMEOUT_MY_LSNR = 100TRACE_LEVEL_MY_LSNR=OFF

3. SQLNET_ORA file:

AUTOMATIC_IPC=OFFTRACE_LEVEL_CLIENT=OFFTRACE_LEVEL_LISTENER = OFF

Using SQL*Net V2: An Example

47 A2 17UR Rev00 4-3

4.3 CREATING ETC_HOSTS FILE

In the SYS.DSACONF library, you must create the ETC_HOSTS file with the line:

#IP Address hostname comments125.182.200.12 my_IP #IP address of the entry point

4.4 CREATING ETC_SERVICES FILE

In the SYS.DSACONF library, you may create the ETC_SERVICES file with the line:

oraV2 1521/tcp

If this file is created, it will now be possible to replace (in SQL *Net V2 configuration files)a clause like "PORT = 1521" by "PORT = oraV2".

SQL*Net V2 with GCOS 7 User's Guide

4-4 47 A2 17UR Rev00

4.5 STARTING THE ORACLE DATABASE

1. setting the ORACLE environment

S: mp oracle.code;S: mwinlib bin .bin;S: oracle;

2. ensuring that COR is executing

If necessary, start the COR processor:

S: MP ORACLE.DBV7;s: COR I;

3. starting a database server named DBV7

S: mp oracle.dbv7;S: sor w size=4000 instance=DBV7;

4. opening the database

S: sqldba instance=DBV7;SQLDBA> connect internalSQLDBA> startup openSQLDBA> exit

Using SQL*Net V2: An Example

47 A2 17UR Rev00 4-5

4.6 STARTING THE TNS LISTENER

Connected on your DPS 7000 site under userX1:

setting the ORACLE environment:

S: mp oracle.code;S: mwinlib bin. bin;S: oracle;S: mp oracle.dbv7 /* current directory */

to start the TNS listener the user would type:

S: lsnrctl start my_lsnr /* Start the TNS listener named my_lsnr */S: ds ex /* To verify that the LSNRV2 batch job is running */S: lsnrctl status my_lsnr /* To verify the listen address specified in the */ /* listener_ora file */

SQL*Net V2 with GCOS 7 User's Guide

4-6 47 A2 17UR Rev00

4.7 CONNECT TO THE LOCAL SERVER

Connected on your DPS 7000 site under userX2:

setting the ORACLE environment:

S: mp oracle.codeS: mwinlib bin. binS: oracleS: mp oracle.dbv7

to connect to the local TNS listener, named my_lsnr, the user would enter:

S: sqlplus scott/tiger@my_test; ---> connected

To check the status of the listener the user would type:

S: lsnrctlLSNRCTL> status my_lsnr or services my_lsnr

or

S: lsnrctl status my_lsnrS: lsnrctl services my_lsnr

Using SQL*Net V2: An Example

47 A2 17UR Rev00 4-7

4.8 REMARKS ON THE EXAMPLE

Remark 1:

The preceding example shows how to establish an SQL *Net V2 connection from aCLIENT to a SERVER located on the same machine.

For a CLIENT and a SERVER located on different machines, the same procedure is to befollowed.

Indeed the TNS listener will only be mandatory on the receiving machine.

Remark 2:

If only local connections have to be established from the CLIENT to the SERVER, it isbetter to use a local SQL *Net V1 connection than a SQL *Net V2 connection.

Indeed, the best performance is obtained using a local SQL *Net V1 connection. Withlocal SQL *Net V2 connections, more CPU time is consumed because of all the SQL *NetV2 and GXTI software layers being used.

With a configuration like that in the example, local SQL *Net V1 connections will beperformed with a connect string like the following:

S: sqlplus scott/tiger@DBV7 /* cf. paragraph 3.2 */

or

S: sqlplus scott/tiger@D:DBV7

Remark 3:

An ORACLE7/TDS application executing a connection with a database string equal to"my_test" will use the COR process group to solve SQL *Net V2 connections (cf.paragraph 3.2).

In the same way that SQL *Plus works, if only local connections are handled fromORACLE7/TDS, the best performance will be obtained if local SQL *Net V1 connectstrings are used (that is, by the use of a database string as 'D:DBV7" or "DBV7").

SQL*Net V2 with GCOS 7 User's Guide

4-8 47 A2 17UR Rev00

47 A2 17UR Rev00 i-1

Index

C

client, configuring a 1-11configuration files, creating 4-2Configuration Tool 1-2connecting local server 4-6COR V2 3-3COR Version 2 3-1creating configuration files 4-2creating ETC_HOSTS file 4-3creating ETC_SERVICES file 4-3current working directory, setting 1-6

D

dedicated server 1-3directory, setting current working 1-6dispatchers for different protocols, setting up1-13

E

ETC_HOSTS 2-2ETC_HOSTS file, creating 4-3ETC_SERVICES 2-3ETC_SERVICES file, creating 4-3execution notes 3-4

F

Filenames of Configuration Files 1-1

L

LISTENER_ORA 1-5local server 4-6LSNRCTL 1-9

N

notes, execution 3-4

O

ORACLE database 4-4ORACLE Protocol Adapters 2-1

S

server, configuring a 1-12SQLNET_ORA 1-4starting ORACLE database 4-4starting TNS Listener 4-5

T

TCP/IP Adapter 2-1TNS Listener 3-1, 4-5TNSNAMES_ORA 1-3

V

V2 Files 1-3

W

working directory, setting current 1-6

SQL*Net V2 with GCOS 7 User's Guide

i-2 47 A2 17UR Rev00

Technical publication remarks form

Title : DPS7000/XTA NOVASCALE 7000 SQL*NET V2 User's Guide Database Products:ORACLE

Reference Nº : 47 A2 17UR 00 Date : June 1995

ERRORS IN PUBLICATION

SUGGESTIONS FOR IMPROVEMENT TO PUBLICATION

Your comments will be promptly investigated by qualified technical personnel and action will be taken as required.If you require a written reply, please include your complete mailing address below.

NAME : Date :

COMPANY :

ADDRESS :

Please give this technical publication remarks form to your BULL representative or mail to:

Bull - Documentation Dept.

1 Rue de ProvenceBP 20838432 ECHIROLLES [email protected]

Technical publications ordering form

To order additional publications, please fill in a copy of this form and send it via mail to:

BULL CEDOC357 AVENUE PATTONB.P.2084549008 ANGERS CEDEX 01FRANCE

Phone: +33 (0) 2 41 73 72 66FAX: +33 (0) 2 41 73 70 66E-Mail: [email protected]

CEDOC Reference # Designation Qty

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

_ _ _ _ _ _ _ _ _ [ _ _ ]

[ _ _ ] : The latest revision will be provided if no revision number is given.

NAME: Date:

COMPANY:

ADDRESS:

PHONE: FAX:

E-MAIL:

For Bull Subsidiaries:

Identification:

For Bull Affiliated Customers:

Customer Code:

For Bull Internal Customers:

Budgetary Section:

For Others: Please ask your Bull representative.

BULL CEDOC

357 AVENUE PATTON

B.P.20845

49008 ANGERS CEDEX 01

FRANCE

47 A2 17UR 00REFERENCE