17.10 - Syntax - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Database Utilities

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Publication ID
English (United States)
cnsrun {
    { -utility uname | -join uname -screen number }
      { -file file_name | -commands clist }
      [ -machine host_name ]
      [ -force ]
      [ -ok ]
      [ -multi ]
      [ -nostop ]
      [ -prompt string ]
      [ -tool cns_tool_path ] |

      -query |

  } [ -debug n | -output ] [ -log file ] |


Syntax Elements

-utility uname
Specifies the utility program to start.
-join uname
Specifies the name of an already running database utility.
-screen number
Specifies the screen number where a utility that is to be joined is already running. -screen must be used only with the -join option.
-file file_name
Specifies a file that contains input commands to send to the utility program.
-commands clist
Specifies the commands to send to the utility.

Each command must be enclosed within braces { }, and there must be one or more spaces between commands.

If there is more than one command, enclose clist in double quotation marks.
-machine host_name
The host name associated with the Control Node for the TPA instance on which to run the utility program. The Control Node is the node running with the lowest Node ID number. The Control Node can move between TPA restarts. To determine the name of the Control Node, type cnscim -host at the command prompt.

The default is localhost, which only works on SMP systems or when the program is actually running on the Control Node of an MPP system.

This utility is to be started even if the database software is not running.
This utility is to be started even if logons are disabled.

In the absence of this option and the -force option, the utility is not started if logons are not enabled.

Permits more than one instance of the specified utility program to run simultaneously. Without the -multi option, cnsrun fails to start a utility if an instance of the utility is already running.
Considers the operation successful even if the utility continues to run after all input is exhausted.
-prompt string
When running a database utility that accepts input after a text prompt, this switch is required to enable cnsrun to know when to send input.

String is a regular expression that allows cnsrun to recognize an input prompt from the utility. For more information, see Regular Expressions for the -prompt Option.

-tool cns_tool_path
The full path to the cnstool program.
-debug n
Specifies the level of debug output that will be shown on screen.

A value of 0 (the default) shows no output if the utility runs successfully.

A value of 1 shows the utility program output and its state changes.

Other larger values of n produce additional debugging output. All output, including error messages, appears in STDOUT, the standard console output.

The utility output should be directed to STDOUT, the standard console output.
The -output option is effective only when the -debug option is set to zero.
-log logfile
Produces a log of the utility run to the specified file.
Displays the names of the utilities currently running in each of the screens, after which cnsrun exits.
Displays information on how to use cnsrun.