Tivoli Header

Administrator's Reference

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

An administrator can issue this command unless it includes the OUTPUTFILE parameter. 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

                 .-*-----------.  .-FORMAT--=--Standard-----.
>>-Query SCRipt--+-------------+--+-------------------------+--->
                 '-script_name-'  '-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.

Attention: 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.

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.

Examples

Task 1

Display the standard information about scripts.

Command:
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           |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

Task 2

Display the lines information for a script named Q_AUTHORITY.

Command:
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'                                        |
+--------------------------------------------------------------------------------+

Task 3

Display detailed information about scripts.

Command:
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                             |
+--------------------------------------------------------------------------------+

where:

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.

Task 4

Query the ENGDEV script and direct the output to a file named MY.SCRIPT .

Command:
query script engdev format=raw outputfile=my.script

Task 5

Create a new script by using the contents from file, MY.SCRIPT . Name the new script AGADM.

Command:
define script agadm file=my.script

Related Commands

Table 207. 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.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]