/*! @page command_line WiredTiger command line utility WiredTiger includes a command line utility, \c wt. @section util_global_synopsis Synopsis wt [-Vv] [-C config] [-h directory] command [command-specific arguments] @section util_global_description Description The \c wt tool is a command-line utility that provides access to various pieces of the WiredTiger functionality. @section util_global_options Options There are three global options: @par -C config Specify configuration strings for the ::wiredtiger_open function. @par -h directory Specify a database home directory. @par -V Display WiredTiger version and exit. @par -v Set verbose output. Unless otherwise described by a \c wt command, the \c wt tool exits zero on success and non-zero on error. The \c wt tool supports several commands.
@section util_backup wt backup Perform a hot backup of a database or set of data sources. The \c backup command performs a hot backup of the database, copying the database files to a \c specified directory, which can be subsequently opened as a WiredTiger database. See @ref hot_backup for more information, and @ref file_permissions for specifics on the copied file permissions. @subsection util_backup_synopsis Synopsis wt [-Vv] [-C config] [-h directory] backup [-t uri] directory @subsection util_backup_options Options The following are command-specific options for the \c backup command: @par -t uri By default, the \c backup command does a hot backup of the entire database; the \c -t option changes the \c backup command to do a hot backup of only the named data sources.
@section util_compact wt compact Compact a table or file. The \c compact command attempts to rewrite the specified table or file to consume less disk space. @subsection util_compact_synopsis Synopsis wt [-Vv] [-C config] [-h directory] compact uri @subsection util_compact_options Options The \c compact command has no command-specific options.
@section util_create wt create Create a table or file. The \c create command creates the specified \c uri with the specified configuration. It is equivalent to a call to WT_SESSION::create with the specified string arguments. @subsection util_create_synopsis Synopsis wt [-Vv] [-C config] [-h directory] create [-c config] uri @subsection util_create_options Options The following are command-specific options for the \c create command: @par -c Include a configuration string to be passed to WT_SESSION::create.
@section util_drop wt drop Drop a table or file. The \c drop command drops the specified \c uri. It is equivalent to a call to WT_SESSION::drop with the "force" configuration argument. @subsection util_drop_synopsis Synopsis wt [-Vv] [-C config] [-h directory] drop uri @subsection util_drop_options Options The \c drop command has no command-specific options.
@section util_dump wt dump Export data in a text format. The \c dump command outputs the specified table in a portable format which can be re-loaded into a new table using the \c load command. See @subpage dump_formats for details of the dump file formats. @subsection util_dump_synopsis Synopsis wt [-Vv] [-C config] [-h directory] dump [-rx] [-c checkpoint] [-f output] uri @subsection util_dump_options Options The following are command-specific options for the \c dump command: @par -c By default, the \c dump command opens the most recent version of the data source; the \c -c option changes the \c dump command to open the named checkpoint. @par -f By default, the \c dump command output is written to the standard output; the \c -f option re-directs the output to the specified file. @par -r Dump in reverse order, from largest key to smallest. @par -x Dump all characters in a hexadecimal encoding (the default is to leave printable characters unencoded).
@section util_list wt list List the tables and files in the database. By default, the \c list command prints out the tables and files stored in the database. If a URI is specified as an argument, only information about that data source is printed. @subsection util_list_synopsis Synopsis wt [-Vv] [-C config] [-h directory] list [-cv] [uri] @subsection util_list_options Options The following are command-specific options for the \c list command: @par -c If the \c -c option is specified, the data source's checkpoints are printed in a human-readable format. @par -v If the \c -v option is specified, the data source's complete schema table value is printed.
@section util_load wt load Load a table or file from dump output. The \c load command reads the standard input for data and loads it into a table or file, creating the table or file if it does not yet exist. The data should be the format produced by the \c dump command; see @ref dump_formats for details. By default, if the table or file already exists, data in the file or table will be overwritten by the new data (use the \c -n option to make an attempt to overwrite existing data return an error). @subsection util_load_synopsis Synopsis wt [-Vv] [-C config] [-h directory] load [-an] [-f input] [-r name] [uri configuration ...] @subsection util_load_options Options The following are command-specific options for the \c load command: @par -a If the \c -a option is specified, record number keys in the input are ignored and the data is appended to the data source and assigned new record number keys. The \c -a option is only applicable when loading into a column store. @par -f By default, the \c load command reads from the standard input; the \c -f option reads the input from the specified file. @par -n By default, input data will overwrite existing data where the key/value pair already exists in the data source; the \c -n option causes the \c load command to fail if there's an attempt to overwrite already existing data. @par -r By default, the \c load command uses the table or file name taken from the input; the \c -r option renames the data source. Additionally, \c uri and \c configuration pairs may be specified to the \c load command. Each of these pairs will be appended to the configuration string from the dump header passed to the WT_SESSION::create call.
@section util_loadtext wt loadtext Load text into a table or file. The \c loadtext command reads the standard input for text and loads it into a table or file. The input data should be printable characters, with newline delimiters for each key or value. The \c loadtext command does not create the file if it does not yet exist. In the case of inserting values into a column-store table or file, each value is appended to the table or file; in the case of inserting values into a row-store table or file, lines are handled in pairs, where the first line is the key and the second line is the value. If the row-store table or file already exists, data in the table or file will be overwritten by the new data. @subsection util_loadtext_synopsis Synopsis wt [-Vv] [-C config] [-h directory] loadtext [-f input] @subsection util_loadtext_options Options The following are command-specific options for the \c loadtext command: @par -f By default, the \c loadtext command reads from the standard input; the \c -f option reads the input from the specified file.
@section util_printlog wt printlog Display the database log. The \c printlog command outputs the database log. @subsection util_printlog_synopsis Synopsis wt [-Vv] [-C config] [-h directory] printlog [-p] [-f output] @subsection util_printlog_options Options The following are command-specific options for the \c printlog command: @par -f By default, the \c printlog command output is written to the standard output; the \c -f option re-directs the output to the specified file. @par -p Display the log in a printable format.
@section util_read wt read Read records from a table or file. The \c read command prints out the records associated with the specified keys from the specified data source. The data source must be configured with string or record number keys and string values. The \c read command exits non-zero if a specified record is not found. @subsection util_read_synopsis Synopsis wt [-Vv] [-C config] [-h directory] read uri key ... @subsection util_read_options Options The \c read command has no command-specific options.
@section util_rename wt rename Rename a table or file. The \c rename command renames the specified table or file. @subsection util_rename_synopsis Synopsis wt [-Vv] [-C config] [-h directory] rename uri name @subsection util_rename_options Options The \c rename command has no command-specific options.
@section util_salvage wt salvage Recover data from a corrupted file. The \c salvage command salvages the specified data source, discarding any data that cannot be recovered. Underlying files are re-written in place, overwriting the original file contents. @subsection util_salvage_synopsis Synopsis wt [-Vv] [-C config] [-h directory] salvage [-F force] uri @subsection util_salvage_options Options The following are command-specific options for the \c salvage command: @par -F By default, salvage will refuse to salvage files that fail basic tests (for example, files that don't appear to be in a WiredTiger format). The \c -F option forces the salvage of the file, regardless.
@section util_stat wt stat Display database or data source statistics. The \c stat command outputs run-time statistics for the WiredTiger engine, or, if specified, for the URI on the command-line. @subsection util_stat_synopsis Synopsis wt [-Vv] [-C config] [-h directory] stat [-a] [uri] @subsection util_stat_options Options The following are command-specific options for the \c stat command: @par -a Include all statistics in the output (equivalent to passing statistics=(all)) to WT_SESSION::open_cursor.
@section util_upgrade wt upgrade Upgrade a table or file. The \c upgrade command upgrades the specified table or file, exiting success if the data source is up-to-date, and failure if the data source cannot be upgraded. @subsection util_upgrade_synopsis Synopsis wt [-Vv] [-C config] [-h directory] upgrade uri @subsection util_upgrade_options Options The \c upgrade command has no command-specific options.
@section util_verify wt verify Check the structural integrity of a table or file. The \c verify command verifies the specified table or file, exiting success if the data source is correct, and failure if the data source is corrupted. @subsection util_verify_synopsis Synopsis wt [-Vv] [-C config] [-h directory] verify uri @subsection util_verify_options Options The \c verify command has no command-specific options.
@section util_write wt write Write records to a table or file. The \c write command stores records into the specified data source. The data source must be configured with string or record number keys and string values. If the \c write command is called with the \c -a option, each command-line argument is a single value to be appended to the specified column-store data source. If the \c write command is not called with the \c -a option, the command-line arguments are key/value pairs. Attempting to overwrite an already existing record will fail. @subsection util_write_synopsis Synopsis wt [-Vv] [-C config] [-h directory] write -a uri value ...
wt [-Vv] [-C config] [-h directory] write [-o] uri key value ...
@subsection util_write_options Options The following are command-specific options for the \c write command: @par -a Append each value as a new record in the data source. @par -o By default, attempting to overwrite an already existing record will fail. The \c -o option changes \c write to overwrite previously existing records. */