-.TH MDB_COPY 1 "2014/07/01" "LMDB 0.9.14"
-.\" Copyright 2012-2018 Howard Chu, Symas Corp. All Rights Reserved.
+.TH MDB_COPY 1 "2017/07/31" "LMDB 0.9.70"
+.\" Copyright 2012-2019 Howard Chu, Symas Corp. All Rights Reserved.
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
.SH NAME
mdb_copy \- LMDB environment copy tool
.BR \-c ]
[\c
.BR \-n ]
+[\c
+.BR \-v ]
.B srcpath
[\c
.BR dstpath ]
.TP
.BR \-n
Open LDMB environment(s) which do not use subdirectories.
+.TP
+.BR \-v
+Use the previous environment state instead of the latest state.
+This may be useful if the latest state has been corrupted.
.SH DIAGNOSTICS
Exit status is zero if no errors occur.
for (; argc > 1 && argv[1][0] == '-'; argc--, argv++) {
if (argv[1][1] == 'n' && argv[1][2] == '\0')
flags |= MDB_NOSUBDIR;
+ else if (argv[1][1] == 'v' && argv[1][2] == '\0')
+ flags |= MDB_PREVMETA;
else if (argv[1][1] == 'c' && argv[1][2] == '\0')
cpflags |= MDB_CP_COMPACT;
else if (argv[1][1] == 'V' && argv[1][2] == '\0') {
}
if (argc<2 || argc>3) {
- fprintf(stderr, "usage: %s [-V] [-c] [-n] srcpath [dstpath]\n", progname);
+ fprintf(stderr, "usage: %s [-V] [-c] [-n] [-v] srcpath [dstpath]\n", progname);
exit(EXIT_FAILURE);
}
-.TH MDB_DUMP 1 "2015/09/30" "LMDB 0.9.17"
-.\" Copyright 2014-2018 Howard Chu, Symas Corp. All Rights Reserved.
+.TH MDB_DUMP 1 "2017/07/31" "LMDB 0.9.70"
+.\" Copyright 2014-2017 Howard Chu, Symas Corp. All Rights Reserved.
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
.SH NAME
mdb_dump \- LMDB environment export tool
[\c
.BR \-n ]
[\c
+.BR \-v ]
+[\c
.BR \-p ]
[\c
.BR \-a \ |
.BR \-n
Dump an LMDB database which does not use subdirectories.
.TP
+.BR \-v
+Use the previous environment state instead of the latest state.
+This may be useful if the latest state has been corrupted.
+.TP
.BR \-p
If characters in either the key or data items are printing characters (as
defined by isprint(3)), output them directly. This option permits users to
static void usage(char *prog)
{
- fprintf(stderr, "usage: %s [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb] dbpath\n", prog);
+ fprintf(stderr, "usage: %s [-V] [-f output] [-l] [-n] [-p] [-v] [-a|-s subdb] dbpath\n", prog);
exit(EXIT_FAILURE);
}
* -n: use NOSUBDIR flag on env_open
* -p: use printable characters
* -f: write to file instead of stdout
+ * -v: use previous metapage
* -V: print version and exit
* (default) dump only the main DB
*/
case 'n':
envflags |= MDB_NOSUBDIR;
break;
+ case 'v':
+ envflags |= MDB_PREVMETA;
+ break;
case 'p':
mode |= PRINT;
break;
-.TH MDB_STAT 1 "2015/09/30" "LMDB 0.9.17"
-.\" Copyright 2012-2018 Howard Chu, Symas Corp. All Rights Reserved.
+.TH MDB_STAT 1 "2017/07/31" "LMDB 0.9.70"
+.\" Copyright 2012-2019 Howard Chu, Symas Corp. All Rights Reserved.
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
.SH NAME
mdb_stat \- LMDB environment status tool
[\c
.BR \-n ]
[\c
+.BR \-v ]
+[\c
.BR \-r [ r ]]
[\c
.BR \-a \ |
.BR \-n
Display the status of an LMDB database which does not use subdirectories.
.TP
+.BR \-v
+Use the previous environment state instead of the latest state.
+This may be useful if the latest state has been corrupted.
+.TP
.BR \-r
Display information about the environment reader table.
Shows the process ID, thread ID, and transaction ID for each active
static void usage(char *prog)
{
- fprintf(stderr, "usage: %s [-V] [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb] dbpath\n", prog);
+ fprintf(stderr, "usage: %s [-V] [-n] [-e] [-r[r]] [-f[f[f]]] [-v] [-a|-s subdb] dbpath\n", prog);
exit(EXIT_FAILURE);
}
* -f: print freelist info
* -r: print reader info
* -n: use NOSUBDIR flag on env_open
+ * -v: use previous metapage
* -V: print version and exit
* (default) print stat of only the main DB
*/
case 'n':
envflags |= MDB_NOSUBDIR;
break;
+ case 'v':
+ envflags |= MDB_PREVMETA;
+ break;
case 'r':
rdrinfo++;
break;