IBM Tivoli Storage Manager, Version 7.1

QUERY SCRIPT (Query Tivoli Storage Manager scripts)

Use this command to display information about scripts.

You can use this command in conjunction with the DEFINE SCRIPT command to create a new script using the contents from another script.

Privilege class

The privilege class 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

Read syntax diagramSkip visual syntax diagram
                 .-*-----------.   
>>-Query SCRipt--+-------------+-------------------------------->
                 '-script_name-'   

   .-FORMAT--=--Standard------------------------------.   
>--+--------------------------------------------------+--------><
   '-FORMAT--=--+-Standard--------------------------+-'   
                +-Lines-----------------------------+     
                +-Detailed--------------------------+     
                '-Raw--+--------------------------+-'     
                       '-Outputfile--=--file_name-'       

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 used to process this command and the amount of information 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.
Lines
Specifies that the script name, the line number of the commands, comment lines, and the commands in the script are displayed.
Detailed
Specifies that detailed information about the script is 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 using the DEFINE SCRIPT command.

If no output file is specified, the Tivoli® Storage Manager 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 you specify must reside on the server 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=lines
Name         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.script

Example: Create a script from an existing script

Create a new script by using the contents from the file MY.SCRIPT. Name the new script AGADM.
define script agadm file=my.script

Example: 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 displayed in the previous field.
Last Update by (administrator)
The name of the administrator that has 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

Table 1. Commands related to QUERY SCRIPT
Command Description
COPY SCRIPT Creates a copy of a script.
DEFINE SCRIPT Defines a script to the Tivoli Storage Manager 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.


Feedback