---
name: "dbwrap_tool"
section: "1"
platform: "linux"
package: "samba"
version: "2:4.25.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/dbwrap_tool"
---

# dbwrap\_tool(1)

low level TDB/CTDB manipulation tool using the dbwrap interface

## NAME

dbwrap\_tool - low level TDB/CTDB manipulation tool using the dbwrap interface

## SYNOPSIS

dbwrap\_tool \[-?\|--help\] \[--usage\] \[--persistent\] \[--non-persistent\] \[-d\|--debuglevel=DEBUGLEVEL\] \[--debug-stdout\] \[--configfile=CONFIGFILE\] \[--option=name=value\] \[-l\|--log-basename=LOGFILEBASE\] \[--leak-report\] \[--leak-report-full\] {\<database\>} {\<operation\>} \[\<key\> \[\<type\> \[\<value\>\]\]\]

## DESCRIPTION

This tool is part of the [**samba**(7)](/samba/7.md) suite.

The dbwrap\_tool program is used to read and manipulate TDB/CTDB databases using the dbwrap interface.

The following database operations are available:

• fetch: fetch a record

• store: create or modify a record

• delete: remove a record

• exists: test for existence of a record

• erase: remove all records

• listkeys: list all available records

• listwatchers: list processes, which are waiting for changes in a record

The following types are available:

• int32: signed 32bit integer

• uint32: unsigned 32bit integer

• string: "hello world"

• hex: hex strings like "68656C6C6F20776F726C6400" ("hello world")

## OPTIONS

- \--persistent

  Open the database as a persistent database.

  Exactly one of --persistent and --non-persistent must be specified.

- \--non-persistent

  Open the database as a non-persistent database.

  Caveat: opening a database as non-persistent when there is currently no other opener will wipe the database.

  Exactly one of --persistent and --non-persistent must be specified.

\-?\|--help

Print a summary of command line options.

- \--usage

  Display brief usage message.

\-d\|--debuglevel=level

*level* is an integer from 0 to 10. The default value if this parameter is not specified is 1 for client applications.

The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day-to-day running - it generates a small amount of information about operations carried out.

Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

Note that specifying this parameter here will override the **log level** parameter in the /etc/samba/smb.conf file.

- \--debug-stdout

  This will redirect debug output to STDOUT. By default all clients are logging to STDERR.

\--configfile=\<configuration file\>

The file specified contains the configuration details required by the client. The information in this file can be general for client and server or only provide client specific like options such as **client smb encrypt**. See /etc/samba/smb.conf for more information. The default configuration file name is determined at compile time.

- \--option=\<name\>=\<value\>

  Set the [**smb.conf**(5)](/smb.conf/5.md) option "\<name\>" to value "\<value\>" from the command line. This overrides compiled-in defaults and options read from the configuration file. If a name or a value includes a space, wrap whole --option=name=value into quotes.

\-l\|--log-basename=logdirectory

Base directory name for log/debug files. The extension **".progname"** will be appended (e.g. log.smbclient, log.smbd, etc...). The log file is never removed by the client.

- \--leak-report

  Enable talloc leak reporting on exit.

- \--leak-report-full

  Enable full talloc leak reporting on exit.

\-V\|--version

Prints the program version number.

## COMMANDS

### fetch

dbwrap\_tool \<database\> fetch \<key\> \<type\>

### store

dbwrap\_tool \<database\> store \<key\> \<type\> \<value\>

### delete

dbwrap\_tool \<database\> delete \<key\>

### exists

dbwrap\_tool \<database\> exists \<key\>

### erase

dbwrap\_tool \<database\> erase

### listkeys

dbwrap\_tool \<database\> listkeys

### listwatchers

dbwrap\_tool \<database\> listwatchers

## EXAMPLES

List all keys from winbindd\_idmap.tdb

dbwrap\_tool --persistent winbindd\_idmap.tdb listkeys

Fetch record with key "USER HWM" as uint32

dbwrap\_tool --persistent winbindd\_idmap.tdb fetch "USER HWM" uint32

Remove record with key "USER HWM"

dbwrap\_tool --persistent winbindd\_idmap.tdb remove "USER HWM"

Store and overwrite record "USER HWM" with value 214

uint32: dbwrap\_tool --persistent winbindd\_idmap.tdb store "USER HWM" uint32 214 hex: dbwrap\_tool --persistent winbindd\_idmap.tdb store "USER HWM" hex D6000000

## NOTES

Use with caution!

## VERSION

This man page is part of version 4.25.1 of the Samba suite.

## SEE ALSO

[**smbd**(8)](/smbd/8.md), [**samba**(7)](/samba/7.md)

## AUTHOR

The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed.

The dbwrap\_tool manpage was written by Bjoern Baumbach.
