15.00 - dbschk - Teradata Database

Teradata Database Utilities

Product
Teradata Database
Release Number
15.00
Content Type
Configuration
Publication ID
B035-1102-015K
Language
English (United States)
Last Update
2018-09-25

dbschk

Purpose  

dbschk monitors Teradata Database response time. If the response time indicates the database is slow or unresponsive, dbschk runs a specified program or script, and logs an event.

The factory default settings for dbschk options can be changed using command-line options. Settings specified on the command line can be optionally saved as new default settings for dbschk. New defaults persist across sessions, and are propagated to all nodes of MPP systems. The -reset option restores the factory default settings.

Syntax  

 

Syntax Element

Description

-delay sleep_seconds

Sets the time that dbschk waits between successful executions of the all‑AMP requests to Teradata Database.

sleep_seconds in a positive integer that specifies the number of seconds dbschk waits. The factory default is 1200 seconds.

Note: Setting a very low value for -delay can adversely affect system performance.

-h

Displays a short description of dbschk and the command-line options.

-job job_program

Specifies the program or script dbschk runs to check Teradata Database response time. The specified program or script should generate an all‑AMP request.

Note: job_program should specify the complete path to the program or script, and any optional command-line parameters you wish to use to start the program. If job_options includes any space characters, enclose the entire job_options specification within double quotation marks.

Default dbschk settings are used by all nodes of MPP systems. If you use the -save option to store the current -job setting as a custom default, ensure that the specified program or script exists on all nodes.

-l

Displays the current default and factory default dbschk settings. The current default settings are used when dbschk is run with no command-line options.

-logfile file

Specifies log file dbschk will use. All dbschk program output is directed to this file. If the file does not exist, dbschk will create it.

Note: file should specify the complete path to the log file. If the path includes any space characters (for example, “Program Files”), enclose the entire file specification within double quotation marks.

To have dbschk output displayed on screen, specify file as stdout.

If you do not specify a -logfile on the command line, dbschk will use the file specified as the current default logfile. Use the -l option to see the current dbschk default values.

The factory default log file is:
/var/opt/teradata/tdtemp/dbschk.log.

Note: Instances of dbschk log to the logfile that is in effect when they are started. Multiple instances of dbschk can share the same log, or use different logs. For example, an instance of dbschk can be started automatically when Teradata Database starts and set to log to a file, while other instances of dbschk can be run from the command-line using the -logfile option to have the dbschk output directed to the screen (stdout).

-logflush flush_seconds

Specifies the time after which the log file is flushed and overwritten with new output from dbschk.

flush_time is a positive integer that specifies the number of seconds between log flushes. The factory default is 3600 seconds.

Note: Setting a very low a value for ‑logflush can adversely affect system performance. Setting a very high value can result in a very large log file.

-n iterations

Specifies the number of times dbschk runs. If -n is not specified, dbschk runs continuously until stopped by the user.

iterations is a positive integer greater than zero.

-power switch

Determines whether dbschk can run.

switch can be OFF or ON.

  • OFF prevents dbschk from running both from the command line and automatically the next time Teradata Database starts.
    This is the default.
  • ON allows dbschk to run from the command-line. If the -save option is used to make ON the new default -power setting, dbschk will be started automatically whenever Teradata Database starts.
  • OFF and ON can be entered in upper, lower, or mixed case. 0 can be used as a substitute for OFF, and 1 can be used as a synonym for ON.

    -rate attempts

     

    Specifies the number of times that dbschk executes an all‑AMP request and waits for a response before running the program specified by the ‑trigger parameter.

    attempts is a positive integer. The factory default is 5.

    -reset

     

    Restores the dbschk factory default settings. To see the factory default settings, use the -l option.

    Note: The default dbschk settings are global to the system. They are used when dbschk is run from any node of MPP system.

    -save

    Saves the settings that are specified on the command line as new default values for subsequent runs of dbschk from any node of the system. If the -save parameter is not specified on the command line, other command-line parameters are only in effect for the current run of dbschk.

    When -save is included on the command-line, dbschk does not check database responsiveness, but instead only saves the current command-line settings as new dbschk default values.

    Note: The default dbschk settings are global to the system. They are used when dbschk is run from any node of MPP system. If you use the ‑save option to store current ‑job or ‑trigger settings as defaults, ensure the specified programs or scripts exist on all nodes of the system.

    -timeout wait_seconds

     

    Specifies how long dbschk waits for a response from Teradata Database after running the program specified by the ‑job option. Once the time specified by ‑timeout has elapsed with no response from the database, dbschk runs -job again. As long as there is no response from the database, dbschk continues trying ‑job the number of times specified by the ‑rate parameter before running the program specified by the ‑trigger parameter.

    wait_seconds is a positive integer. The factory default is 300 seconds.

    Note: Setting a very low a value for -timeout is impractical, and can adversely affect system performance.

    -trigger trigger_program

    Specifies a program or script to run if there is no response from Teradata Database after dbschk has tried the number of times specified by ‑rate, and, for each attempt, has waited the time period specified by the ‑timeout parameter.

    Note: Default dbschk settings are used by all nodes of MPP systems. If you use the -save option to store the current -trigger setting as a custom default, ensure that the specified program or script exists on all nodes.

    Usage Notes  

    Parameters set on the dbschk command line are valid only for the current session unless the ‑save parameter is used.

    To see the current and factory default settings, use dbschk -l.

    When dbschk starts, if the log file is 5MB or larger, dbschk flushes the current log entries to a new file that has .old appended to the original log file name. Logging continues to the original log file. For example, when an original log file named myfile.log grows to 5MB, the entries are moved from myfile.log to myfile.log.old, and logging continues to myfile.log. The next time myfile.log reaches 5MB, the information is flushed again to myfile.log.old, overwriting the information that was in the .old file.

    Example  

    The following example uses the -l option to display the current dbschk default settings.

    > dbschk -l
     
    Current default values :
            power    : ON
            timeout  : 120 seconds
            rate     : 3 trials
            delay    : 600 seconds
            logflush : 1200 seconds
            job      : csp -mode list -source table
            logfile  : /var/opt/teradata/tdtemp/dbschk.log
            trigger  : pdestate -a
    Factory default values :
            power    : OFF
            timeout  : 300 seconds
            rate     : 5 trials
            delay    : 1200 seconds
            logflush : 3600 seconds
            job      : csp -mode list -source table
            logfile  : /var/opt/teradata/tdtemp/dbschk.log
            trigger  : pdestate -a

    Example  

    The following example runs dbschk with the -save option, setting the default values to allow dbschk to run and to send dbschk output to the computer screen.

    >dbschk -save -power ON -logfile stdout
     
    Current default values :
            power    : ON
            timeout  : 300 seconds
            rate     : 5 trials
            delay    : 1200 seconds
            logflush : 3600 seconds
            job      : csp -mode list -source table
            logfile  : stdout
            trigger  : pdestate -a
    Factory default values :
            power    : OFF
            timeout  : 300 seconds
            rate     : 5 trials
            delay    : 1200 seconds
            logflush : 3600 seconds
            job      : csp -mode list -source table
            logfile  : D:\Program Files\Teradata\Tdat\TdTemp\dbschk.log
            trigger  : pdestate -a


    Do you want to save the new settings as dbschk default values? (y/n): y
    New settings saved...

    (dbschk): Normal termination - OK

    Example  

    The following example runs dbschk to check database responsiveness. The command-line settings cause dbschk to run two times, waiting five seconds between runs.

    >dbschk -n 2 -delay 5

    (dbschk): current default values :
            power    : ON
            timeout  : 300 seconds
            rate     : 5 trials
            delay    : 5 seconds
            logflush : 3600 seconds
            job      : csp -mode list -source table
            logfile  : stdout
            trigger  : pdestate -a
    Factory default values:
            power    : OFF
            timeout  : 300 seconds
            rate     : 5 trials
            delay    : 1200 seconds
            logflush : 3600 seconds
            job      : csp -mode list -source table
            logfile  : /var/opt/teradata/tdtemp/dbschk.log
            trigger  : pdestate -a

    csp: Searching for dumps in Teradata database Crashdumps on the local system
    csp: 3 dumps found, 3 dumps to process
    csp: Sel   ID (date-time-token)   Nodes  Event  Instigator
    csp: ---  ----------------------  -----  -----  ------------------------
    csp:  *   2007/05/24-09:23:57-04      1  10416  16383/13/(12351)
    csp:  *   2007/05/24-09:23:41-03      1  10416  16383/13/(12191)
    csp:  *   2007/05/24-09:15:30-01      1  10196  16384/0/(11215)


    (dbschk): retstatus = 1010, status = 0, childpid = 1010
    (dbschk): Sample Query finished normally, response time=3 seconds,

    (dbschk): sleep 5 seconds before restart.
    csp: Searching for dumps in Teradata database Crashdumps on the local system
    csp: 3 dumps found, 3 dumps to process
    csp: Sel   ID (date-time-token)   Nodes  Event  Instigator
    csp: ---  ----------------------  -----  -----  ------------------------
    csp:  *   2007/05/24-09:23:57-04      1  10416  16383/13/(12351)
    csp:  *   2007/05/24-09:23:41-03      1  10416  16383/13/(12191)
    csp:  *   2007/05/24-09:15:30-01      1  10196  16384/0/(11215)

    (dbschk): retstatus = 1020,  status = 0, childpid = 1020
    (dbschk): Sample Query finished normally, response time=2 seconds,

    (dbschk): Normal termination - OK