QUERY SCRIPT (Query IBM Spectrum Protect scripts)
Use this command to display information about scripts.
You can use this command with the DEFINE SCRIPT command to create a new script by using the contents from another script.
Privilege class
The privilege class that
is required for this command depends on whether the Outputfile parameter
is specified in the command.
- If the Outputfile parameter is not specified, any administrator can issue this command.
- If the Outputfile parameter is specified and the REQSYSAUTHOUTFILE server option is set to YES, the administrator must have system privilege.
- If the Outputfile parameter is specified and the REQSYSAUTHOUTFILE server option is set to NO, the administrator must have operator, policy, storage, or system privilege.
Syntax
Parameters
- script_name
- Specifies the name of the script for which information is to be
displayed. You can include a wildcard character to specify this name.
Important: If you do not specify a script, the query displays information about all scripts. The time that is used to process this command and the amount of information that is displayed can be extensive.
- Format
- Specifies the output format for displaying script information.
The default is STANDARD. Possible values are:
- Standard
- Specifies that only the script name and description in a script are displayed.
- Detailed
- Specifies that detailed information about the script is displayed. This information includes the commands in the script and their line numbers, the date of the last update and the administrator that completed the updates.
- Lines
- Specifies that the script name, the line number of the commands, comment lines, and the commands in the script are displayed.
- Raw
- Specifies that commands contained in the script are written to
a file named with the Outputfile parameter. This
format is a way of directing output from a script to a file so that
it can be copied into another script by using the DEFINE
SCRIPT command.
If no output file is specified, the IBM Spectrum® Protect server outputs the "query script" with "format=raw" to the console.
- Outputfile
- Specifies the name of the file to which output is directed when you specify FORMAT=Raw. The file that you specify must be on the server that is running this command. If the file exists, the query output is appended to the end of the file.
Example: List the script descriptions
Display the standard information about scripts.query script *Name Description
--------------- ----------------------------------------------------
QCOLS Display columns for a specified SQL table
QSAMPLE Sample SQL Query
EXAMPLE Backup the store pools and database when no sessions
Example: Display the contents of a script with line numbers
Display the lines of information for a script named Q_AUTHORITY.query script q_authority format=linesName Line Command
Number
---------- ------ -------------------------------------------------
Q_AUTHORITY 1 /* ------------------------------------------*/
5 /* Script Name: Q_AUTHORITY */
10 /* Description: Display administrators that */
15 /* have the authority to issue */
20 /* commands requiring a */
25 /* specific privilege. */
30 /* Parameter 1: privilege name - in the form */
35 /* x_priv - EX. policy_priv */
40 /* Example: run q_authority storage_priv */
45 /* ------------------------------------------*/
50 select admin_name from admins where -
55 upper(system_priv) <> 'NO' or -
60 upper($1) <> 'NO'
Example: Create a script from an existing script
Query the ENGDEV script and direct the output to a file named MY.SCRIPT.query script engdev format=raw outputfile=my.scriptExample: Display detailed script information
Display detailed information about scripts. See Field descriptions for field descriptions.query script * format=detailed Name: QCOLS
Line Number: DESCRIPTION
Command: Display columns for a specified SQL
table
Last Update by (administrator): SERVER_CONSOLE
Last Update Date/Time: 12/02/1997 16:05:29
Name: QCOLS
Line Number: 1
Command: select colname from columns where
tabname='$1'
Last Update by (administrator): SERVER_CONSOLE
Last Update Date/Time: 12/02/1997 16:05:29
Field descriptions
- Name
- The name of the script.
- Line Number
- The line number of the script or the string DESCRIPTION.
- Command
- The command included on the line number that is displayed in the previous field.
- Last Update by (administrator)
- The name of the administrator that defined or most recently updated the script.
- Last Update Date/Time
- The date and time that the administrator defined or updated the script.
Related commands
| Command | Description |
|---|---|
| COPY SCRIPT | Creates a copy of a script. |
| DEFINE SCRIPT | Defines a script to the IBM Spectrum Protect server. |
| DELETE SCRIPT | Deletes the script or individual lines from the script. |
| RENAME SCRIPT | Renames a script to a new name. |
| RUN | Runs a script. |
| UPDATE SCRIPT | Changes or adds lines to a script. |
