You can run the commands sequentially at one database partition server after another, or you can run the commands in parallel. On UNIX-based platforms, if you run the commands in parallel, you can either choose to have the output sent to a buffer and collected for display (the default behavior) or the output can be displayed at the machine where the command is issued. On Windows NT, if you run the commands in parallel, the output is displayed at the machine where the command is issued.
To use the rah command, type:
rah command
To use the db2_all command, type:
db2_all command
To obtain help about rah syntax, type
rah "?"
The command can be almost anything which you could type at an interactive prompt, including, for example, multiple commands to be run in sequence. On UNIX-based platforms, you separate multiple commands using a semicolon (;). On Windows NT, you separate multiple commands using an ampersand (&). Do not use the separator character following the last command.
The following example shows how to use the db2_all command to change the database configuration on all database partition servers that are specified in the node configuration file. Because the ; character is placed inside double quotation marks, the request will run concurrently:
db2_all ";UPDATE DB CFG FOR sample USING LOGFILSIZ=100"
You can use the following commands:
On Windows NT, causes all processes running on all database partition servers to write call traceback to the Pxxxx.nnn file in the instance directory, where Pxxxx is the process ID and nnn is the node number.
On UNIX-based platforms, these commands execute rah with certain implicit settings such as:
On Windows NT, these commands execute rah to run in parallel at all machines.
You can specify the command:
You should use the prompt method if the command contains the following special characters:
| & ; < > ( ) ` { } [ ] unsubstituted $
If you specify the command as the parameter on the command line, you must enclose it in double quotation marks if it contains any of the special characters just listed.
Note: | On UNIX-based platforms, the command will be added to your command history just as if you typed it at the prompt. |
All special characters in the command can be entered normally (without being enclosed in quotation marks, except for \). If you need to include a \ in your command, you must type two backslashes (\\).
Note: | On UNIX-based platforms, if you are not using a Korn shell, all special characters in the command can be entered normally (without being enclosed in quotation marks, except for ` " \ unsubstituted $, and the single quotation mark (')). If you need to include one of these characters in your command, you must precede them by three backslashes (\\\). For example, if you need to include a \ in your command, you must type four backslashes (\\\\). |
If you need to include a double quotation mark (") in your command, you must precede it by three backslashes, for example, \\\".
Notes:
Note: | The information in this section applies to UNIX-based platforms only. |
The name of the buffer file is /tmp/$USER/rahout by default, but it can be specified by the environment variables $RAHBUFDIR/$RAHBUFNAME.
When you specify that you want the commands to be run concurrently, by default, this script prefixes an additional command to the command sent to all hosts to check that $RAHBUFDIR and $RAHBUFNAME are usable for the buffer file. It creates $RAHBUFDIR. To suppress this, export an environment variable RAHCHECKBUF=no. You can do this to save time if you know the directory exists and is usable.
Before using rah to run a command concurrently at multiple machines, ensure that:
rah ")mkdir /tmp/$USER"
export RAHCHECKBUF=no
Note: | The information in this section applies to UNIX-based platforms only. |
The informative messages are written at an interval controlled by the environment variable RAHWAITTIME. See the help information for details on how specify this. All informative messages can be completely suppressed by exporting RAHWAITTIME=0.
The primary monitoring process is a command whose command name (as shown by the ps command) is rahwait>or. The first informative message tells you the pid (process id) of this process. All other monitoring processes will appear as ksh commands running the rah script (or the name of the symbolic link). If you want, you can stop all monitoring processes by the command:
kill <pid>
where <pid> is the process ID of the primary monitoring process. Do not specify a signal number. Leave the default of 15. This will not affect the remote commands at all, but will prevent the automatic display of buffered output. Note that there may be two or more different sets of monitoring processes executing at different times during the life of a single execution of rah. However, if at any time you stop the current set, then no more will be started.
If your regular login shell is not a Korn shell (for example /bin/ksh), you can use rah, but there are some slightly different rules on how to enter commands containing the following special characters:
" ` unsubstituted $ '
For more information, type rah "?". Also, in a UNIX-based environment, if the login shell at the ID which executes the remote commands is not a Korn shell, then the login shell at the ID which executes rah must also not be a Korn shell. (rah makes the decision as to whether the remote ID's shell is a Korn shell based on the local ID). The shell must not perform any substitution or special processing on a string enclosed in single quotation marks. It must leave it exactly as is.