wt(3)
π wt(3) β the WiredTiger command line utility π
okay bestie, gather round, because this is the manual page for wt(3) from WiredTiger, and it's literally the whole toolkit in one little command. no cap.
πΈ NAME πΈ
wt β the WiredTiger command line utility. WiredTiger includes a command line utility, wt. (yes, the original NAME line squished them together, we're keeping the energy but not the typo-smoosh π
)
β¨ 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. it's giving "one command to rule them all", fr fr. β¨
π OPTIONS π
There are several global options, and here they are, every single one:
-C configβ specify configuration strings for thewiredtiger_openfunction.-E secretkeyβ specify an encryption secret key for thewiredtiger_openfunction.-h directoryβ specify a database home directory.-Lβ forcibly turn off the logging subsystem, for debugging purposes.-Rβ run recovery if the underlying database is configured to do so.-Vβ display the WiredTiger version and exit.-vβ set verbose output.
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 you want 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. lowkey makes sense right? π§
π wt alter
Alter a table.
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] alter uri
configuration ...
The uri and configuration pairs may be specified to the alter command. These configuration pairs can be used to modify the configuration values from those passed to the WT_SESSION::create call.
The uri part of the configuration pair should match only one of the objects being altered, 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 altering a single table named xxx.
table access_pattern_hint=sequential
table:xxx access_pattern_hint=sequential
It's an error, however, to specify a matching prefix that matches more than a single object being altered. π¨
Multiple configuration arguments may be specified. For example, the following two sets of configuration pairs are equivalent:
table:xxx access_pattern_hint=random,cache_resident=false
table:xxx access_pattern_hint=random table:xxx cache_resident=false
π¦ wt backup
Perform a backup of a database or set of data sources.
The backup command performs a backup of the database, copying the underlying 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. it's giving "save a copy before you do something unhinged" π
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] backup [-t uri]
directory
Options
The following are command-specific options for the backup command:
-t uriβ by default, thebackupcommand does a backup of the entire database; the-toption changes thebackupcommand to do a backup of only the named data sources.
π wt compact
Compact a table.
The compact command attempts to rewrite the specified table to consume less disk space. glow-up for your storage, honestly. β¨
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] compact uri
Options
The compact command has no command-specific options.
π wt create
Create a table.
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]
uri
Options
The following are command-specific options for the create command:
-cβ include a configuration string to be passed toWT_SESSION::create.
πΈ wt drop
Drop a table.
The drop command drops the specified uri. It is equivalent to a call to WT_SESSION::drop with the 'force' configuration argument. okay so it's not asking nicely, it's just dropping it. π
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] drop uri
Options
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] uri
Options
The following are command-specific options for the dump command:
-cβ by default, thedumpcommand opens the most recent version of the data source; the-coption changes thedumpcommand to open the named checkpoint.-fβ by default, thedumpcommand output is written to the standard output; the-foption re-directs the output to the specified file.-jβ dump in JSON (JavaScript Object Notation) format.-rβ dump in reverse order, from largest key to smallest.-xβ dump all characters in a hexadecimal encoding (the default is to leave printable characters unencoded).
π§ wt list
List the tables in the database.
By default, the list command prints out the tables 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β if the-coption is specified, the data source's checkpoints are printed in a human-readable format.-vβ if the-voption is specified, the data source's complete schema table value is printed.
π wt load
Load a table from dump output.
The load command reads the standard input for data and loads it into a table, creating the table 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 already exists, data in the 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β if the-aoption 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-aoption is only applicable when loading into a column store.-fβ by default, theloadcommand reads from the standard input; the-foption reads the input from the specified file.-jβ load input in the JSON (JavaScript Object Notation) format that was created by thedump -jcommand.-nβ by default, input data will overwrite existing data where the key/value pair already exists in the data source; the-noption causes theloadcommand to fail if there's an attempt to overwrite already existing data.-rβ by default, theloadcommand uses the table name taken from the input; the-roption renames the data source.
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.
The loadtext command reads the standard input for text and loads it into a table. The input data should be printable characters, with newline delimiters for each key or value.
The loadtext command does not create the object if it does not yet exist.
In the case of inserting values into a column-store table, each value is appended to the table; in the case of inserting values into a row-store table, lines are handled in pairs, where the first line is the key and the second line is the value. If the row-store table already exists, data in the table will be overwritten by the new data.
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] loadtext [-f input]
uri
Options
The following are command-specific options for the loadtext command:
-fβ by default, theloadtextcommand reads from the standard input; the-foption reads the input from the specified file.
π₯ wt printlog
Display the database log.
The printlog command outputs the database log.
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] printlog [-x] [-f
output]
Options
The following are command-specific options for the printlog command:
-fβ by default, theprintlogcommand output is written to the standard output; the-foption re-directs the output to the specified file.-xβ keys and value items in the log are printed in hex format in addition to the default string format.
β wt read
Read records from a table.
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.
The rename command renames the specified table. main character energy, but for tables. π
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] rename uri name
Options
The rename command has no command-specific options.
π wt salvage π
Recover data from a corrupted table. Bestie, it's giving emergency room energy. π
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.
β οΈ Not me warning you twice: the files get rewritten in place, and the original file contents get overwritten. So likeβ¦ that's the whole point, but also π« make a copy first, iykyk.
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] salvage [-F] uri
Options
The following are command-specific options for the salvage command:
-Fβ By default,salvagewill refuse to salvage tables that fail basic tests (for example, tables that don't appear to be in a WiredTiger format). The-Foption forces the salvage of the table, regardless. πͺ
π 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. Numbers go brrr. β¨
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] stat [-f] [uri]
Options
The following are command-specific options for the stat command:
-fβ Include only 'fast' statistics in the output (equivalent to passingstatistics=(fast)toWT_SESSION::open_cursor). Fast stats, no waiting, slay. πββοΈπ¨
βοΈ wt truncate βοΈ
Truncate a table, removing all data. Poof. Gone. Not me deleting the whole thing and feeling nothing. π
The truncate command truncates the specified uri. It is equivalent to a call to WT_SESSION::truncate with no start or stop specified.
Synopsis
wt [-RVv] [-C config] [-E secretkey ] [-h directory] truncate uri
Options
The truncate command has no command-specific options. Simple. Iconic. No notes. π
β¬οΈ wt upgrade β¬οΈ
Upgrade a table. Glow-up but for your data source. β¨π¦
The upgrade command upgrades the specified table, 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 uri
Options
The upgrade command has no command-specific options.
π wt verify π
Check the structural integrity of a table. It's the vibe check but for your data. π«Ά
The verify command verifies the specified table, 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 uri
Options
The verify command has no command-specific options.
βοΈ wt write βοΈ
Write records to a table. Main character energy: you're the one putting the data there. π
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. Like, it will not let you. Unless you read the next bit π
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β Append each value as a new record in the data source. Just keep adding, bestie, there's room. πΈ-oβ By default, attempting to overwrite an already existing record will fail. The-ooption changeswriteto overwrite previously existing records. Permission to be a little destructive, as a treat. π
And that's a wrap on the whole wt situation, bestie!! ππ«Ά You now know every command, every flag, every cursed little caveat, fr fr. Go forth and be lowkey the most dangerous person in the terminal. β¨
This was Version 3.2.1, dated Tue Aug 27 2019, and you can find it hanging out at wt(3). Obsessed. Bye bestie!! ππ
π¦ where this page comes from
- debian bookworm: wiredtiger 3.2.1-1 Β· GPL-2.0-or-later
- debian trixie: wiredtiger 3.2.1-1 Β· GPL-2.0-or-later
- ubuntu jammy: wiredtiger 3.2.1-1ubuntu1 Β· GPL-2.0-or-later
- ubuntu noble: wiredtiger 3.2.1-1ubuntu1 Β· GPL-2.0-or-later
- ubuntu questing: wiredtiger 3.2.1-1ubuntu4
- ubuntu resolute: wiredtiger 3.2.1-1ubuntu5 Β· GPL-2.0-or-later
- ubuntu stonking: wiredtiger 3.2.1-1ubuntu5 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms