Troubleshooting
Problem
Some applications rely on correct environment settings to function properly, as an example DB2 needs the DSMI_DIR being defined when backing up data to a Tivoli Storage Manager server.
Resolving The Problem
(if the DSMI_DIR is not properly set, a backup will fail with "SQL2062N An error occurred while accessing media "VENDOR". Reason code: "11".")
Problem: how to determine the active environment settings for the running process (in this case db2sysc)
Under AIX you can use the ps command to verify the environment settings for a running process with the following command:
ps eww <processid>
(ps e displays the environment as well as the parameters to the command, up to a limit of 80 characters, ps eww wraps the display from the e flag and displays the ENV list until the flag reaches the LINE_MAX value)
The following command sequence might make it easier to read the output:
ps eww <processid> | tr ' ' '\n' | grep = | sort
(The "tr ' ' '\n'" command replaces spaces with newlines (most environment variables have a space between them). The "grep =" isolates (mostly) just the environment variables. The sort saves time searching for a variable by name. The command sequence isn't perfect, e.g. environment variable values may have spaces in them which this will mess up.)
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21190074