Chapter 5: Configuration Parameters

This chapter explains VERSANT configuration parameters and how to use them to tell VERSANT where software and databases are located.

 

Configuration Parameters Overview

Configuration parameters enable VERSANT to:

•    Find software files and databases as needed.

•    Know where you want to create or remove a particular database.

•    Modify or list information about all databases in a particular system of distributed databases.

You May Not Need This Chapter

When you installed VERSANT, all configuration parameters needed by VERSANT were stored in such a way that VERSANT can find them.

After installation, you only need to append the location of VERSANT executables to your existing PATH environment variable. (On personal computers, the installation program will do this for you.)

This means that you do not normally need any of the information in this chapter.

You must explicitly specify or change configuration parameters only in the following situations:

•    If you did not answer all prompts during installation or if you made a mistake.

•    If you want to move software or databases.

As your hardware changes, you might want to move VERSANT software and/or databases. After you move a database or VERSANT software, you need to tell VERSANT the new locations.

•    If you want to create multiple, distinct database systems.

If you are embedding VERSANT in another application, you might want to create multiple, distinct database systems so that your application need not know about any other VERSANT databases on the network except those related to its purposes. To do this, you must be sure that data will never be shared among the different systems of databases.

•    If you want to create multiple sets of databases within the same database system.

You might want to create multiple sets of databases managed by the same machine, but branching from different database root directories. This might let you group certain types of databases on different storage devices and would allow you to let certain users "see" only the databases relevant to their tasks.

•    If you want to install and selectively use multiple VERSANT releases on the same machine.

In a development environment, you might want to install multiple VERSANT releases on the same machine and then shift among the releases to confirm the compatibility of various applications and databases.

•    If you want to use VERSANT software located on a remote machine.

You might want to develop an application using a local installation of VERSANT and later run it using a remote installation of VERSANT in order to take advantage of a faster machine.

You can also use mechanisms other than configuration parameters to customize your environment. For example, you can set application and database operating parameters by editing your application and server process profile files. For information on operating parameters, see the chapter "Database Profiles."

 

Configuration Parameters for UNIX

On UNIX systems, VERSANT does not depend on environment variables, although they optionally can be used to define the VERSANT environment.

A normal installation of VERSANT creates two configuration files, one in the machine configuration file, .oscxxyyzz, and one in the system information file, sysinfo. The combination of these two files after installation completely defines the VERSANT environment. The only additional environmental change made during installation is to place the /bin directory on your path.

When specifying locations in VERSANT parameters, you can use NFS mountings.

Besides these VERSANT parameters, you should also add the VERSANT executables directory to your machine's existing PATH environment variable.

 

UNIX Configuration Parameters Location

On UNIX installations you can set configuration parameters in the following places:

Environment variables

On a per process basis, you can specify paths with environment variables. Both client and server processes will look for environment variables.

User configuration file

On a per user basis, you can specify paths by creating a user configuration file. Only client processes will look for a user configuration file.

Machine configuration file

On a per machine basis, you can use or modify the machine configuration file created by VERSANT during installation. Both client and server processes will look for a machine configuration file.

System information file

On a per installation basis, you can use or modify the system information file created by VERSANT during installation. Both client and server processes will look for a system information file.

When you install VERSANT on a UNIX machine, all configuration parameters needed by VERSANT are recorded either in a machine configuration file in your /etc directory or in a system information file in your VERSANT lib directory. The contents of these files depend upon how you installed.

You can install VERSANT on a machine in two different ways:

Use files on local machine — You can install VERSANT so that it uses local VERSANT files by invoking the installation program with the command oinstall.

Use files on remote machine — You can install VERSANT so that one machine uses VERSANT files on another machine by invoking the installation program with the command oinstall -f.

Either way that you install, VERSANT will create two configuration files:

Machine configuration file

The directory and name of the machine configuration file is:

    /etc/.oscxxyyzz

Where:

xx is the major release number

yy is the maintenance release number

zz is the minor release number

For example, for Release 5.0.4, the machine configuration file is:

    /etc/.osc050004

System information file

The directory and name of the system information file is sysinfo and branches from your lib directory:

    /root/release/platform/lib/sysinfo

The contents of the machine and system information files will vary depending upon the type of installation you perform:

                 contents if oinstall   contents if oinstall -f
file             (local installation)   (files on remote machine)
------------------------------------------------------------------
.oscxxyyzz       software root dir      software root dir
                 database root dir      database root dir
                                        osc-dbid machine
                                        osc-dbid directory
sysinfo          osc-dbid machine        *
                 osc-dbid directory

*  Installing on a local machine with oinstall will create a local sysinfo file with osc-dbid information. If you then install from that machine onto a remote machine using oinstall -f, the remote machine will use the sysinfo file on the local machine and will not create another sysinfo file.

See the chapter "Directories and Files" for more information on the location and nature of the machine configuration and system information files.

 

UNIX Configuration Parameter Considerations

There are two considerations in choosing where to set parameters: the order in which VERSANT searches and the precedence of passed parameters.

Search order

To find the information it needs on each UNIX node, VERSANT searches environmental variables and information files in a predetermined, hierarchial order. If conflicting information is found in the search, the order of the search resolves the conflict: the first value found is the value that is used.

To get needed information on a UNIX node, VERSANT searches in the following order:

1.  Environment variables — per process

2.  User configuration file — per user

3.  Machine configuration file — per machine

4.  System information file — per installation

Because VERSANT searches in a hierarchial order, you can supply most information on a per process, per user, per machine, or per installation basis.

For example, if you normally create and use local databases in the directory /usr/local/versant/db, then you can define the following in your machine configuration file (which is the default location):

VERSANT_DB /usr/local/versant/db

Then, if you have an application that embeds VERSANT and works solely with drawings stored in databases in the directory /myapplication/db, before starting VERSANT you can define the following environment variable to override the setting in the machine configuration file:

VERSANT_DB /myapplication/db

On personal computer nodes, VERSANT makes a similar search, although the details differ. (See the section "Configuration Parameters for Personal Computers.")

Passing parameters to remote machines

To specify a command or configuration parameter on a remote machine, you can use @node syntax. For example, to create a database on a remote machine named server, you would use the following @node syntax:

createdb db1@server

Or, to look for an osc-dbid file on a remote machine:

VERSANT_DBID_NODE@server

If you use @node syntax, all parameters are sent to the server on node (local or remote).

If you do not use @node syntax, all parameters, except for versant_root and versant_rel, are sent to the local server. This means that to send versant_root or versant_rel to the local server, you must use @node syntax.

Configuration parameters explicitly passed to a remote machine override those already set on the remote machine. You should pass parameters only in the usual circumstance that you want to override the values set on the remote machine.

For example, suppose the UNIX machine server has the following environment parameter set:

VERSANT_DB /usr/local/versant/db

To create a database on server in a different directory, you could set the following:

VERSANT_DB@server /db

Then, if you invoke the create database utility as createdb@server, the value of your environment parameter VERSANT_DB@server will be passed to the machine named server and the database will be created in a directory branching from /db rather than /usr/local/versant/db.

You can use @node syntax for any parameter and set any parameter for remote use in either a configuration file or in an environment variable.

If you doubly define a parameter for the local machine by defining it both with and without @node syntax, VERSANT will look first for a value in the parameter without @node syntax and then look for it with @node syntax. The first value found will be the value used.

For example, if you are on machine alpha and have defined both VERSANT_DB and VERSANT_DB@alpha, then VERSANT will use the value in VERSANT_DB. However, if you have not defined VERSANT_DB, then VERSANT will use the value in VERSANT_DB@alpha.

In any case, you must, of course, specify parameters to be passed in the syntax appropriate to the remote machine. For example:

VERSANT_DB@unix_server /usr/local/versant/db
VERSANT_DB@nt_server \versant\db

 

UNIX Configuration Parameter Procedures

Environment variable

To set a configuration parameter in an environment variable, use the name of the environment parameter followed by its value.

For example, suppose you want to set the local database root directory for Release 5.0.7 on Sun 4 to be the default location:

VERSANT_DB /usr/local/versant/5.0.7/sun4/db

If you use C Shell, to set VERSANT_DB in your .login file in your home directory:

setenv VERSANT_DB /usr/local/versant/5.0.7/sun4/db

If you use Bourne shell, to set VERSANT_DB in the .profile file in your home directory:

VERSANT_DB = /usr/local/versant/5.0.7/sun4/db

export VERSANT_DB

User configuration file

You can specify the locations of the software and database directories in a user configuration file that you create.

The format for lines in the user configuration file is the name of the environment parameter followed by the value.

After creating the user configuration file, use the following environment variable to tell VERSANT about the file:

VERSANT_CFG

The name and location of the user configuration file containing specifications for software and database root directories.

For example, if you have created a user configuration file name myconfig.txt in /usr/local/versant, to set the local database root directory for Release 5.0.7 on Sun 4 to be the default location, create the following line:

VERSANT_DB /usr/local/versant/5.0.7/sun4/db

Then, to set VERSANT_CFG to the location of your configuration file, if you use C Shell:

setenv VERSANT_CFG /usr/local/versant/myconfig.txt

If you use Bourne shell:

VERSANT_CFG = /usr/local/versant/myconfig.txt

export VERSANT_CFG

Machine configuration file

In the VERSANT machine configuration file /etc/.oscxxyyzz, you can create or modify a line for an environment parameter.

The format for lines in the machine configuration file is the name of the environment parameter followed by the value.

For example, to set the local database root directory for Release 3.0.8 on Sun 4 to be the default location, create or modify the following line in /etc/.osc030008:

VERSANT_DB /usr/local/versant/3.0.8/sun4/db

You can make comments in the .oscxxyyzz file on any line in which either the first column is marked with the # sign or after a # sign on a line containing an entry.

For example, for release 3.0.8, local machine mymachine, software root path /usr/local/versant, and database root path /db, the contents of /etc/.osc030008 could be:

# the following line specifies software root
VERSANT_ROOT   /usr/local/versant
VERSANT_DB   /db   #this line is the database root

System information file

In the VERSANT system information file sysinfo in your lib directory, you can create or modify a line for an environment parameter.

To set an environment parameter in the VERSANT sysinfo file, use the name of the environment parameter followed by its value.

For example, to set the local database root directory for Release 3.0.8 on Sun 4 to be the default location, create or modify the following line:

VERSANT_DB /usr/local/versant/3.0.8/sun4/db

Since VERSANT needs to know its software directory in order to find the sysinfo file in the first place, you should not record the location of VERSANT_ROOT in the sysinfo file.

You can make comments in the sysinfo file on any line in which either the first column is marked with the # sign or after a # sign on a line containing an entry.

 

UNIX Environment Parameter That You Need to Set

When you install VERSANT, all configuration parameters needed by VERSANT are recorded in either in the machine configuration file /etc/.oscxxyyzz or in the system information file lib/sysinfo.

After installation, the only thing that you should do is add the VERSANT executables directory to your machine's existing environment variable PATH.

See also the chapter "Directories and Files" for an explanation of VERSANT file structures.

 

PATH

Executables directory. Always needed.

After installation, append the location of the VERSANT executables directory bin to your PATH environment variable. This will enable VERSANT to find the executables regardless of your current directory.

For a standard installation, the VERSANT executables directory will be named /bin and be located below the platform directory. For example, for Release 3.0.8 on Sun 4:

/usr/local/versant/3.0.8/sun4/bin

If you use C Shell, the search path should be in the .login file in your home directory. To amend it to include the VERSANT /bin directory, use the set path command.

For example, for a default installation for Sun:

set path = (/usr/local/versant/3.0.0/sun4/bin $path)

If you use Bourne shell, the search path should be in the .profile file in your home directory.

For example, to amend it to include the VERSANT /bin directory for a default installation for Sun:

PATH=/usr/local/versant/3.0.8/sun4/bin:${PATH}

export PATH

 

UNIX Configuration Parameters That Must Be Set Somewhere

The following configuration parameters are necessary for VERSANT to run in a standard environment.

You must explicitly set them only in the following situations:

•    If you did not answer all prompts during installation.

•    If you made a mistake during installation.

•    If you have moved your software, database directory, or database system identifier file.

•    If you have created a user configuration file.

 

VERSANT_ROOT

The software root directory. Mandatory.

This parameter enables VERSANT to find its own files, because they are placed in predetermined places in directories built from the software root directory. On UNIX installations, the default value of VERSANT_ROOT is /usr/local/versant.

You may set the parameter VERSANT_ROOT in any of the following places:

VERSANT_ROOT

In the environment variable VERSANT_ROOT.

user.cfg

In a user configuration file, if you also set VERSANT_CFG.

/etc/.oscxxyyzz

In the machine configuration file, which is the default location.

 
You cannot set VERSANT_ROOT in the system information file.

For example, if you use C Shell and set VERSANT_ROOT in your .login file in your home directory:

setenv VERSANT_ROOT /usr/local/versant

For example, if you use Bourne shell and set VERSANT_ROOT in the .profile file in your home directory:

VERSANT_ROOT=/usr/local/versant
export VERSANT_ROOT

Default and non-default directory structures

By default, the basic structure of VERSANT directories is:

<VERSANT_ROOT>

|

<release number>

|

<platform>

|

--subdirectories--

 
However, if VERSANT cannot find its own files under a platform directory, it will look under VERSANT_ROOT:

<VERSANT_ROOT>

|

--subdirectories--

 
For example, the default structure for VERSANT release 5.2.1 on Sun is:

<VERSANT_ROOT>

|

5.2.1

|

sun4

|

+-----------------------------+

| | | | |

bin lib h demo install

 
But, if needed files are not found, VERSANT will look for the following structure:

<VERSANT_ROOT>

|

+-----------------------------+

| | | | |

bin lib h demo install

 
Client-only, runtime installations need only the error message file under VERSANT_ROOT. If you have static linkage for the executables, the rest of the VERSANT installation tree does not have to be present.

You can see the location of your VERSANT installation by typing:

oscp –p

 

VERSANT_DBID_NODE

The machine containing the osc-dbid database system file. Mandatory.

This parameter is necessary if you want to create, remove, or list databases. There is no default location for the database system file.

If your machine is not connected to a network, you can specify this parameter with a null value to indicate that the osc-dbid file is on the local machine.

If your machine is connected to a network but will use a local database system file, you should supply the network name of your machine as known to your TCP/IP installation.

If your machine is connected to a network and will use a remote database system file, you should supply the network name of the remote machine as known to your TCP/IP installation.

You may set the parameter VERSANT_DBID_NODE in any of the following places:

VERSANT_DBID_NODE

In the environment variable VERSANT_DBID_NODE.

user.cfg

In a user configuration file, if you also set VERSANT_CFG.

/etc/.oscxxyyzz

In the machine configuration file, which is the default location.

sysinfo

In the sysinfo file in the lib directory.

For example, if you use C Shell and set VERSANT_DBID_NODE in your .login file in your home directory:

setenv VERSANT_DBID_NODE myserver

For example, if you use Bourne shell and set VERSANT_DBID_NODE in the .profile file in your home directory:

VERSANT_DBID_NODE = myserver
export VERSANT_DBID_NODE

 

VERSANT_DBID

The local or remote directory containing the osc-dbid database system file. Mandatory.

This parameter is necessary if you want to create, remove, or list databases. There is no default location for the database system file.

Remote directories must be specified in terms understandable to the operating system on the remote machine. This means that for personal computers you should specify directories with drive:\directory syntax and for UNIX computers you should specify directories with /directory syntax.

You may set the parameter VERSANT_DBID in any of the following places:

VERSANT_DBID

In the environment variable VERSANT_DBID.

user.cfg

In a user configuration file, if you also set VERSANT_CFG.

/etc/.oscxxyyzz

In the machine configuration file, which is the default location.

sysinfo

In the sysinfo file in the lib directory.

 

VERSANT_DB

The database root directory. Mandatory.

This parameter is necessary if you want to access, create, or remove a database on your local machine. New databases are placed in a directory branching from the database root directory.

You may set the parameter VERSANT_DB in any of the following places:

VERSANT_DB

In the environment variable VERSANT_DB.

user.cfg

In a user configuration file, if you also set VERSANT_CFG.

/etc/.oscxxyyzz

In the machine configuration file, which is the default location.

sysinfo

In the sysinfo file in the lib directory.

 

VERSANT_CFG

Location of user configuration file. Needed if you create a user configuration file.

This parameter is needed only if you create and use a user configuration file to set other configuration parameters on a per user basis.

The format for lines in a user configuration file is the name of the environment parameter followed by the value.

You must set the environment parameter VERSANT_CFG in the environment variable VERSANT_CFG.

 

UNIX Configuration Parameters for Asserting Values

Following is a reference to configuration parameters needed only in a complex environment.

 

VERSANT_REL

 

VERSANT_REL@node

VERSANT release number. Normally not needed.

VERSANT allows you to assert a release number by setting the environment variable VERSANT_REL for a local machine or VERSANT_REL@node for a remote machine named node.

•    You must assert a release number if your application was compiled with one VERSANT Release and you want to access a database of another Release.

•    You may want to assert a release number if you have multiple VERSANT Releases on the same machine.

Asserting a release number causes VERSANT to use the configuration specified in the .oscxxyyzz machine configuration file that corresponds to the release number asserted.

Asserting a release number does not alter the normal order in which VERSANT searches for its configuration. If a configuration has been specified in environment variables or in a user configuration file, then asserting a release number will have no effect.

Except in the case when Release 2 applications are accessing Release 3 databases, the ability to assert release numbers is provided as a convenience. For example, when interacting with a remote machine, you may not know what values to assert for VERSANT_ROOT@node, VERSANT_DB@node, VERSANT_DBID_NODE@node, and VERSANT_DBID@node in order to completely specify the remote configuration you want to use. In such a case, it is simpler just to assert a release number with VERSANT_REL@node and then let the remote machine determine the correct configuration to use.

Background

A "complete" installation of VERSANT involves:

1.  Copying VERSANT software to a machine, which is normally done for you by the installation program.

2.  Setting at least the following configuration parameters: VERSANT_ROOT, which specifies the software root directory, VERSANT_DBID_NODE, which specifies the machine containing the osc-dbid file, VERSANT_DBID, which specifies the directory containing the osc-dbid file, and VERSANT_DB, which specifies the database root directory.

Unless you install manually, the installation program will set these parameters for you in the machine configuration file /etc/.oscxxyyzz and system information file /lib/sysinfo. After installation, the combination of these two files completely defines the VERSANT configuration. The only additional environment change made during installation is to place the /bin directory on your path.

The ability to use a release number to assert a configuration depends upon the creation of the machine configuration file that contains the release number as part of its name.

3.  Altering the TCP/IP configuration files to point to the server connection program in the VERSANT /bin directory for the release being installed.

After installing VERSANT, you must modify the TCP/IP configuration files manually. Normally you will update the /etc/services and /etc/inetd.conf files to point to the server connection program ss.d in the ../bin directory of the new release. Doing this does not prevent you from using a previous installation of a VERSANT Release.

4.  Converting any existing databases to be compatible with the installed release.

To be accessed by a particular version of VERSANT, a database must be converted to the same release as the server process that accesses it. After installing VERSANT, to use existing databases with the new release, you must manually convert existing databases with the convertdb utility provided in the new release.

If you want to first confirm the compatibility of various applications and databases, you may not want to perform this step right away, which creates the need to be able to assert a particular installation.

5.  Deleting any previous installations of VERSANT software (but not the existing databases).

This must be done manually, although you should not delete the previous installation if you do not convert all existing databases to the new release.

Once you have installed the new version of VERSANT, when a application client process requests a database connection, the following happens:

1.  The connection request is sent to the TCP/IP inetd daemon on the machine on which the database resides, which fowards the request to the server connection program specified in its configuration files.

2.  The server connection program starts and looks for values for VERSANT_ROOT, VERSANT_DB, VERSANT_DBID_NODE, and VERSANT_DBID. The ss daemon will search in the following order:

A.  Environment variables
B.  User configuration file
C.  Machine configuration file
D.  System information file

Normally, if needed information is not found in environment variables or in a user configuration file, the server connection program will use the machine configuration file associated with its own release number.

However, if you have asserted a release number and needed information is not found in environment variables or in a user configuration file, the server connection program will use the machine configuration file associated with the release number that has been asserted.

3.  The server connection program starts a database server process associated with the VERSANT configuration that it has found.

In general, client applications compiled with a lower release number can connect to database servers of a higher release number, but client applications cannot connect to a server of a lower release number. For example, a 4.0.8 client can connect to a 5.2.0 server, but a 5.2.0 client cannot connect with a 4.0.8 database.

Setting VERSANT_REL

The general syntax for setting VERSANT_REL is:

VERSANT_REL xx.yy.zz

For xx, substitute the main release number; for yy, substitute the maintenance number; and for zz substitute the update number. Do not use leading zeroes.

For example, for Release 5.2.1:

VERSANT_REL 5.1.1

You must set the configuration parameter VERSANT_REL in the environment variable VERSANT_REL.

Setting VERSANT_REL@node

The general syntax for setting VERSANT_REL@node is:

VERSANT_REL@node xx.yy.zz

For node, substitute the name of the remote machine.

For xx, substitute the main release number; for yy, substitute the maintenance number; and for zz substitute the update number. Do not use leading zeroes.

For example, for Release 5.2.1 on a machine named server:

VERSANT_REL@server 5.2.1

You must set the configuration parameter VERSANT_REL@node in the environment variable VERSANT_REL@node.

Environment setting on client machine

The following shows how the VERSANT_REL setting on a server machine is affected by an environment variable setting on a client machine (VERSANT_REL or VERSANT_REL@node).

VERSANT_REL

VERSANT_REL@node

Value passed

Yes

No

None

Yes

Yes

VERSANT_REL@node

No

Yes

VERSANT_REL@node

No

No

none

 
Example

Suppose that a local machine and a remote machine named alpha each has more than one installation of VERSANT:

Client process uses Release 3.0.5

An application compiled with Release 3.0.5.

Local connection program uses Release 3.0.10

The local TCP/IP configuration files point to a server connection program in a Release 3.0.10 bin directory.

Desired local server processes use 3.0.8

You want to access local 3.0.8 databases.

Connection program on alpha uses 3.0.12

The TCP/IP configuration files on alpha point to a server connection program in a Release 3.0.12 bin directory.

Desired server processes on alpha use 3.0.10

You want to access 3.0.10 databases on alpha.

In this case, you must set the following:

VERSANT_REL  3.0.8

You must assert the local release to be 3.0.8 in order to start Release 3.0.8 server processes, because the server connection program is associated with Release 3.0.10.

VERSANT_REL@alpha  3.0.10

You must assert the release on alpha to be 3.0.10 in order to start Release 3.0.10 server processes, because the server connection program is associated with Release 3.0.12.

 

VERSANT_ROOT@node

Remote software root directory. Normally not needed.

This parameter is needed only if a remote machine named node has multiple versions of VERSANT software and you want to specify a particular software root directory.

Remote paths must be specified in syntax understood by the remote machine.

You may set the parameter VERSANT_ROOT@node in any of the following places:

VERSANT_ROOT@node

In the environment variable VERSANT_ROOT@node.

user.cfg

In a user configuration file, if you also set VERSANT_CFG.

/etc/.oscxxyyzz

In the machine configuration file, which is the default location.

 
The following shows how the VERSANT_ROOT setting on a server machine is affected by an environment variable setting on a client machine (VERSANT_ROOT or VERSANT_ROOT@server).

Environment setting on client machine:

VERSANT_ROOT

VERSANT_ROOT@node

Value passed

Yes

No

None

Yes

Yes

VERSANT_ROOT@node

No

Yes

VERSANT_ROOT@node

No

No

none

 

     

 

VERSANT_DBID_NODE@node

Machine containing the database system file for a remote database. Normally not needed.

You need to specify this parameter only if there are multiple database systems and you want to override the specification for the machine containing the osc-dbid file that has been set on the remote machine named node.

If you supply the name of a remote database when you use the create database, remove database, or list databases utilities, VERSANT will look for the name of the machine containing the osc-dbid database system file in this parameter. If this parameter has not been set, VERSANT will look for the osc-dbid file in the location specified on the remote machine.

The general syntax for setting VERSANT_DBID_NODE@node is:

VERSANT_DBID_NODE@node osc-dbid_machine

Substitute for node the name of remote machine used with dbname@node syntax as an argument to the createdb, removedb, or listdb utilities. Substitute for osc-dbid_machine the name of the machine containing the osc-dbid file that you want to use.

You may set the parameter VERSANT_DBID_NODE@node in any of the following places:

VERSANT_DBID_NODE@node

In the environment variable VERSANT_DBID_NODE@node.

user.cfg

In a user configuration file, if you also set VERSANT_CFG.

/etc/.oscxxyyzz

In the machine configuration file, which is the default location.

sysinfo

In the sysinfo file in the lib directory.

See the chapter "Directories and Files" for an explanation of the osc-dbid file.

 

VERSANT_DBID@node

Directory containing the database system file for a remote database. Normally not needed.

You need to specify this parameter only if there are multiple database systems and you want to override the specification for the machine containing the osc-dbid file that has been set on the remote machine named node.

If you supply the name of a remote database when you use the create database, remove database, or list databases utilities, VERSANT will look for the name of the directory containing the osc-dbid database system file in this parameter. If this parameter has not been set, VERSANT will look for the osc-dbid file in the location specified on the remote machine.

The general syntax for setting VERSANT_DBID@node is:

VERSANT_DBID@node path

Substitute for node the name of remote machine used with dbname@node syntax as an argument to the createdb, removedb, or listdb utilities. Substitute for path the directory containing the osc-dbid file in terms understandable to the operating system of the remote machine.

For example, if you want to create a database on a remote machine named alpha and specify an osc-dbid directory on a UNIX machine in /usr/local/versant/db:

VERSANT_DBID@alpha /usr/local/versant/db

You may set the parameter VERSANT_DBID@node in any of the following places:

VERSANT_DBID@node

In the environment variable VERSANT_DBID@node.

user.cfg

In a user configuration file, if you also set VERSANT_CFG.

/etc/.oscxxyyzz

In the machine configuration file, which is the default location.

sysinfo

In the sysinfo file in the lib directory.

See the chapter "Directories and Files" for an explanation of the osc-dbid file.

 

VERSANT_DB@node

Database root directory for a remote database. Normally not needed.

You need to specify this parameter only if there are multiple database root directories on a remote machine and you want to override the specification that has been set on the remote machine named node.

If you specify a remote database in a command or method with the syntax dbname@node, VERSANT will look for a value set by this parameter. If this parameter has not been set, VERSANT will look for the database root directory in the location specified on the remote machine.

The general syntax for setting VERSANT_DB@node is:

VERSANT_DB@node path

For node, substitute the name of the remote machine. For path, substitute the location of the database root directory in terms understandable to the operating system of the remote machine.

For example, if you want to connect with a database on a UNIX machine named alpha whose database root directory is /db, set:

VERSANT_DB@alpha /db

If you want to connect with a database on an OS/2 machine named beta whose database root directory is c:\db, set:

VERSANT_DB@beta c:\db

You may set the parameter VERSANT_DB@node in any of the following places:

VERSANT_DB@node

In the environment variable VERSANT_DB@node.

user.cfg

In a user configuration file, if you also set VERSANT_CFG.

/etc/.oscxxyyzz

In the machine configuration file, which is the default location.

sysinfo

In the sysinfo file in the lib directory.

 

UNIX Error Logging and Debugging Parameters

 

CHECKING

The CHECKING environment variable turns C++/VERSANT debugging on and off. See the C++/VERSANT Reference for further information.

 

versant_fe_errlog

To turn error logging on for the application process, set the environment variable versant_fe_errlog to the name of the file where errors should be logged. By default, error logging is off.

On UNIX systems, create this environment variable with its name in all lower case.

In addition to error number and error message, entries in the error log file also include context information, such as operating system error number, file name, and so on. The exact context information varies from error to error.

This error logging mechanism should not be confused with the functionality represented by the file LOGFILE, which is used to report non-panic VERSANT system errors.

For UNIX systems, the general syntax to set this environment variable is similar to the following (depending upon your shell), where filename is the name of your error logging file:

setenv versant_fe_errlog filename

 

UNIX Statistics Collection Parameters

 

VERSANT_STAT_FILE

To collect performance and monitoring statistics and send them to a file, set the environment variable VERSANT_STAT_FILE to the name of a file and then run your application within its scope.

By default, all defined statistics will be collected. You may want to filter the statistics collected to reduce file size and improve application performance. To filter the statistics collected and set other collection parameters, you can use the VERSANT_STAT_STATS, VERSANT_STAT_FUNCS, VERSANT_STAT_TIME, VERSANT_STAT_DBS, and VERSANT_STAT_FLUSH environment variables.

If you set VERSANT_STAT_FILE, statistics will be collected during the time your application is in a database session.

The VERSANT_STAT_FILE environment variable is read each time a session starts, so if your application starts and stops a session, each new session will overwrite the file created by the previous session.

Within the file name, you can use the symbol %p, which will expand to your process identifier number. This can help create differing file names if you exit your application process between sessions, but it is not a guarantee because process id numbers can repeat.

Unlike other VERSANT environment variables, such as VERSANT_ROOT, the VERSANT_STAT_FILE environment variable is not read automatically when an application makes a connection to a database on a local or remote machine. Instead, VERSANT_STAT_FILE is a normal environment variable associated with a particular application process.

If VERSANT_STAT_FILE has been set, statistics are collected and written whenever a collection point is encountered by your application. A default collection point is encountered when your application enters or exits a VERSANT function. You can set additional collection points by inserting o_autostatsenter() and o_autostatsexit() function calls in your code.

Setting VERSANT_STAT_FILE has no effect on statistics collection performed by other mechanisms, such as a separate invocation of the vstats utility.

Setting VERSANT_STAT_FILE is the same as calling o_autostatsbegin() at the beginning of your session, except that uses parameters found in VERSANT_STAT_STAT, VERSANT_STAT_FUNCS, VERSANT_STAT_TIME, VERSANT_STAT_DBS, and VERSANT_STAT_FLUSH.

Even when database replication has been turned on, statistics collection tools and mechanisms operate only on named databases and not on replica databases. To collect statistics for a replica database, you must apply statistics collection mechanisms specifically to the replica database. If the replica database goes down, statistics collection will stop and then restart when the database comes back up.

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_STATS

If VERSANT_STAT_FILE has been set, by default all statistics are collected and sent to the named file whenever a collection point is encountered. To filter what application, session, connection, and database statistics are sent to a file, set the VERSANT_STAT_STATS environment variable to a space delimited list of the names of the statistics you want to collect.

When statistic names are specified in the environment variable VERSANT_STAT_STATS, they must be entered in lowercase without the leading STAT_ prefix.

For example:

setenv VERSANT_STAT_STATS 'se_net_bytes_read se_net_bytes_written'

Setting VERSANT_STAT_STAT has no effect on what statistics are collected by other mechanisms, such as a separate invocation of the vstats utility. However, you can call o_collectstats() and explicitly turn collection off for specific statistics, which will override the values set by VERSANT_STAT_STATS.

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_FUNCS

If VERSANT_STAT_FILE has been set, by default all statistics are collected and sent to the named file whenever a collection point is encountered. To filter what function statistics are sent to the file, set the VERSANT_STAT_FUNCS environment variable to a space delimited list of the names of the function statistics you want to collect.

When function names are specified in the environment variable VERSANT_STAT_FUNCS, they must be entered in lowercase, without the leading CAPI_ prefix and with a leading o_ prefix.

For example:

setenv VERSANT_STAT_FUNCS 'o_xact o_select'

Setting VERSANT_STAT_FUNCS has no effect on what statistics are collected by other mechanisms, such as a separate invocation of the vstats utility. However, you can call o_collectstats() and explicitly turn collection off for specific statistics, which will override the values set by VERSANT_STAT_FUNCS.

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_TIME

If VERSANT_STAT_FILE has been set, by default statistics are collected and sent to the named file whenever a collection point is encountered. To set a collection interval, set VERSANT_STAT_TIME to a desired number of seconds. After VERSANT_STAT_TIME has been set, statistics will not be written unless the specified number of seconds have elapsed since the last time that statistics were written.

Setting a time interval will improve performance, but the trace-like information on which functions were called will not be recorded. It is not necessary to restrict time intervals to be integers.

For example:

setenv VERSANT_STAT_TIME 1.5

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_DBS

If VERSANT_STAT_FILE has been set, by default statistics are collected for all databases to which an application makes a connection, including the session database. To limit statistics collection to specific databases, set this environment variable to a space delimited list of database names. For remote databases, use the syntax dbname@node.

For example:

setenv VERSANT_STAT_DBS 'db1@server1 db2@server2'

Statistics collection for a named database will begin when a connection is made to it and stop when a connection to it is closed.

To ensure that only application and session statistics are sent to file, set VERSANT_STAT_DBS to an empty string:

setenv VERSANT_STAT_DBS ''

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_FLUSH

If VERSANT_STAT_FLUSH exists, each batch of statistics is sent to file as soon as it is generated. This eliminates a possible lag time caused by operating system file buffering, which is useful when you want to view the automatic collection file as it is being generated.

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

UNIX User Authentication Parameter

 

VERSANT_AUTH

As a part of the process of customizing user authentication, on the application machine, set the environment variable VERSANT_AUTH to point to the application authentication program.

The general format for the environment variable is:

VERSANT_AUTH=program_path

For usage notes, see the chapter "User Authentication" in the VERSANT Database Fundamentals Manual.

 

UNIX Communications Parameter

VERSANT TCP/IP service name. Normally not needed.

This parameter provides support for multiple VERSANT releases.

The environment variable VERSANT_SERVICE_NAME allows you to have multiple VERSANT releases on the same machine and connect to servers from one or the other of these releases selectively from different clients. This is an advanced option and requires careful configuration. This is not something you normally need to do, and we recommend that you do it only with the guidance of VERSANT Technical Support.

In the default installation, the VERSANT connection services daemon listens on TCP/IP port 5019, which has the TCP/IP service name "oscssd" associated with it. In the default case, all clients try to connect to the "oscssd" service on the server machine, and the service name is mapped to a port number by looking up the TCP/IP configuration file /etc/services on the client machine (not the server machine).

By specifying the environment variable VERSANT_SERVICE_NAME, you can cause a client application to connect to a different service name and, therefore, a different port number. Correspondingly, on the server machine you can set up different VERSANT releases to listen on different port numbers and allow a client to connect to a VERSANT server process from the release of their choice.

Example

For example, suppose that you have VERSANT Release 5.0.8 as well as 5.2.0 installed on the same server machine. The following procedure illustrates how to set up the server machine and the client machines for selective VERSANT release execution.

In this example, let's assume that the two releases have different VERSANT_ROOT directories. Suppose that Release 5.0.8 resides at /usr/versant/5.0.8/sun4, and Release 5.2.0 resides at /apps/versant/5.2.0/sun4.

In the following description, the sections on configuring TCP/IP services apply only to Unix machines. On Windows NT, a GUI utility named networkservices.exe is provided to configure Windows machines to run multiple Versant releases. This Windows utility is documented with the other DBA utilities.

Configuring a server machine

1.  Select port numbers and service names.

First, select a port number for each release to listen on. For this example, let's choose port 5020 for Release 5.0.8 and port 5030 for Release 5.2.0.

Next, select service names to associate with these two ports. For this example, let's choose the service names osc508 and osc520.

2.  Get root privilege on your server machine.

3.  Edit the /etc/services file.

Edit the file /etc/services and associate the service names with the chosen port numbers by adding the following two lines:

osc508  5020/tcp    # Versant 5.0.8 connection service
osc520  5030/tcp    # Versant 5.2.0 connection service

4.  Edit the /etc/inetd.conf file.

Edit the file /etc/inetd.conf and associate each service name with the desired release by adding the following two lines:

osc508 stream tcp nowait root /usr/versant/5.0.8/sun4/bin/ss.d in.oscssd
osc520 stream tcp nowait root /apps/versant/5.2.0/sun4/bin/ss.d in.oscssd

You must provide the absolute path to the ss.d executable in the VERSANT bin directory for each release.

5.  Refresh inetd.

Notify inetd that it should refresh its configuration, which we changed in the previous step:

ps -ef | grep inetd  # Find the process id of inetd

kill -HUP <inetd-process-id>  # Ask inetd to refresh

Configuring a client machine

6.  Edit the services file.

On each client machine, edit the services file and introduce the new service names and port numbers as in Steps 2 and 3 above. The service names and port numbers for VERSANT services must match each other exactly on the client and server machines.

Usage at run-time

The following applies to both Unix and NT platforms.

7.  Set VERSANT_SERVICE_NAME on each client machine.

In an appropriate context on the 5.0.8 client machine, set the environment variable VERSANT_SERVICE_NAME to the value "osc508" before running a Release 5.0.8 application. This will automatically connect the application to the server database process for VERSANT Release 5.0.8.

In an appropriate context on the 5.2.0 client machine, set the environment variable VERSANT_SERVICE_NAME to the value "osc520" before running a Release 5.2.0 application. This will automatically connect the application to the server database process for VERSANT Release 5.2.0.

On UNIX running C shell:

For example:

setenv VERSANT_SERVICE_NAME osc508

On UNIX running Bourne shell:

For example:

VERSANT_SERVICE_NAME=osc508; export

On NT:

For a persistent change, go to Control Panel / System / Environment, enter VERSANT_SERVICE_NAME in the Variable entry box, enter the new service name in the Value entry box, click on on Set and then click on either Apply or OK.

For a temporary change, you can set environment variables in a program. For example:

SetEnvironmentVariable("VERSANT_SERVICE_NAME", "osc508");
putenv("VERSANT_SERVICE_NAME=osc508");

In the above, note that you need to execute both SetEnvironmentVariable(), in order to set the variable in the NT process header, and putenv(), in order to set the variable in the C runtime environment.

 

UNIX Examples

UNIX example using normal parameters

Suppose you are running on a UNIX machine named myMachine, you are accessing an OS/2 machine named alpha and a UNIX machine named beta, and the osc-dbid database system file is on beta in /dbsys.

To specify information about your machine, you must set:

VERSANT_ROOT       /usr/local/versant
PATH               <existing PATH>;/usr/local/versant/3.0.8/sun4/bin

If you want to create databases on your local machine, you must set:

VERSANT_DBID_NODE  beta
VERSANT_DBID       /dbsys
VERSANT_DB         /usr/local/versant/db

After setting all of these variables, if you invoke createdb as:

createdb myDatabase

Then VERSANT will look at the following variables:

PATH

To find the createdb utility.

VERSANT_DBID_NODE

To find the machine containing the osc-dbid file.

VERSANT_DBID

To find the directory containing the osc-dbid file.

VERSANT_DB

To find the database root directory.

After setting all of these variables, if you invoke createdb as:

createdb myDatabase@alpha

After making the connection, VERSANT will pass the createdb command to alpha. Machine alpha will then look to its own configuration parameters to decide where to find the osc-dbid file and where to place the new database.

UNIX example using advanced parameters

Suppose your UNIX machine is named myMachine and you are accessing an OS/2 machine named alpha and a UNIX machine named beta, and the osc-dbid database system file is on beta in /dbsys.

If you have multiple releases of VERSANT on your local machine or databases created with multiple releases and want to assert the release number, you may optionally set:

VERSANT_REL        3.0.8

If you want to assert the location of the osc-dbid database system file to machines alpha and beta, you may optionally set:

VERSANT_DBID_NODE@alpha  beta
VERSANT_DBID@alpha       /dbsys
VERSANT_DBID_NODE@beta   beta
VERSANT_DBID@beta        /dbsys

If you want to assert the location of database root directories to machines alpha and beta, you may optionally set:

VERSANT_DB@alpha       d:\versant\db
VERSANT_DB@beta        /versant/db

If you have multiple releases of VERSANT on alpha and beta and databases created with multiple releases, to assert the release number and root directories, you may optionally set:

VERSANT_REL@alpha      3.0.8
VERSANT_ROOT@alpha     d:\versant
VERSANT_ROOT@beta      /usr/local/versant
VERSANT_REL@beta       3.1.4

After setting all of the above parameters, if you invoke createdb as:

createdb myDatabase@alpha

Then VERSANT will look at the following parameters:

VERSANT_REL@alpha

To assert the release number on alpha.

VERSANT_ROOT@alpha

To assert the software root directory on alpha.

VERSANT_DBID_NODE@alpha

To assert the osc-dbid machine.

VERSANT_DBID@alpha

To assert the osc-dbid directory.

VERSANT_DB@alpha

To assert the database root directory.

 

Configuration Parameters for Windows

The following explains configuration parameters for Windows operating systems.

Because personal computer operating systems differ on how they set and use parameters, please see your Platform Notes and Installation Guide manuals for information on where and how to set configuration parameters. This section just discusses the parameters that can be set and what they do.

 

Windows Configuration Parameter Considerations

Passing parameters to remote machines

To specify a command or configuration parameter on a remote machine, you can use @node syntax. For example, to create a database on a remote machine named server, you would use the following @node syntax:

createdb db1@server

Or, to look for an osc-dbid file on a remote machine:

VERSANT_DBID_NODE@server

If you set a configuration parameter without @node syntax, that parameter applies only to the local machine. If you use @node syntax, the value is sent to the remote machine for its use.

Configuration parameters explicitly passed to a remote machine override those already set on the remote machine. You should pass parameters only in the usual circumstance that you want to override the values set on the remote machine.

For example, suppose an NT machine named server has the following environment parameter set:

VERSANT_DB \versant\db

To create a database on server in a different directory, you could set the following:

VERSANT_DB@server \db

Then, if you invoke the create database utility as createdb@server, the value of your environment parameter VERSANT_DB@server will be passed to the machine named server and the database will be created in a directory branching from \db rather than \versant\db.

You can use @node syntax for any parameter and set any parameter for remote use in either a configuration file or in an environment variable.

If you doubly define a parameter for the local machine by defining it both with and without @node syntax, VERSANT will look first for a value in the parameter without @node syntax and then look for it with @node syntax. The first value found will be the value used.

For example, if you are on machine alpha and have defined both VERSANT_DB and VERSANT_DB@alpha, then VERSANT will use the value in VERSANT_DB. However, if you have not defined VERSANT_DB, then VERSANT will use the value in VERSANT_DB@alpha.

In any case, you must, of course, specify parameters to be passed in the syntax appropriate to the remote machine. For example:

VERSANT_DB@unix_server /usr/local/versant/db
VERSANT_DB@nt_server \versant\db

 

Windows Configuration Parameters That You Need to Set

The following configuration parameters are necessary for VERSANT to run in a standard environment.

You must explicitly set them only in the following situations:

•    If you did not answer all prompts during installation.

•    If you made a mistake during installation.

•    If you have moved your software, database directory, or database system identifier file.

When you install VERSANT, all configuration parameters needed by VERSANT are set and stored.

See also the chapter "Directories and Files" for an explanation of VERSANT file structures.

 

PATH

Executables directory. Always needed.

After installation, append the location of the VERSANT executables directory bin to your PATH environment variable. This will enable VERSANT to find the executables regardless of your current directory.

 

LIBPATH

Local libraries directory. OS/2 only. Always needed.

The libraries directory.

For OS/2, append the location of the VERSANT libraries directory lib to your LIBPATH environment variable as set in your config.sys file. This will enable VERSANT to find its libraries regardless of your current directory.

For example, if the lib directory is c:\versant\3_0_8\os2\lib:

libpath <existing path>;c:\versant\3_0_8\os2\lib

 

Windows Parameters That Must Be Set Somewhere

The following configuration parameters are necessary for VERSANT to run in a standard environment.

You must explicitly set them only in the following situations:

•    If you did not answer all prompts during installation.

•    If you made a mistake during installation.

•    If you have moved your software, database directory, or database system identifier file.

 

VERSANT_ROOT

The software root directory. Mandatory.

This parameter enables VERSANT to find its own files, because they are placed in predetermined places in directories built from the software root directory.

You must specify the location of the software root directory by setting the environment variable VERSANT_ROOT.

The general syntax is:

set VERSANT_ROOT=drive:directory

For example:

set VERSANT_ROOT=c:\versant

You cannot set VERSANT_ROOT in the sysinfo file.

Default and non-default directory structures

By default, the basic structure of VERSANT directories is:

<VERSANT_ROOT>

|

<release number>

|

<platform>

|

--subdirectories--

 
However, if VERSANT cannot find its own files under a platform directory, it will look under VERSANT_ROOT:

<VERSANT_ROOT>

|

--subdirectories--

 
For example, the default structure for VERSANT release 5.2.1 on NT is:

<VERSANT_ROOT>

|

5.0.8

|

nt

|

+-----------------------------+

| | | | |

bin lib h demo install

 
But, if needed files are not found, VERSANT will look for the following structure:

<VERSANT_ROOT>

|

+-----------------------------+

| | | | |

bin lib h demo install

 
Client-only, runtime installations need only the error message file under VERSANT_ROOT. If you have static linkage for the executables, the rest of the VERSANT installation tree does not have to be present.

You can see the location of your VERSANT installation by typing:

oscp –p

 

VERSANT_DBID_NODE

Machine containing the database system file for a local database. Usually needed.

This parameter is necessary if you want to create, remove, or list databases. There is no default location for the database system file.

If your machine is not connected to a network, you do can skip specifying this parameter, which will indicate that the osc-dbid file is on the local machine.

If your machine is connected to a network but will use a local database system file, you should supply the network name of your machine as known to your TCP/IP installation.

If your machine is connected to a network and will use a remote database system file, you should supply the network name of the remote machine as known to your TCP/IP installation.

You can set VERSANT_DBID_NODE as an environment variable or with a line in the sysinfo file. The general syntax is:

VERSANT_DBID_NODE osc-dbid_machine

 

VERSANT_DBID

The local or remote directory containing the osc-dbid database system file. Usually needed.

This parameter is necessary if you want to create, remove, or list databases. There is no default location for the database system file.

Remote directories must be specified in terms understandable to the operating system on the remote machine. This means that for personal computers you should specify directories with drive:\directory syntax and for UNIX computers you should specify directories with /directory syntax.

You can set VERSANT_DBID_NODE as an environment variable or with a line in the sysinfo file. The general syntax is:

VERSANT_DBID path

For path, substitute the location of the software root directory in terms understandable to the operating system of the machine containing the osc-dbid file.

For example, if the machine containing the osc-dbid file is a personal computer and the osc-dbid directory on that machine is c:\versant\db:

VERSANT_DBID c:\versant\db

If the machine containing the osc-dbid file is running UNIX and the osc-dbid directory is /usr/local/versant/db, specify VERSANT_DBID as:

VERSANT_DBID /usr/local/versant/db

 

VERSANT_DB

The database root directory. Usually needed.

This parameter is necessary if you want to create or remove a database on your local machine. New databases are placed in a directory branching from the database root directory.

You can set VERSANT_DB as an environment variable or with a line in the sysinfo file. The general syntax is:

VERSANT_DB path

For path, substitute the location of the database root directory.

For example:

VERSANT_DB c:\versant\db

 

VERSANT_USER

Network username. Necessary for remote connections.

On a personal computer, you must set this parameter if you want to access, create, or remove a database on a remote machine.

If you are using VERSANT on a standalone basis, you do not have to specify a username.

You can set VERSANT_USER with a line in the sysinfo file or by setting an environment variable. The general syntax is:

VERSANT_USER username

Substitute for username the login name to be used when you make a database connection.

For example, for the login name silas:

VERSANT_USER silas

 

Windows Parameters That You May Want to Set

On personal computers, VERSANT also uses the following non-VERSANT environment variables.

 

TZ

Your local time zone is needed by the C++/VERSANT VDate and VTime classes.

For example, for Pacific time, set TZ to equal PST8PDT.

 

HOSTNAME

The TCP/IP name of your local machine, which is needed by TCP/IP network software.

 

ETC

The TCP/IP etc directory, which is needed by TCP/IP network software.

The VERSANT installation program will optionally update your TCP/IP services file as appropriate for your operating environment. TCP/IP services are required for other clients to remotely access databases local to your personal computer environment or if you link your application to the VERSANT two process system library (the usual choice).

If you elect to update the TCP/IP services file yourself, want to examine VERSANT's changes, or need to change the VERSANT installation, the following changes are needed for each of the personal computer operating systems supported by VERSANT.

OS/2

On OS/2, the \tcpip\etc\services file should define VERSANT service as:

oscssd 5019/tcp

The \tcpip\etc\inetd.lst should define the VERSANT connection server as:

oscssd tcp path

Where path points to the \bin\ss.exe program in your installed software tree.

Windows NT

In Windows NT, the \winnt\system32\drivers\etc\services file should define VERSANT service as:

oscssd 5019/tcp

 

Windows Parameters for Asserting Values

Following is a reference to configuration parameters needed only in a complex environment.

 

VERSANT_REL

 

VERSANT_REL@node

VERSANT release number. Normally not needed.

VERSANT allows you to assert a release number by setting the environment variable VERSANT_REL for a local machine or VERSANT_REL@node for a remote machine named node.

•    You must assert a release number if your application was compiled with one VERSANT Release and you want to access a database of another Release.

•    You may want to assert a release number if you have multiple VERSANT Releases on the same machine.

Asserting a release number causes VERSANT to use the configuration specified in the .oscxxyyzz machine configuration file that corresponds to the release number asserted.

Asserting a release number does not alter the normal order in which VERSANT searches for its configuration. If a configuration has been specified in environment variables or in a user configuration file, then asserting a release number will have no effect.

Except in the case when Release 2 applications are accessing Release 3 databases, the ability to assert release numbers is provided as a convenience. For example, when interacting with a remote machine, you may not know what values to assert for VERSANT_ROOT@node, VERSANT_DB@node, VERSANT_DBID_NODE@node, and VERSANT_DBID@node in order to completely specify the remote configuration you want to use. In such a case, it is simpler just to assert a release number with VERSANT_REL@node and then let the remote machine determine the correct configuration to use.

See also the notes for VERSANT_REL in the preceding section, "Configuration Parameters for UNIX."

 

VERSANT_ROOT@node

Remote software root directory. Normally not needed.

This parameter is needed only if a remote machine named node has multiple versions of VERSANT software and you want to specify a particular software root directory.

Remote paths must be specified in syntax understood by the remote machine.

You may set the parameter VERSANT_ROOT@node in an environment variable or in the sysinfo file.

The following shows how the VERSANT_ROOT setting on a server machine is affected by an environment variable setting on a client machine (VERSANT_ROOT or VERSANT_ROOT@server).

Environment setting on client machine:

VERSANT_ROOT

VERSANT_ROOT@node

Value passed

Yes

No

None

Yes

Yes

VERSANT_ROOT@node

No

Yes

VERSANT_ROOT@node

No

No

none

 
      

 

VERSANT_DBID_NODE@node

Machine containing the database system file for a remote database. Normally not needed.

You need to specify this parameter only if there are multiple database systems and you want to override the specification for the machine containing the osc-dbid file that has been set on the remote machine named node.

If you supply the name of a remote database when you use the create database, remove database, or list databases utilities, VERSANT will look for the name of the machine containing the osc-dbid database system file in this parameter. If this parameter has not been set, VERSANT will look for the osc-dbid file in the location specified on the remote machine.

You can set VERSANT_DBID_NODE@node as an environment variable or with a line in the sysinfo file. The general syntax is:

VERSANT_DBID_NODE@node osc-dbid_machine

Substitute for node the name of remote machine used with dbname@node syntax as an argument to the createdb, removedb, or listdb utilities. Substitute for osc-dbid_machine the name of the machine containing the osc-dbid file that you want to use.

See the chapter "Directories and Files" for an explanation of the osc-dbid file.

 

VERSANT_DBID@node

Directory containing the database system file for a remote database. Normally not needed.

You need to specify this parameter only if there are multiple database systems and you want to override the specification for the machine containing the osc-dbid file that has been set on the remote machine named node.

If you supply the name of a remote database when you use the create database, remove database, or list databases utilities, VERSANT will look for the name of the directory containing the osc-dbid database system file in this parameter. If this parameter has not been set, VERSANT will look for the osc-dbid file in the location specified on the remote machine.

You can set VERSANT_DBID@node as an environment variable or with a line in a configuration file. The general syntax is:

VERSANT_DBID@node path

Substitute for node the name of remote machine used with dbname@node syntax as an argument to the createdb, removedb, or listdb utilities. Substitute for path the directory containing the osc-dbid file in terms understandable to the operating system of the remote machine.

For example, if you want to create a database on a remote machine named alpha and specify an osc-dbid directory on a UNIX machine in /usr/local/versant/db:

VERSANT_DBID@alpha /usr/local/versant/db

See the chapter "Directories and Files" for an explanation of the osc-dbid file.

 

VERSANT_DB@node

Database root directory for a remote database. Normally not needed.

You need to specify this parameter only if there are multiple database root directories on a remote machine and you want to override the specification that has been set on the remote machine named node.

If you specify a remote database in a command or method with the syntax dbname@node, VERSANT will look for a value set by this parameter. If this parameter has not been set, VERSANT will look for the database root directory in the location specified on the remote machine.

You can set VERSANT_DB@node as an environment variable or with a line in the sysinfo file. The general syntax is:

VERSANT_DB@node path

For node, substitute the name of the remote machine. For path, substitute the location of the database root directory in terms understandable to the operating system of the remote machine.

For example, if you want to connect with a database on a UNIX machine named alpha whose database root directory is /db, set:

VERSANT_DB@alpha /db

If you want to connect with a database on an OS/2 machine named beta whose database root directory is c:\db, set:

VERSANT_DB@beta c:\db

 

Windows Error Logging and Debugging Parameters

 

CHECKING

The CHECKING environment variable turns C++/VERSANT debugging on and off. See the C++/VERSANT Reference for further information.

 

versant_fe_errlog

To turn error logging on for the application process, set the environment variable versant_fe_errlog to the name of the file where errors should be logged. By default, error logging is off.

In addition to error number and error message, entries in the error log file also include context information, such as operating system error number, file name, and so on. The exact context information varies from error to error.

This error logging mechanism should not be confused with the functionality represented by the file LOGFILE, which is used to report non-panic VERSANT system errors.

 

Windows Statistics Collection Parameters

 

VERSANT_STAT_FILE

To collect performance and monitoring statistics and send them to a file, set the environment variable VERSANT_STAT_FILE to the name of a file and then run your application within its scope.

By default, all defined statistics will be collected. You may want to filter the statistics collected to reduce file size and improve application performance. To filter the statistics collected and set other collection parameters, you can use the VERSANT_STAT_STATS, VERSANT_STAT_FUNCS, VERSANT_STAT_TIME, VERSANT_STAT_DBS, and VERSANT_STAT_FLUSH environment variables.

If you set VERSANT_STAT_FILE, statistics will be collected during the time your application is in a database session.

The VERSANT_STAT_FILE environment variable is read each time a session starts, so if your application starts and stops a session, each new session will overwrite the file created by the previous session.

Within the file name, you can use the symbol %p, which will expand to your process identifier number. This can help create differing file names if you exit your application process between sessions, but it is not a guarantee because process id numbers can repeat.

Unlike other VERSANT environment variables, such as VERSANT_ROOT, the VERSANT_STAT_FILE environment variable is not read automatically when an application makes a connection to a database on a local or remote machine. Instead, VERSANT_STAT_FILE is a normal environment variable associated with a particular application process.

If VERSANT_STAT_FILE has been set, statistics are collected and written whenever a collection point is encountered by your application. A default collection point is encountered when your application enters or exits a VERSANT function. You can set additional collection points by inserting o_autostatsenter() and o_autostatsexit() function calls in your code.

Setting VERSANT_STAT_FILE has no effect on statistics collection performed by other mechanisms, such as a separate invocation of the vstats utility.

Setting VERSANT_STAT_FILE is the same as calling o_autostatsbegin() at the beginning of your session, except that uses parameters found in VERSANT_STAT_STAT, VERSANT_STAT_FUNCS, VERSANT_STAT_TIME, VERSANT_STAT_DBS, and VERSANT_STAT_FLUSH.

Even when database replication has been turned on, statistics collection tools and mechanisms operate only on named databases and not on replica databases. To collect statistics for a replica database, you must apply statistics collection mechanisms specifically to the replica database. If the replica database goes down, statistics collection will stop and then restart when the database comes back up.

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_STATS

If VERSANT_STAT_FILE has been set, by default all statistics are collected and sent to the named file whenever a collection point is encountered. To filter what application, session, connection, and database statistics are sent to a file, set the VERSANT_STAT_STATS environment variable to a space delimited list of the names of the statistics you want to collect.

When statistic names are specified in the environment variable VERSANT_STAT_STATS, they must be entered in lowercase without the leading STAT_ prefix.

For example:

set VERSANT_STAT_STATS=se_net_bytes_read se_net_bytes_written

Setting VERSANT_STAT_STAT has no effect on what statistics are collected by other mechanisms, such as a separate invocation of the vstats utility. However, you can call o_collectstats() and explicitly turn collection off for specific statistics, which will override the values set by VERSANT_STAT_STATS.

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_FUNCS

If VERSANT_STAT_FILE has been set, by default all statistics are collected and sent to the named file whenever a collection point is encountered. To filter what function statistics are sent to the file, set the VERSANT_STAT_FUNCS environment variable to a space delimited list of the names of the function statistics you want to collect.

When function names are specified in the environment variable VERSANT_STAT_FUNCS, they must be entered in lowercase, without the leading CAPI_ prefix and with a leading o_ prefix.

For example:

set VERSANT_STAT_FUNCS=o_xact o_select

Setting VERSANT_STAT_FUNCS has no effect on what statistics are collected by other mechanisms, such as a separate invocation of the vstats utility. However, you can call o_collectstats() and explicitly turn collection off for specific statistics, which will override the values set by VERSANT_STAT_FUNCS.

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_TIME

If VERSANT_STAT_FILE has been set, by default statistics are collected and sent to the named file whenever a collection point is encountered. To set a collection interval, set VERSANT_STAT_TIME to a desired number of seconds. After VERSANT_STAT_TIME has been set, statistics will not be written unless the specified number of seconds have elapsed since the last time that statistics were written.

Setting a time interval will improve performance, but the trace-like information on which functions were called will not be recorded. It is not necessary to restrict time intervals to be integers.

For example:

set VERSANT_STAT_TIME=1.5

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_DBS

If VERSANT_STAT_FILE has been set, by default statistics are collected for all databases to which an application makes a connection, including the session database. To limit statistics collection to specific databases, set this environment variable to a space delimited list of database names. For remote databases, use the syntax dbname@node.

For example:

set VERSANT_STAT_DBS=db1@server1 db2@server2

Statistics collection for a named database will begin when a connection is made to it and stop when a connection to it is closed.

To ensure that only application and session statistics are sent to file, set VERSANT_STAT_DBS to an empty string:

set VERSANT_STAT_DBS=

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

VERSANT_STAT_FLUSH

If VERSANT_STAT_FLUSH exists, each batch of statistics is sent to file as soon as it is generated. This eliminates a possible lag time caused by operating system file buffering, which is useful when you want to view the automatic collection file as it is being generated.

For an overview of statistics collection and stastics collection usage notes, see the VERSANT Database Fundamentals Manual.

 

Windows User Authentication Parameter

 

VERSANT_AUTH

As a part of the process of customizing user authentication, on the application machine, set the environment variable VERSANT_AUTH to point to the application authentication program.

The general format for the environment variable is:

VERSANT_AUTH=program_path

For usage notes, see the chapter "User Authentication" in the VERSANT Database Fundamentals Manual.

 

Windows Parameters

 

VERSANT_SERVICE_NAME

VERSANT TCP/IP service name. Normally not needed.

This parameter provides support for multiple VERSANT releases.

The environment variable VERSANT_SERVICE_NAME allows you to have multiple VERSANT releases on the same machine and connect to servers from one or the other of these releases selectively from different clients. This is an advanced option and requires careful configuration. This is not something you normally need to do, and we recommend that you do it only with the guidance of VERSANT Technical Support.

In the default installation, the VERSANT connection services daemon listens on TCP/IP port 5019, which has the TCP/IP service name "oscssd" associated with it. In the default case, all clients try to connect to the "oscssd" service on the server machine, and the service name is mapped to a port number by looking up the TCP/IP configuration file /etc/services on the client machine (not the server machine).

By specifying the environment variable VERSANT_SERVICE_NAME, you can cause a client application to connect to a different service name and, therefore, a different port number. Correspondingly, on the server machine you can set up different VERSANT releases to listen on different port numbers and allow a client to connect to a VERSANT server process from the release of their choice.

Example

For example, suppose that you have VERSANT Release 5.0.8 as well as 5.2.0 installed on the same server machine. The following procedure illustrates how to set up the server machine and the client machines for selective VERSANT release execution.

In this example, let's assume that the two releases have different VERSANT_ROOT directories. Suppose that Release 5.0.8 resides at /usr/versant/5.0.8/sun4, and Release 5.2.0 resides at /apps/versant/5.2.0/sun4.

In the following description, the sections on configuring TCP/IP services apply only to Unix machines. On Windows NT, a GUI utility named networkservices.exe is provided to configure Windows machines to run multiple Versant releases. This Windows utility is documented with the other DBA utilities.

Configuring a server machine

1.  Select port numbers and service names.

First, select a port number for each release to listen on. For this example, let's choose port 5020 for Release 5.0.8 and port 5030 for Release 5.2.0.

Next, select service names to associate with these two ports. For this example, let's choose the service names osc508 and osc520.

2.  Get root privilege on your server machine.

3.  Edit the /etc/services file.

Edit the file /etc/services and associate the service names with the chosen port numbers by adding the following two lines:

osc508  5020/tcp    # Versant 5.0.8 connection service
osc520  5030/tcp    # Versant 5.2.0 connection service

4.  Edit the /etc/inetd.conf file.

Edit the file /etc/inetd.conf and associate each service name with the desired release by adding the following two lines:

osc508 stream tcp nowait root /usr/versant/5.0.8/sun4/bin/ss.d in.oscssd
osc520 stream tcp nowait root /apps/versant/5.2.0/sun4/bin/ss.d in.oscssd

You must provide the absolute path to the ss.d executable in the VERSANT bin directory for each release.

5.  Refresh inetd.

Notify inetd that it should refresh its configuration, which we changed in the previous step:

ps -ef | grep inetd  # Find the process id of inetd

kill -HUP <inetd-process-id>  # Ask inetd to refresh

Configuring a client machine

6.  Edit the services file.

On each client machine, edit the services file and introduce the new service names and port numbers as in Steps 2 and 3 above. The service names and port numbers for VERSANT services must match each other exactly on the client and server machines.

Usage at run-time

The following applies to both Unix and NT platforms.

7.  Set VERSANT_SERVICE_NAME on each client machine.

In an appropriate context on the 5.0.8 client machine, set the environment variable VERSANT_SERVICE_NAME to the value "osc508" before running a Release 5.0.8 application. This will automatically connect the application to the server database process for VERSANT Release 5.0.8.

In an appropriate context on the 5.2.0 client machine, set the environment variable VERSANT_SERVICE_NAME to the value "osc520" before running a Release 5.2.0 application. This will automatically connect the application to the server database process for VERSANT Release 5.2.0.

On UNIX running C shell:

For example:

setenv VERSANT_SERVICE_NAME osc508

On UNIX running Bourne shell:

For example:

VERSANT_SERVICE_NAME=osc508; export

On NT:

For a persistent change, go to Control Panel / System / Environment, enter VERSANT_SERVICE_NAME in the Variable entry box, enter the new service name in the Value entry box, click on on Set and then click on either Apply or OK.

For a temporary change, you can set environment variables in a program. For example:

SetEnvironmentVariable("VERSANT_SERVICE_NAME", "osc508");
putenv("VERSANT_SERVICE_NAME=osc508");

In the above, note that you need to execute both SetEnvironmentVariable(), in order to set the variable in the NT process header, and putenv(), in order to set the variable in the C runtime environment.

 

Windows Examples

Personal computer example using normal parameters

Suppose you are running OS/2 on a machine named myMachine, you are accessing another OS/2 machine named alpha and a UNIX machine named beta, and the osc-dbid database system file is on beta in /dbsys.

To specify information about your machine, you must set:

VERSANT_ROOT             c:\versant
PATH                     c:\versant\3_0_5\os2\bin;%PATH%;
LIBPATH                  c:\versant\3_0_5\os2\lib;%LIBPATH%;

If you want to access software or databases on a remote machine, you must set:

VERSANT_USER             silas

If you want to create databases on your local machine, you must set:

VERSANT_DBID_NODE        beta
VERSANT_DBID             /dbsys
VERSANT_DB               c:\versant\mydb

After setting all of these variables, if you invoke createdb as:

createdb myDatabase

Then VERSANT will look at the following variables:

PATH

To find the createdb utility.

VERSANT_DBID_NODE

To find the machine containing the osc-dbid file.

VERSANT_DBID

To find the directory containing the osc-dbid file.

VERSANT_DB

To find the database root directory.

After setting all of these variables, if you invoke createdb as:

createdb myDatabase@alpha

Then VERSANT will look at the following variable:

VERSANT_USER      To make a connection to alpha.

After making the connection, VERSANT will pass the createdb command to alpha. Machine alpha will then look to its own configuration parameters to decide where to find the osc-dbid file and where to place the new database.

Personal computer example using advanced parameters

Suppose your OS/2 machine is named myMachine and you are accessing another OS/2 machine named alpha and a UNIX machine named beta, and the osc-dbid database system file is on beta in /dbsys.

If you have multiple releases of VERSANT on your local machine or databases created with multiple releases and want to assert the release number, you may optionally set:

VERSANT_REL                3.0.5

If you want to assert the location of the osc-dbid database system file to machines alpha and beta, you may optionally set:

VERSANT_DBID_NODE@alpha    beta
VERSANT_DBID@alpha         /dbsys
VERSANT_DBID_NODE@beta     beta
VERSANT_DBID@beta          /dbsys

If you want to assert the location of database root directories to machines alpha and beta, you may optionally set:

VERSANT_DB@alpha           d:\versant\db
VERSANT_DB@beta            /versant/db

If you have multiple releases of VERSANT on alpha and beta and databases created with multiple releases, to assert the release number and root directories, you may optionally set:

VERSANT_REL@alpha          3.0.5
VERSANT_ROOT@alpha         d:\versant
VERSANT_ROOT@beta          /usr/local/versant
VERSANT_REL@beta           3.1.4

After setting all of the above parameters, if you invoke createdb as:

createdb myDatabase@alpha

Then VERSANT will look at the following parameters:

VERSANT_REL@alpha

To assert the release number on alpha.

VERSANT_ROOT@alpha

To assert the software root directory on alpha.

VERSANT_USER

To find a login username.

VERSANT_DBID_NODE@alpha

To assert the osc-dbid machine.

VERSANT_DBID@alpha

To assert the osc-dbid directory.

VERSANT_DB@alpha

To assert the database root directory.

 

 

 


This online documentation is confidential and proprietary to Versant Corporation and is licensed to you, or to your organization, pursuant to the terms of an agreement between you and Versant that restricts the use of this documentation. Please refer to the agreement for more information or call Versant at 510-789-1500 with any questions.