.
contact contact


dbctl utility

» Usage | Notes | Examples | See also
 
.
  The dbctl utility allows access to a running eloqdb process. It is used to control server operation or retrieve database server status information. The list of available commands and options depends on the version of the target database server.

dbctl implements an administrative communication channel with the database server, submits the command and outputs the reply. It does not implement the command functionality itself. Consequently, the supported commands depend on the database server. Please refer to the database server version specific dbctl documentation for a list of supported commands.

An alternative to obtain status information from the database server is to use the HTTP status. After enabling the "ServiceHttp" option in the eloqdb configuration file, a web browser may be used to monitor the current status of the database server.

Usage

dbctl [options] [command [arg ...]]

options:
 -help        - show usage (this list)
 -u name      - user name
 -p pswd      - password
 -h host      - host name or address
 -s service   - service name or port number
 -d flags     - debug flags
 -i           - input mode (read commands from stdin)
 -e           - do not echo commands in input mode

commands:
 help         - show list of available commands
 help command - show usage of specific command
 exit         - exit input mode

The options are:

-i
If the -i option is present, any dbctl commands are read from stdin rather than the command line. This allows a single dbctl invocation to to execute multiple server commands.

In this case the exit command (or an EOF condition) may be used to exit from dbctl. A leading "#" or "!" indicates a comment and the line is ignored.

Any commands read from stdin are echoed if stdin is not connected to a tty device (script use). The option -e may be used to disable the command echo.

When stdin is not connected to a tty device (batch use) dbctl will exit if a command failure is encountered.

-e
The dbctl option -e may be used to suppress the command echo when the dbctl -i option is used. By default, any commands read from stdin are echoed if stdin is not connected to a tty device (script use). The option -e may be used to disable the command echo.

-u user
The -u option specifies the database user (or a file holding the database user and/or password). Defaults to the public user unless a default user is specified with the EQ_DBUSER environment variable.

-p password
The -p option may be used to specify the password for the database user (or a file holding the password). If not specified, the password is obtained using the EQ_DBUSER and/or EQ_DBPASSWORD environment variables.

-h host[:service]
The -h option may be used to specify the database server host name (or IP address) and service name (or TCP port number). Defaults to localhost:eloqdb unless a default instance is specified with the EQ_DBSERVER environment variable.

-s service
The -s option may be used to specify the service name or TCP port number of the database server. Defaults to eloqdb unless a default instance is specified with the EQ_DBSERVER environment variable.

Notes

The exit codes issued by dbctl are:
  • 0 - successful execution of remote command
  • 1 - failed connecting to database server
  • 2 - invalid (or -help) command line option
  • 3 - database server returned command error

Examples

The example below uses the dbctl help command to request the syntax of the backup command from the database server.
$ dbctl help backup
usage: backup {START|STOP|STATUS}

The example below uses the dbctl backup status command to requests the backup status of the database server.

$ dbctl backup status
On-line backup mode is inactive.

The example below obtains a list of blocked database locks for the toydb database from database server.

$ dbctl list lock "db=toydb" "status=blocked"
TID Database         DBID Status  Mode Qualifier
--- ---------------- ---- ------- ---- ---------------
  9 toydb               1 BLOCKED    6 expression
set=1 item=@ (effective set lock)

The example below demonstrates the dbctl -i mode in a script to obtain slave server replication status repeatedly every 10 seconds:

while :; do echo replication monitor; sleep 10; done | dbctl -ie 
The script will send the command "replication monitor" every 10 seconds to dbctl. dbctl submits the command to the server and outputs the result.

See also

List of supported dbctl commands (database server version specific).


 
 
 
  Privacy | Webmaster | Terms of use | Impressum Revision: 2014-08-01  
  Copyright © 1995-2021 Marxmeier Software AG