E.1 Net8 Environment Variables

Team-Fly    

 
Oracle Net8 Configuration and Troubleshooting
By Jonathan  Gennick , Hugo Toledo
Table of Contents
Appendix E.  Environment and Registry Variables


Environment variables that you can use to control Net8 activity allow you to do the following:

  • Specify a custom location for Net configuration files (TNS_ADMIN)

  • Specify a default net service name (LOCAL or TWO_TASK)

  • Enable the use of shared sockets under Windows NT (USER_SHARED_SOCKET)

On case-sensitive operating systems such as Linux and Unix, environment variables are case-sensitive. On such systems, the names of Net8- related environment variables are always uppercase.

E.1.1 TNS_ADMIN

On most systems, Net8 configuration files such as tnsnames.ora and sqlnet.ora are stored in the $ORACLE_HOME /network /admin directory. On a few Unix systems, you may find the default directory to be /var/opt/oracle . If you don't like this location, you can customize it using the TNS_ADMIN environment variable. Just set TNS_ADMIN to point to the directory containing your configuration files. For example:

 export TNS_ADMIN=/etc/oracle/net8 

If you're going to set TNS_ADMIN, you need to be sure that it is set for all Oracle users on your system, including database administrators. Once it's set, Net8 components and utilities will look for the Net8 configuration files in the specified directory. Utilities such as the Net8 Assistant that create and edit Net8 configuration files will create those files in the directory pointed to by TNS_ADMIN.

E.1.2 LOCAL

LOCAL can be used on Windows NT systems to set a default net service name. You can make connections to the database by only specifying a username and password. For example:

 C:\>  set local=prod  C:\>  sqlplus system/manager  SQL*Plus: Release 8.1.6.0.0 - Production on Tue Aug 15 23:11:05 2000 (c) Copyright 1999 Oracle Corporation.  All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production With the Partitioning option JServer Release 8.1.6.0.0 - Production SQL> 

With respect to this example, prod must represent a valid net service name. Not only that, but Net8's default domain gets applied to that. If NAMES.DEFAULT_DOMAIN in the sqlnet.ora file is set to gennick.org , then the net service name prod.gennick.org is the one that gets used.

E.1.3 TWO_TASK

On Linux, and many Unix systems, the TWO_TASK environment variable can be used for the same purpose as LOCAL on Windows NTit specifies a default net service name to use when no other is supplied. Here's an example:

 [oracle@donna oracle]$  export TWO_TASK=donna  [oracle@donna oracle  ]$ sqlplus system/manager  SQL*Plus: Release 8.1.6.0.0 - Production on Tue Aug 15 23:15:00 2000 (c) Copyright 1999 Oracle Corporation.  All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production With the Partitioning option JServer Release 8.1.6.0.0 - Production SQL> 

Note that on Unix systems it's common to specify a database by setting an environment variable named ORACLE_SID. The difference between ORACLE_SID and TWO_TASK is that ORACLE_SID specifies a system identifier, while TWO_TASK specifies a net service name.

E.1.4 USE_SHARED_SOCKET

This is a Windows NT-specific environment variable that enables the use of shared sockets for Net8 connections to Windows NT systems. This can be very helpful if you are connecting through a firewall to an Oracle database running on a Windows NT system. Many firewalls don't like the fact that the Net8 listener redirects incoming Net8 connections to a random port number. Security administrators don't like having to open up all the ports for inbound connections. By setting USE_SHARED_SOCKET = TRUE, you can have all inbound connections share the same port that the listener is using. The advantage is that new connections don't get redirected to a random port.

Only dedicated server connections are supported when shared sockets are used. In a mixed Oracle8 i 8.1.x and Oracle8 8.0.x environment, you must set USE_SHARED_SOCKET for both Oracle Homes. If you are making the setting in the registry, be sure to read Section 5.2.2 later in this chapter. Connections to Oracle7 instances are not supported.

The use of shared sockets for Net8 connections is supported from Service Pack 3 onward, but Oracle recommends the use of Service Pack 4. Under Service Pack 3, the use of shared sockets precluded any stopping and starting of the listener while any shared socket connections were active.


Team-Fly    
Top


Oracle Net8 Configuration and Troubleshooting
Oracle Net8 Configuration and Troubleshooting
ISBN: 1565927532
EAN: 2147483647
Year: 2000
Pages: 120

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net