IBM Support

Verification of environment settings for a running process under AIX

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.)

[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Supported Versions","Edition":"","Line of Business":{"code":"LOB26","label":"Storage"}}]

Document Information

Modified date:
17 June 2018

UID

swg21190074