To create a network-mounted client environment, you must
set up the client configurations on a sample client first. Then you
can move the environment to a shared network path. When the client
is available on your network, each user must configure their client
workstation to use the network-mounted client.
About this task
Network-mounted client environments are supported on Linux and UNIX operating systems with the IBM® Data Server Client or the IBM Data Server Runtime Client packages.
Note: For
C shell (csh) environments, use the setenv command
instead of the export command to set environment
variables. For more information about other command shells, see the
topic "Setting environment variables outside the profile registries
on Linux and UNIX operating systems" in the DB2 Information Center.
Note: Do
not run any instance commands in this instance-less client environment.
Before you begin
As mentioned in the procedure, you must build the network-mounted
client environment on a staging client workstation first. Then you
can put the client files on a shared network path. The staging client
workstation that you use to create your client files and the clients
that are part of the network-mounted client environment, must have
the same operating system.
Procedure
To deploy a network mounted client:
- On the staging client workstation, perform the following
steps:
- Log in with a user ID that does not have root authority,
but does have write access to the network directory.
- Install the DB2® client
to the $HOME/sqllib path.
- Strip all setuid bits from the client
installation by using the chmod command:
chmod -R -s $HOME/sqllib
For HP-UX, you must enable the variables LD_LIBRARY_PATH and SHLIB_PATH to
search for DB2 executable files. Enable the variables by running the
following chatr commands against the files in the $HOME/sqllib/adm, $HOME/sqllib/bin,
and $HOME/sqllib/security directories:chmod u+w $HOME/sqllib/adm/*
chatr +s enable $HOME/sqllib/adm/*
chmod u-w $HOME/sqllib/adm/*
chmod u+w $HOME/sqllib/bin/*
chatr +s enable $HOME/sqllib/bin/*
chmod u-w $HOME/sqllib/bin/*
chmod u+w $HOME/sqllib/security/*
chatr +s enable $HOME/sqllib/security/*
chmod u-w $HOME/sqllib/security/*
- Configure the client environment, such as CLI parameters
in the db2cli.ini file, the LDAP directory, updating
the db2dsdriver.cfg file, DB2 registry variables, and database manager
configuration parameters.
- Test your client configuration to ensure that it is
working as you expect.
- Copy the $HOME/sqllib directory
and its contents to a shared network location on the code server.
This location must be accessible to all client workstations in the
network mounted client environment. You must use the -R and -L options
with the cp command to copy all files in subdirectories
to the network path and materialize all links as real files and directories:
cp -R -L $HOME/sqllib <network_dir>/sqllib
- (Optional) Change ownership of the sqllib network
directory, by using the chown command.
chown -R owner:group <network_dir>/sqllib
Where owner is
the userid and group is the group that is known
to all client hosts that share this sqllib directory.
- For each user account that uses the network-mounted client:
- Set the DB2PATH environment variable
to the shared network location where you copied the sqllib directory
by using the following command:
export DB2PATH=<network_dir>/sqllib
- Use the db2profile and db2cshrc files
in the path that is specified by DB2PATH to configure
system environment variables that are used by the local DB2 client. You can access these files by using
the following command:
. $DB2PATH/db2profile
Or
on C shell, enter: source $DB2PATH/db2cshrc
- Set the DB2_APPL_DATA_PATH environment
variable to a local directory to store user-specific data and diagnostic
files. For example, to set the application data path to the local
directory $HOME/db2, run the following commands:
mkdir $HOME/db2
export DB2_APPL_DATA_PATH=$HOME/db2
- (Optional) To apply all the environment variable settings
detailed above automatically, define them in the .profile file.
What to do next
You can create a user-specific client configuration that
is based on the network mounted client environment configuration by
performing the following steps:
- Copy the shared client configuration on the network to a local
directory by using the db2ccprf command. For example,
to copy the client configuration to a local directory $HOME/db2,
run the following command:
db2ccprf -t $HOME/db2
- Set the DB2_APPL_CFG_PATH environment variable
to this local directory. For example, to set the client configuration
path to the local directory $HOME/db2, run the
following command:
export DB2_APPL_CFG_PATH=$HOME/db2
Log entries, such as those in the db2diag.log,
folder are labeled with the user name of the installer. They are not
labeled with the user name that is associated with the process that
is running the client.
If you change the client configuration
to use a local directory, any reads or updates to the client configuration
changes files in the local directory. Any changes that you make to
the global client configurations do not affect the clients that use
a local client configuration directory.