]> git.proxmox.com Git - mirror_ovs.git/blame - ovsdb/ovsdb-tool.1.in
ovsdb-tool: Add new "db-name" and "schema-name" commands.
[mirror_ovs.git] / ovsdb / ovsdb-tool.1.in
CommitLineData
f7f62235
BP
1.\" -*- nroff -*-
2.de IQ
3. br
4. ns
5. IP "\\$1"
6..
7.\" -*- nroff -*-
d2cb6c95 8.TH ovsdb\-tool 1 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"
f7f62235
BP
9.ds PN ovsdb\-tool
10.
11.SH NAME
12ovsdb\-tool \- Open vSwitch database management utility
13.
14.SH SYNOPSIS
12b84d50 15.IP "Database Creation Commands:"
e4476f74 16\fBovsdb\-tool \fR[\fIoptions\fR] \fBcreate \fR[\fIdb\fR [\fIschema\fR]]
f7f62235 17.br
12b84d50 18.IP "Version Management Commands:"
e4476f74
BP
19\fBovsdb\-tool \fR[\fIoptions\fR] \fBconvert \fR[\fIdb\fR [\fIschema
20\fR[\fItarget\fR]]]
8159b984 21.br
e4476f74 22\fBovsdb\-tool \fR[\fIoptions\fR] \fBneeds\-conversion \fR[\fIdb\fR [\fIschema\fR]]
403e3a25 23.br
e4476f74 24\fBovsdb\-tool \fR[\fIoptions\fR] \fBdb\-version \fR[\fIdb\fR]
8159b984 25.br
e4476f74 26\fBovsdb\-tool \fR[\fIoptions\fR] \fBschema\-version \fR[\fIschema\fR]
8159b984 27.br
e4476f74 28\fBovsdb\-tool \fR[\fIoptions\fR] \fBdb\-cksum \fR[\fIdb\fR]
6aa09313 29.br
e4476f74 30\fBovsdb\-tool \fR[\fIoptions\fR] \fBschema\-cksum \fR[\fIschema\fR]
12b84d50
BP
31.IP "Other commands:"
32\fBovsdb\-tool \fR[\fIoptions\fR] \fBcompact \fR[\fIdb\fR [\fItarget\fR]]
6aa09313 33.br
e4476f74 34\fBovsdb\-tool \fR[\fIoptions\fR] \fBquery \fR[\fIdb\fR] \fItransaction\fR
f7f62235 35.br
e4476f74 36\fBovsdb\-tool \fR[\fIoptions\fR] \fBtransact \fR[\fIdb\fR] \fItransaction\fR
f7f62235 37.br
e4476f74 38\fBovsdb\-tool \fR[\fIoptions\fR] [\fB\-m\fR | \fB\-\-more\fR]... \fBshow\-log \fR[\fIdb\fR]
722f6301 39.br
439902cb
BP
40\fBovsdb\-tool \fR[\fIoptions\fR] \fBdb\-name \fR[\fIdb\fR]
41.br
42\fBovsdb\-tool \fR[\fIoptions\fR] \fBschema\-name \fR[\fIschema\fR]
43.br
f7f62235
BP
44\fBovsdb\-tool help\fR
45.so lib/vlog-syn.man
46.so lib/common-syn.man
47.
48.SH DESCRIPTION
49The \fBovsdb\-tool\fR program is a command-line tool for managing Open
50vSwitch database (OVSDB) files. It does not interact directly with
51running Open vSwitch database servers (instead, use
52\fBovsdb\-client\fR).
12b84d50
BP
53For an introduction to OVSDB and its implementation in Open vSwitch,
54see \fBovsdb\fR(7).
55.PP
56This OVSDB implementation supports standalone and active-backup
57database service models with a common on-disk format For a
58specification of this format, see \fBovsdb\fR(5). For more
59information on OVSDB service models, see the \fBService Models\fR
60section in \fBovsdb\fR(7).
f7f62235 61.
12b84d50
BP
62.SS "Database Creation Commands"
63This command creates a new OVSDB database file.
64It will not overwrite an existing database file. To
65replace an existing database with a new one, first delete the old one.
f7f62235 66.
12b84d50
BP
67.IP "\fBcreate\fI db schema\fR"
68Use this command to create the database for controlling
69\fBovs\-vswitchd\fR or another standalone or active-backup database.
70It creates database file \fIdb\fR with the given \fIschema\fR, which
71must be the name of a file that contains an OVSDB schema in JSON
72format, as specified in the OVSDB specification. The new database is
73initially empty.
1e19e50e 74.
51738fe1 75.SS "Version Management Commands"
12b84d50 76.so ovsdb/ovsdb-schemas.man
51738fe1
BP
77.PP
78These commands work with different versions of OVSDB schemas and
79databases.
80.
1e19e50e
BP
81.IP "\fBconvert\fI db schema \fR[\fItarget\fR]"
82Reads \fIdb\fR, translating it into to the schema specified in
83\fIschema\fR, and writes out the new interpretation. If \fItarget\fR
84is specified, the translated version is written as a new file named
85\fItarget\fR, which must not already exist. If \fItarget\fR is
86omitted, then the translated version of the database replaces \fIdb\fR
12b84d50
BP
87in-place. In-place conversion cannot take place if the database is
88currently being served by \fBovsdb\-server\fR (instead, either stop
89\fBovsdb\-server\fR first or use \fBovsdb\-client\fR's \fBconvert\fR
90command).
1e19e50e
BP
91.IP
92This command can do simple ``upgrades'' and ``downgrades'' on a
93database's schema. The data in \fIdb\fR must be valid when
94interpreted under \fIschema\fR, with only one exception: data in
95\fIdb\fR for tables and columns that do not exist in \fIschema\fR are
96ignored. Columns that exist in \fIschema\fR but not in \fIdb\fR are
97set to their default values. All of \fIschema\fR's constraints apply
98in full.
12b84d50
BP
99.IP
100Some uses of this command can cause unrecoverable data loss. For
101example, converting a database from a schema that has a given column
102or table to one that does not will delete all data in that column or
103table. Back up critical databases before converting them.
104.IP
403e3a25 105.IP "\fBneeds\-conversion\fI db schema\fR"
12b84d50 106Reads the schema embedded in \fIdb\fR and the JSON schema from
403e3a25 107\fIschema\fR and compares them. If the schemas are the same, prints
12b84d50
BP
108\fBno\fR on stdout; if they differ, prints \fByes\fR.
109.IP
8159b984 110.IP "\fBdb\-version\fI db\fR"
6aa09313
BP
111.IQ "\fBschema\-version\fI schema\fR"
112Prints the version number in the schema embedded within the database
12b84d50 113\fIdb\fR or in the JSON schema \fIschema\fR on stdout.
6aa09313
BP
114If \fIschema\fR or \fIdb\fR was created before schema versioning was
115introduced, then it will not have a version number and this command
116will print a blank line.
12b84d50 117.IP
6aa09313
BP
118.IP "\fBdb\-cksum\fI db\fR"
119.IQ "\fBschema\-cksum\fI schema\fR"
120Prints the checksum in the schema embedded within the database
12b84d50 121\fIdb\fR or of the JSON schema \fIschema\fR on stdout.
de66aa57
BP
122If \fIschema\fR or \fIdb\fR was created before schema checksums were
123introduced, then it will not have a checksum and this command
6aa09313 124will print a blank line.
12b84d50 125.IP
51738fe1
BP
126.SS "Other Commands"
127.
12b84d50
BP
128.IP "\fBcompact\fI db \fR[\fItarget\fR]"
129Reads \fIdb\fR and writes a compacted version. If \fItarget\fR is
130specified, the compacted version is written as a new file named
131\fItarget\fR, which must not already exist. If \fItarget\fR is
132omitted, then the compacted version of the database replaces \fIdb\fR
133in-place. This command is not needed in normal operation because
134\fBovsdb\-server\fR from time to time automatically compacts a
135database that grows much larger than its minimum size.
136.IP
137This command does not work if \fIdb\fR is currently being served by
138\fBovsdb\-server\fR, or if it is otherwise locked for writing by
139another process. Instead, send the \fBovsdb\-server/compact\fR
140command to \fBovsdb\-server\fR, via \fBovs\-appctl\fR).
141.
d6db7b3c 142.IP "[\fB\-\-rbac\-role=\fIrole\fR] \fBquery\fI db transaction\fR"
f7f62235
BP
143Opens \fIdb\fR, executes \fItransaction\fR on it, and prints the
144results. The \fItransaction\fR must be a JSON array in the format of
145the \fBparams\fR array for the JSON-RPC \fBtransact\fR method, as
146described in the OVSDB specification.
147.IP
12b84d50 148This command opens \fIdb\fR for read-only access, so it may
f7f62235 149safely run concurrently with other database activity, including
4e312e69 150\fBovsdb\-server\fR and other database writers. The \fItransaction\fR
f7f62235
BP
151may specify database modifications, but these will have no effect on
152\fIdb\fR.
d6db7b3c
LR
153.IP
154By default, the transaction is executed using the ``superuser'' RBAC
155role. Use \fB\-\-rbac\-role\fR to specify a different role.
f7f62235 156.
d6db7b3c 157.IP "[\fR\-\-rbac\-role=\fIrole\fR] \fBtransact\fI db transaction\fR"
f7f62235
BP
158Opens \fIdb\fR, executes \fItransaction\fR on it, prints the results,
159and commits any changes to \fIdb\fR. The \fItransaction\fR must be a
160JSON array in the format of the \fBparams\fR array for the JSON-RPC
161\fBtransact\fR method, as described in the OVSDB specification.
162.IP
12b84d50
BP
163This command does not work if \fIdb\fR is currently being served by
164\fBovsdb\-server\fR, or if it is otherwise locked for writing by
165another process. Instead, use \fBovsdb\-client\fR's \fBtransact\fR
166command to send the query to \fBovsdb\-server\fR.
d6db7b3c
LR
167.IP
168By default, the transaction is executed using the ``superuser'' RBAC
169role. Use \fB\-\-rbac\-role\fR to specify a different role.
f7f62235 170.
4e312e69 171.IP "\fBshow\-log\fI db\fR"
9d02e3da 172Prints a summary of the records in \fIdb\fR's log, including the time
722f6301
BP
173and date at which each database change occurred and any associated
174comment. This may be useful for debugging.
5dfad3fa 175.IP
4e312e69
BP
176To increase the verbosity of output, add \fB\-m\fR (or \fB\-\-more\fR)
177one or more times to the command line. With one \fB\-m\fR,
c6782bb0 178\fBshow\-log\fR prints a summary of the records added, deleted, or
4e312e69 179modified by each transaction. With two \fB\-m\fRs, \fBshow\-log\fR
c6782bb0
BP
180also prints the values of the columns modified by each change to a
181record.
722f6301 182.
12b84d50
BP
183.IP "\fBdb\-name \fR[\fIdb\fR]"
184.IQ "\fBschema\-name \fR[\fIschema\fR]"
185Prints the name of the schema embedded within the database \fIdb\fR or
186in the JSON schema \fIschema\fR on stdout.
187.
f7f62235
BP
188.SH OPTIONS
189.SS "Logging Options"
190.so lib/vlog.man
191.SS "Other Options"
192.so lib/common.man
e4476f74 193.SH "FILES"
f973f2af 194The default \fIdb\fR is \fB@DBDIR@/conf.db\fR. The
e4476f74
BP
195default \fIschema\fR is \fB@pkgdatadir@/vswitch.ovsschema\fR. The
196\fBhelp\fR command also displays these defaults.
f7f62235
BP
197.SH "SEE ALSO"
198.
12b84d50 199\fBovsdb\fR(7),
f7f62235 200\fBovsdb\-server\fR(1),
12b84d50 201\fBovsdb\-client\fR(1).