提交 39fbde49 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation.

上级 4f4e7356
......@@ -1107,30 +1107,6 @@ This setting can be appended to the database URL: jdbc:h2:test;LOCK_TIMEOUT=1000
SET LOCK_TIMEOUT 1000
"
"Commands (Other)","SET LOG","
SET LOG int
","
Enabled or disables writing to the transaction log file. The values 0, 1, and 2
are supported.
0 means logging is disabled (faster). 1 means logging of the data is enabled,
but logging of the index changes is disabled (default). 2 means logging of both
data and index changes are enabled.
Transaction logging can be disabled to improve the performance when durability
is not important, for example while running tests or when loading the database.
Warning: it may not be possible to recover the database if logging is disabled
and the application terminates abnormally. If logging of index changes is
enabled, opening a database that was crashed becomes faster because the indexes
don't need to be rebuilt.
Admin rights are required to execute this command.
This command commits an open transaction.
This setting can be appended to the database URL: jdbc:h2:test;LOG=2
","
SET LOG 0
"
"Commands (Other)","SET MAX_LENGTH_INPLACE_LOB","
SET MAX_LENGTH_INPLACE_LOB int
","
......
......@@ -18,7 +18,17 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>Disabling the page store is no longer supported. The old storage mechanism
<ul><li>The database URL option ACCESS_MODE_LOG is no longer supported.
</li><li>The database URL option RECOVER has currently no effect.
</li><li>The system property "h2.optimizeDropDependencies" is no longer supported.
</li><li>The system property "h2.optimizeGroupSorted" is no longer supported.
</li><li>The system property "h2.optimizeMinMax" is no longer supported.
</li><li>The system property "h2.optimizeNot" is no longer supported.
</li><li>The system property "h2.optimizeIn" is no longer supported.
</li><li>The system property "h2.optimizeInJoin" is no longer supported.
</li><li>The system properties "h2.reuseSpace..." are no longer supported.
</li><li>The setting LOG has currently no effect.
</li><li>Disabling the page store is no longer supported. The old storage mechanism
has been removed, shrinking the jar file size by about 5%. Older databases can still be opened
(the database will be converted automatically).
</li><li>The translated resources are now stored in UTF-8 format.
......
......@@ -144,9 +144,7 @@ bugs that have not yet been found (as with most software). Some features are kno
to be dangerous, they are only supported for situations where performance is more important
than reliability. Those dangerous features are:
</p>
<ul>
<li>Disabling the transaction log mechanism using <code>SET LOG 0</code>.
</li><li>Using the transaction isolation level <code>READ_UNCOMMITTED</code>
<ul><li>Using the transaction isolation level <code>READ_UNCOMMITTED</code>
(<code>LOCK_MODE 0</code>) while at the same time using multiple
connections.
</li><li>Disabling database file protection using <code>FILE_LOCK=NO</code>
......@@ -187,12 +185,9 @@ Areas considered experimental are:
and out of memory issues have been reported.
</li></ul>
<p>
Some users have reported that after a power failure, the database can sometimes not be
opened because the index file is corrupt. In that case, the index file can be deleted
(it is automatically re-created). To avoid this, append
<code>;LOG=2</code> to the database URL.
See also: <a href="grammar.html#set_log" class="notranslate">SET LOG</a>. This problem will be solved
using the new 'page store' mechanism (currently beta).
Some users have reported that after a power failure, the database cannot be opened sometimes.
In this case, use a backup of the database or the Recover tool. Please report such problems.
The plan is that the database automatically recovers in all situations.
</p>
<h3 id="column_names_incorrect">Column Names are Incorrect?</h3>
......
......@@ -43,8 +43,6 @@ Features
Ignore Unknown Settings</a><br />
<a href="#other_settings">
Changing Other Settings when Opening a Connection</a><br />
<a href="#log_index_changes">
Log Index Changes</a><br />
<a href="#custom_access_mode">
Custom File Access Mode</a><br />
<a href="#multiple_connections">
......@@ -525,13 +523,6 @@ This is achieved using different database URLs. Settings in the URLs are not cas
jdbc:h2:file:~/sample;USER=sa;PASSWORD=123<br />
</td>
</tr>
<tr>
<td><a href="#log_index_changes">Log index changes</a></td>
<td class="notranslate">
jdbc:h2:&lt;url&gt;;LOG=2<br />
jdbc:h2:file:~/sample;LOG=2<br />
</td>
</tr>
<tr>
<td><a href="#trace_options">Debug trace settings</a></td>
<td class="notranslate">
......@@ -548,7 +539,7 @@ This is achieved using different database URLs. Settings in the URLs are not cas
<tr>
<td><a href="#custom_access_mode">Custom file access mode</a></td>
<td class="notranslate">
jdbc:h2:&lt;url&gt;;ACCESS_MODE_LOG=rws;ACCESS_MODE_DATA=rws<br />
jdbc:h2:&lt;url&gt;;ACCESS_MODE_DATA=rws<br />
</td>
</tr>
<tr>
......@@ -758,21 +749,6 @@ The database URL to disable database closing on exit is:
String url = "jdbc:h2:~/test;DB_CLOSE_ON_EXIT=FALSE";
</pre>
<h2 id="log_index_changes">Log Index Changes</h2>
<p>
Usually, changes to the index file are not logged for performance.
If the index file is corrupt or missing when opening a database, it is re-created from the data.
The index file can get corrupt when the database is not shut down correctly,
because of power failure or abnormal program termination.
In some situations, for example when using very large databases (over a few hundred MB),
re-creating the index file takes very long.
In these situations it may be better to log changes to the index file,
so that recovery from a corrupted index file is fast.
To enable log index changes, add <code>LOG=2</code> to the URL, as in <code>jdbc:h2:~/test;LOG=2</code>.
This setting should be specified when connecting.
The update performance of the database will be reduced when using this option.
</p>
<h2 id="ignore_unknown_settings">Ignore Unknown Settings</h2>
<p>
Some applications (for example OpenOffice.org Base) pass some additional parameters
......@@ -802,12 +778,10 @@ read-write (except for read only databases, where the mode <code>r</code> is use
To open a database in read-only mode if the files are not read-only, use
<code>ACCESS_MODE_DATA=r</code>.
Also supported are <code>rws</code> and <code>rwd</code>.
The access mode used for log files is set via <code>ACCESS_MODE_LOG</code>;
for data and index files use <code>ACCESS_MODE_DATA</code>.
These settings must be specified in the database URL:
This setting must be specified in the database URL:
</p>
<pre>
String url = "jdbc:h2:~/test;ACCESS_MODE_LOG=rws;ACCESS_MODE_DATA=rws";
String url = "jdbc:h2:~/test;ACCESS_MODE_DATA=rws";
</pre>
<p>
For more information see <a href="advanced.html#durability_problems">Durability Problems</a>.
......
......@@ -579,12 +579,11 @@ To speed up large imports, consider using the following options temporarily:
</p>
<ul><li><code>SET CACHE_SIZE</code> (a large cache is faster)
</li><li><code>SET LOCK_MODE 0</code> (disable locking)
</li><li><code>SET LOG 0</code> (disable the transaction log)
</li><li><code>SET UNDO_LOG 0</code> (disable the session undo log)
</li></ul>
<p>
These options can be set in the database URL:
<code>jdbc:h2:~/test;CACHE_SIZE=65536;LOCK_MODE=0;LOG=0;UNDO_LOG=0</code>.
<code>jdbc:h2:~/test;CACHE_SIZE=65536;LOCK_MODE=0;UNDO_LOG=0</code>.
Most of those options are not recommended for regular use, that means you need to reset them after use.
</p>
......
......@@ -476,6 +476,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>UNION: evaluate INTERSECT before UNION (like most other database except Oracle).
</li><li>Delay creating the information schema, and share metadata columns.
</li><li>TCP Server: use a nonce (number used once) to protect unencrypted channels against replay attacks.
</li><li>Simplify running scripts and recovery: CREATE FORCE USER (overwrites an existing user).
</li></ul>
<h2>Not Planned</h2>
......
......@@ -12,6 +12,7 @@ Initial Developer: H2 Group
<style type="text/css">
body {
max-width: none;
width: inherit;
}
a {
text-decoration: underline;
......
......@@ -46,7 +46,7 @@ function openLink() {
return true;
}
el = el.parentNode.parentNode;
on(el.id);
window.scrollTo(0, el.offsetTop);
return true;
on(el.id.substr(2));
return false;
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论