Merge "next" branch into "master".
[sliver-openvswitch.git] / ovsdb / ovsdb-tool.1.in
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .\" -*- nroff -*-
8 .TH ovsdb\-tool 1 "November 2009" "Open vSwitch" "Open vSwitch Manual"
9 .ds PN ovsdb\-tool
10 .
11 .SH NAME
12 ovsdb\-tool \- Open vSwitch database management utility
13 .
14 .SH SYNOPSIS
15 \fBovsdb\-tool \fR[\fIoptions\fR] \fBcreate\fI db schema\fR
16 .br
17 \fBovsdb\-tool \fR[\fIoptions\fR] \fBquery\fI db transaction\fR
18 .br
19 \fBovsdb\-tool \fR[\fIoptions\fR] \fBtransact\fI db transaction\fR
20 .br
21 \fBovsdb\-tool \fR[\fIoptions\fR] [\fB-m\fR | \fB--more\fR]... \fBshow\-log\fI db\fR
22 .br
23 \fBovsdb\-tool help\fR
24 .so lib/vlog-syn.man
25 .so lib/common-syn.man
26 .
27 .SH DESCRIPTION
28 The \fBovsdb\-tool\fR program is a command-line tool for managing Open
29 vSwitch database (OVSDB) files.  It does not interact directly with
30 running Open vSwitch database servers (instead, use
31 \fBovsdb\-client\fR).
32 .
33 .SS "Basic Commands"
34 .IP "\fBcreate\fI db schema\fR"
35 Reads an OVSDB schema from the file named \fIschema\fR and creates a
36 new OVSDB database file named \fIdb\fR using that schema.  The new
37 database is initially empty.  This command will not overwrite an
38 existing \fIdb\fR.
39 .IP
40 \fIschema\fR must contain an OVSDB schema in JSON format.  Refer to
41 the OVSDB specification for details.
42 .
43 .IP "\fBcompact\fI db \fR[\fItarget\fR]"
44 Reads \fIdb\fR and writes a compacted version.  If \fItarget\fR is
45 specified, the compacted version is written as a new file named
46 \fItarget\fR, which must not already exist.  If \fItarget\fR is
47 omitted, then the compacted version of the database replaces \fIdb\fR
48 in-place.
49 .
50 .IP "\fBconvert\fI db schema \fR[\fItarget\fR]"
51 Reads \fIdb\fR, translating it into to the schema specified in
52 \fIschema\fR, and writes out the new interpretation.  If \fItarget\fR
53 is specified, the translated version is written as a new file named
54 \fItarget\fR, which must not already exist.  If \fItarget\fR is
55 omitted, then the translated version of the database replaces \fIdb\fR
56 in-place.
57 .IP
58 This command can do simple ``upgrades'' and ``downgrades'' on a
59 database's schema.  The data in \fIdb\fR must be valid when
60 interpreted under \fIschema\fR, with only one exception: data in
61 \fIdb\fR for tables and columns that do not exist in \fIschema\fR are
62 ignored.  Columns that exist in \fIschema\fR but not in \fIdb\fR are
63 set to their default values.  All of \fIschema\fR's constraints apply
64 in full.
65 .
66 .IP "\fBquery\fI db transaction\fR"
67 Opens \fIdb\fR, executes \fItransaction\fR on it, and prints the
68 results.  The \fItransaction\fR must be a JSON array in the format of
69 the \fBparams\fR array for the JSON-RPC \fBtransact\fR method, as
70 described in the OVSDB specification.
71 .IP
72 The \fIdb\fR is opened for read-only access, so this command may
73 safely run concurrently with other database activity, including
74 \fBovsdb-server\fR and other database writers.  The \fItransaction\fR
75 may specify database modifications, but these will have no effect on
76 \fIdb\fR.
77 .
78 .IP "\fBtransact\fI db transaction\fR"
79 Opens \fIdb\fR, executes \fItransaction\fR on it, prints the results,
80 and commits any changes to \fIdb\fR.  The \fItransaction\fR must be a
81 JSON array in the format of the \fBparams\fR array for the JSON-RPC
82 \fBtransact\fR method, as described in the OVSDB specification.
83 .IP
84 The \fIdb\fR is opened and locked for read/write access, so this
85 command will fail if the database is opened for writing by any other
86 process, including \fBovsdb-server\fR(1).  Use \fBovsdb\-client\fR(1),
87 instead, to write to a database that is served by
88 \fBovsdb-server\fR(1).
89 .
90 .IP "\fBshow-log\fI db\fR"
91 Prints a summary of the records in \fBdb\fR's log, including the time
92 and date at which each database change occurred and any associated
93 comment.  This may be useful for debugging.
94 .PP
95 To increase the verbosity of output, add \fB-m\fR (or \fB--more\fR)
96 one or more times to the command line.  With one \fB-m\fR,
97 \fBshow\-log\fR prints a summary of the records added, deleted, or
98 modified by each transaction.  With two \fB-m\fRs, \fBshow\-log\fR
99 also prints the values of the columns modified by each change to a
100 record.
101 .
102 .SH OPTIONS
103 .SS "Logging Options"
104 .so lib/vlog.man
105 .SS "Other Options"
106 .so lib/common.man
107 .SH "SEE ALSO"
108 .
109 \fBovsdb\-server\fR(1),
110 \fBovsdb\-client\fR(1),
111 and the OVSDB specification.