You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2017/10/07 16:16:39 UTC
svn commit: r1811440 - in /jena/site/trunk/content/documentation/tdb2:
tdb2_admin.md tdb2_cmds.md
Author: andy
Date: Sat Oct 7 16:16:39 2017
New Revision: 1811440
URL: http://svn.apache.org/viewvc?rev=1811440&view=rev
Log:
Further content for TDB2
Modified:
jena/site/trunk/content/documentation/tdb2/tdb2_admin.md
jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md
Modified: jena/site/trunk/content/documentation/tdb2/tdb2_admin.md
URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb2/tdb2_admin.md?rev=1811440&r1=1811439&r2=1811440&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/tdb2/tdb2_admin.md (original)
+++ jena/site/trunk/content/documentation/tdb2/tdb2_admin.md Sat Oct 7 16:16:39 2017
@@ -1,5 +1,55 @@
Title: TDB2 - Database Administration
-@@backup
+## TDB2 directory layout
-@@admin
+A TDB2 database is contrained in a directory location `DIR` as:
+
+ DIR/
+ Backups/
+ Data-0001/
+ Data-0002/
+ tdb.lock
+
+where `Data-NNNN` are the compacted generations of the database. The
+highest number is the currently live database. The others are not used
+and not touched by the TDB2 storage system. They can be deleted or compressed
+as required.
+
+`Backups` is teh directoryused to place backup files.
+
+`tdb.lock` is the lock file to stop multipel use of the same database at
+the same time by different JVM processes.
+
+## Compaction
+
+TDB2 databases grow over time as updates occur. They can be compacted by calling:
+
+ DatabaseMgr.compact(dataset.asDatasetGraph());
+
+This can be done on a live database. Read requests will continue to be
+serviced; write request are held up until compaction has finished. This
+can be a long time for large databases.
+
+Compaction creates a new `Data-NNNN` subdirectory and copied over the
+latest view of the RDF dataset into that directory, then switch to using
+that generation of the database.
+
+
+## Backup
+
+A TDB2 database can be backed up by calling:
+
+ DatabaseMgr.backup(dataset.asDatasetGraph());
+
+which will create a dump file with timestamp:
+
+<pre>
+*location*/Backups/backup-*yyyy-MM-dd_HH:mm:ss*.nq.gz
+</pre>
+
+The file is a compressed N-Quads file.
+
+Backup can be done on a live database. It takes a consistent view of the
+data and does not include any updates committed after it starts.
+
+Read and write transactions will continue to be serviced.
Modified: jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md
URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md?rev=1811440&r1=1811439&r2=1811440&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md (original)
+++ jena/site/trunk/content/documentation/tdb2/tdb2_cmds.md Sat Oct 7 16:16:39 2017
@@ -4,6 +4,8 @@ Title: TDB2 - Command Line Tools
Do not run TDB1 tools on a TDB2 database, nor run TDB2 tools on a TDB1 database.
+These scripts are available jena binary distribution.
+
* `tdb2.tdbbackup`
* `tdb2.tdbdump`
* `tdb2.tdbcompact`
@@ -11,12 +13,14 @@ Do not run TDB1 tools on a TDB2 database
* `tdb2.tdbquery`
* `tdb2.tdbupdate`
+On MS Windows, these commands are called `tdb2_tdbquery` etc.
+
Example usage:
```
-java -cp JENA_HOME/lib/* tdb2.tdbloader --loc <DB location> file1 file2 ...
+tdb2.tdbloader --loc <DB location> file1 file2 ...
```
-where "`JENA_HOME`" is the location of an unpacked Apache Jena binary
-distribution.
+Note:
+`tdbloader2` is a TDB1 command tool.