wt(3) | WiredTiger | wt(3) |
NAME¶
wtWiredTiger command line utility - WiredTiger includes a command line utility, wt.SYNOPSIS¶
wt [-LRVv] [-C config] [-E secretkey ] [-h directory] command [command-specific arguments]DESCRIPTION¶
The wt tool is a command-line utility that provides access to various pieces of the WiredTiger functionality.OPTIONS¶
There are several global options:-C config
-E secretkey
-h directory
-L
-R
-V
-v
Unless otherwise described by a wt command, the wt tool exits zero on success and non-zero on error.
The wt tool supports several commands. If configured in the underlying database, some commands will run recovery when opening the database. If the user wants to force recovery on any command, use the -r option. In general, commands that modify the database or tables will run recovery by default and commands that only read data will not run recovery.
wt backup¶
Perform a backup of a database or set of data sources.The backup command performs a backup of the database, copying the database files to a specified directory, which can be subsequently opened as a WiredTiger database. See Backups for more information, and File permissions for specifics on the copied file permissions.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] backup [-t uri] directoryOptions¶
The following are command-specific options for the backup command:-t uri
wt compact¶
Compact a table or file.The compact command attempts to rewrite the specified table or file to consume less disk space.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] compact uriOptions¶
The compact command has no command-specific options.wt create¶
Create a table or file.The create command creates the specified uri with the specified configuration. It is equivalent to a call to WT_SESSION::create with the specified string arguments.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] create [-c config] uriOptions¶
The following are command-specific options for the create command:-c
wt drop¶
Drop a table or file.The drop command drops the specified uri. It is equivalent to a call to WT_SESSION::drop with the 'force' configuration argument.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] drop uriOptions¶
The drop command has no command-specific options.wt dump¶
Export data in a text format.The dump command outputs the specified table in a portable format which can be re-loaded into a new table using the load command.
See Dump Formats for details of the dump file formats.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] dump [-jrx] [-c checkpoint] [-f output] uriOptions¶
The following are command-specific options for the dump command:-c
-f
-j
-r
-x
wt list¶
List the tables and files in the database.By default, the 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.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] list [-cv] [uri]Options¶
The following are command-specific options for the list command:-c
-v
wt load¶
Load a table or file from dump output.The 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 dump command; see 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 -n option to make an attempt to overwrite existing data return an error).
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] load [-ajn] [-f input] [-r name] [uri configuration ...]Options¶
The following are command-specific options for the load command:-a
-f
-j
-n
-r
Additionally, uri and configuration pairs may be specified to the load command. These configuration pairs can be used to modify the configuration values from the dump header passed to the WT_SESSION::create call.
The uri part of the configuration pair should match only one of the objects being loaded, but may be a prefix of the object being matched. For example, the following two sets of configuration pairs are equivalent in the case of loading a single table named xxx.
table block_allocation=first table:xxx block_allocation=first
It's an error, however, to specify a matching prefix that matches more than a single object being loaded.
Multiple configuration arguments may be specified. For example, the following two sets of configuration pairs are equivalent:
table:xxx block_allocation=first,prefix_compress=false table:xxx block_allocation=first table:xxx prefix_compress=false
wt loadtext¶
Load text into a table or file.The 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 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.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] loadtext [-f input]Options¶
The following are command-specific options for the loadtext command:-f
wt printlog¶
Display the database log.The printlog command outputs the database log.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] printlog [-p] [-f output]Options¶
The following are command-specific options for the printlog command:-f
-p
wt read¶
Read records from a table or file.The 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 read command exits non-zero if a specified record is not found.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] read uri key ...Options¶
The read command has no command-specific options.wt rename¶
Rename a table or file.The rename command renames the specified table or file.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] rename uri nameOptions¶
The rename command has no command-specific options.wt salvage¶
Recover data from a corrupted file.The 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.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] salvage [-F force] uriOptions¶
The following are command-specific options for the salvage command:-F
wt stat¶
Display database or data source statistics.The stat command outputs run-time statistics for the WiredTiger engine, or, if specified, for the URI on the command-line.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] stat [-f] [uri]Options¶
The following are command-specific options for the stat command:-f
wt upgrade¶
Upgrade a table or file.The 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.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] upgrade uriOptions¶
The upgrade command has no command-specific options.wt verify¶
Check the structural integrity of a table or file.The verify command verifies the specified table or file, exiting success if the data source is correct, and failure if the data source is corrupted.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] verify uriOptions¶
The verify command has no command-specific options.wt write¶
Write records to a table or file.The 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 write command is called with the -a option, each command-line argument is a single value to be appended to the specified column-store data source. If the write command is not called with the -a option, the command-line arguments are key/value pairs.
Attempting to overwrite an already existing record will fail.
Synopsis¶
wt [-rVv] [-C config] [-E secretkey ] [-h directory] write -a uri value ... wt [-rVv] [-C config] [-E secretkey ] [-h directory] write [-o] uri key value ...Options¶
The following are command-specific options for the write command:-a
-o
Tue Jun 16 2015 | Version 2.6.1 |