diff options
author | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-07-20 20:00:05 +0100 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-07-20 20:00:05 +0100 |
commit | 3ef782d3745ea8f25a3151561a3cfb882190210e (patch) | |
tree | 86b9c2f5fde051dd0bced99b3fc9f5a3ba08db69 /docs/bdb-sql | |
download | berkeleydb-3ef782d3745ea8f25a3151561a3cfb882190210e.tar.gz |
Tarball conversion
Diffstat (limited to 'docs/bdb-sql')
32 files changed, 6692 insertions, 0 deletions
diff --git a/docs/bdb-sql/BDB-SQL-Guide.pdf b/docs/bdb-sql/BDB-SQL-Guide.pdf Binary files differnew file mode 100644 index 00000000..dfcca036 --- /dev/null +++ b/docs/bdb-sql/BDB-SQL-Guide.pdf diff --git a/docs/bdb-sql/accessing_bdb_sql_databases.title.html b/docs/bdb-sql/accessing_bdb_sql_databases.title.html new file mode 100644 index 00000000..9e8d8ea5 --- /dev/null +++ b/docs/bdb-sql/accessing_bdb_sql_databases.title.html @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Accessing BDB SQL Databases</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="buildinstall.html" title="Getting and Installing BDB SQL" /> + <link rel="next" href="journaldirectory.html" title="The Journal Directory" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Accessing BDB SQL Databases</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="buildinstall.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="journaldirectory.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="accessing_bdb_sql_databases.title"></a>Accessing BDB SQL Databases</h2> + </div> + </div> + </div> + <p> + BDB SQL databases can be accessed using a number of + different drivers, applications and APIs. Only some of + these are supported by all major platforms, as identified + in the following table. + </p> + <div class="informaltable"> + <table border="1" width="80%"> + <colgroup> + <col /> + <col align="center" /> + <col align="center" /> + <col align="center" /> + <col align="center" /> + <col align="center" /> + </colgroup> + <thead> + <tr> + <th> </th> + <th align="center">UNIX/POSIX</th> + <th align="center">Windows</th> + <th align="center">Windows Mobile/CE</th> + <th align="center">Android</th> + <th align="center">iOS</th> + </tr> + </thead> + <tbody> + <tr> + <td>DBSQL Library</td> + <td align="center">x</td> + <td align="center">x</td> + <td align="center">x</td> + <td align="center">x</td> + <td align="center">x</td> + </tr> + <tr> + <td>DBSQL Shell</td> + <td align="center">x</td> + <td align="center">x</td> + <td align="center">x</td> + <td align="center">x</td> + <td align="center">x</td> + </tr> + <tr> + <td>ODBC</td> + <td align="center">x</td> + <td align="center">x</td> + <td align="center"> </td> + <td align="center"> </td> + <td align="center"> </td> + </tr> + <tr> + <td>JDBC</td> + <td align="center">x</td> + <td align="center">x</td> + <td align="center"> </td> + <td align="center"> </td> + <td align="center"> </td> + </tr> + <tr> + <td>ADO.NET</td> + <td align="center"> </td> + <td align="center">x</td> + <td align="center">x</td> + <td align="center"> </td> + <td align="center"> </td> + </tr> + </tbody> + </table> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="buildinstall.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="journaldirectory.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Getting and Installing BDB SQL </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> The Journal Directory</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/addedpragmas.html b/docs/bdb-sql/addedpragmas.html new file mode 100644 index 00000000..c9fabbeb --- /dev/null +++ b/docs/bdb-sql/addedpragmas.html @@ -0,0 +1,459 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Added PRAGMAs</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="changedpragmas.html" title="Changed PRAGMAs" /> + <link rel="next" href="miscdiff.html" title="Miscellaneous Differences" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Added PRAGMAs</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="changedpragmas.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="miscdiff.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="addedpragmas"></a>Added PRAGMAs</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_error_file">PRAGMA bdbsql_error_file</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_lock_tablesize">PRAGMA bdbsql_lock_tablesize</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_shared_resources">PRAGMA bdbsql_shared_resources</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_single_process">PRAGMA bdbsql_single_process</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_system_memory">PRAGMA bdbsql_system_memory</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_vacuum_fillpercent">PRAGMA bdbsql_vacuum_fillpercent</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_vacuum_pages">PRAGMA bdbsql_vacuum_pages</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#multiversion">PRAGMA multiversion</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#snapshot_isolation">PRAGMA snapshot_isolation</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#trickle">PRAGMA trickle</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#txn_bulk">PRAGMA txn_bulk</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#replication_pragmas">Replication PRAGMAs</a> + </span> + </dt> + </dl> + </div> + <p> + The following PRAGMAs are added in the Berkeley DB SQL interface. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bdbsql_error_file"></a>PRAGMA bdbsql_error_file</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA bdbsql_error_file [filename]</pre> + <p> + Redirects internal Berkeley DB error messages to + the named file. If a relative path is specified to + <code class="literal">[filename]</code>, then the path is + interpreted as being relative to the current + working directory. + </p> + <p> + If this PRAGMA is issued with no filename, then the + current target for Berkeley DB error output is + returned. By default, error messages are sent to + <code class="literal">STDERR</code>. + </p> + <p> + This PRAGMA can be issued at any time; initial + database access does not have to occur before this + PRAGMA can be used. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bdbsql_lock_tablesize"></a>PRAGMA bdbsql_lock_tablesize</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA bdbsql_lock_tablesize [= N]</pre> + <p> + Sets or reports the number of buckets in the Berkeley DB environment's + lock object hash table. + </p> + <p> + This pragma must be called prior to opening/creating the + database environment. + </p> + <p> + For more details, see + <a href="../api_reference/C/envget_lk_tablesize.html" class="olink">get_lk_tablesize</a> + and + <a href="../api_reference/C/envset_lk_tablesize.html" class="olink">set_lk_tablesize</a>. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bdbsql_shared_resources"></a>PRAGMA bdbsql_shared_resources</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA bdbsql_shared_resources [= N]</pre> + <p> + Sets or reports the maximum amount of memory (bytes) to be + used by shared structures in the main environment region. + </p> + <p> + This pragma must be called prior to opening/creating the + database environment. + </p> + <p> + For more details, see + <a href="../api_reference/C/envget_memory_max.html" class="olink">get_memory_max</a> + and + <a href="../api_reference/C/envset_memory_max.html" class="olink">set_memory_max</a>. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bdbsql_single_process"></a>PRAGMA bdbsql_single_process</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA bdbsql_single_process = boolean</pre> + <p> + To create a private environment rather than a shared + environment, enable this pragma. The cache and other + region files will be created in memory rather than + using file backed shared memory. + </p> + <p> + In Berkeley DB SQL the default behavior is to allow a + database to be opened and operated on by multiple + processes simultaneously. When this pragma is enabled, + accessing the same database from multiple processes + simultaneously can lead to data corruption. Either + option supports accessing a database using a single + process multi-threaded application. + </p> + <p> + By default omit sharing is disabled. This pragma must + be called prior to opening/creating the database + environment. Because the setting is not persistent, + you may need to invoke it before every database open, + or define compile option + <code class="literal">BDBSQL_OMIT_SHARING</code> instead. + </p> + <p> + For more information, see <a href="../programmer_reference/env_region.html" class="olink">Shared memory region</a>. Note that this + pragma causes the <a href="../api_reference/C/envopen.html#envopen_DB_PRIVATE" class="olink">DB_PRIVATE</a> flag to be specified in + the <a href="../api_reference/C/envopen.html" class="olink">DB_ENV->open()</a> method. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bdbsql_system_memory"></a>PRAGMA bdbsql_system_memory</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA bdbsql_system_memory [base segment ID]</pre> + <p> + Queries or sets a flag that causes the database's + shared resources to be created in system shared + memory. By default the database's shared resources + are created in file-backed shared memory. + </p> + <p> + If a [base segment ID] is specified, the shared + resources will be created using X/Open style shared + memory interfaces. The [base segment ID] will be + used as the starting ID for shared resources used + by the database. Use different [base segment ID] + values for different databases. It is possible for + multi-process applications to use a single database + by specifying the same [base segment ID] to this + PRAGMA. Each connection needs to set this PRAGMA. + </p> + <p> + This PRAGMA may be used to set a [base segment ID] + only before the first table is created in the + database. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bdbsql_vacuum_fillpercent"></a>PRAGMA bdbsql_vacuum_fillpercent</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA bdbsql_vacuum_fillpercent [= N]</pre> + <p> + Sets or reports the page full threshold. + Any page in the database that is at or below this + percentage full is considered for vacuuming when + <code class="literal">PRAGMA incremental_vacuum</code> is + enabled. The value is specified as a percentage + between 1 and 100. By default, pages 85% full and + below are considered for vacuuming. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bdbsql_vacuum_pages"></a>PRAGMA bdbsql_vacuum_pages</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA bdbsql_vacuum_pages [= N]</pre> + <p> + Sets or reports the maximum number of pages to be + returned to the file system from the free page list + when incremental vacuuming is enabled. By + default, up to 128 pages are removed from the free + list. + </p> + <p> + Page vacuuming is controlled using + <a class="xref" href="changedpragmas.html#auto_vacuum" title="PRAGMA auto_vacuum">PRAGMA auto_vacuum</a>. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="multiversion"></a>PRAGMA multiversion</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA multiversion</pre> + <p> + Controls whether Multiversion Concurrency Control (MVCC) is on + or off. You can not use this PRAGMA at any time during + your application's runtime after your database tables + have been accessed. + </p> + <p> + For more information on MVCC and snapshot isolation, + see <a class="xref" href="mvcc.html" title="Using Multiversion Concurrency Control">Using Multiversion Concurrency Control</a> + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="snapshot_isolation"></a>PRAGMA snapshot_isolation</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA snapshot_isolation</pre> + <p> + Controls whether snapshot isolation is turned on. This + PRAGMA can be used at any time during your + application's runtime <span class="emphasis"><em>after</em></span> + Multiversion Concurrency Control (MVCC) has been turned on. + </p> + <p> + For more information on MVCC and snapshot isolation, + see <a class="xref" href="mvcc.html" title="Using Multiversion Concurrency Control">Using Multiversion Concurrency Control</a> + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="trickle"></a>PRAGMA trickle</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA trickle [percent]</pre> + <p> + Ensures that at least the specified percentage of + pages in the shared cache are clean. This can cause + pages that have been modified to be flushed to + disk. + </p> + <p> + The trickle functionality enables an application to + ensure that a page is available for reading new + information into the shared cache without waiting + for a write operation to complete. + </p> + <p> + Specifying this PRAGMA without a percentage value + causes the current trickle value to be displayed. + Specify <code class="literal">0</code> to turn the trickle + functionality off. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="txn_bulk"></a>PRAGMA txn_bulk</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA TXN_BULK</pre> + <p> + Enables transactional bulk loading optimization. + For more information, see + <a class="xref" href="dbfeatures.html#bulkloading" title="Using Bulk Loading">Using Bulk Loading</a>. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="replication_pragmas"></a>Replication PRAGMAs</h3> + </div> + </div> + </div> + <p> + Seven PRAGMAs were added to control replication. + They are described in + <a class="xref" href="sqlrep.html" title="Chapter 4. Using Replication with the SQL API">Using Replication with the SQL API</a>: + </p> + <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> + <h3 class="title">Note</h3> + <p> + If you are using these replication PRAGMAs and you + want to perform a backup, there is an additional + backup step for the pragma file. See + <a class="xref" href="admin.html#backup" title="Backing Up Berkeley DB SQL Databases">Backing Up Berkeley DB SQL Databases</a> + for more information. + </p> + </div> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <span class="bold"><strong>PRAGMA replication</strong></span> + </p> + </li> + <li> + <p> + <span class="bold"><strong>PRAGMA replication_initial_master</strong></span> + </p> + </li> + <li> + <p> + <span class="bold"><strong>PRAGMA replication_local_site</strong></span> + </p> + </li> + <li> + <p> + <span class="bold"><strong>PRAGMA replication_remote_site</strong></span> + </p> + </li> + <li> + <p> + <span class="bold"><strong>PRAGMA replication_remove_site</strong></span> + </p> + </li> + <li> + <p> + <span class="bold"><strong>PRAGMA replication_verbose_output</strong></span> + </p> + </li> + <li> + <p> + <span class="bold"><strong>PRAGMA replication_verbose_file</strong></span> + </p> + </li> + </ul> + </div> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="changedpragmas.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="miscdiff.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Changed PRAGMAs </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Miscellaneous Differences</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/admin.html b/docs/bdb-sql/admin.html new file mode 100644 index 00000000..e54174ed --- /dev/null +++ b/docs/bdb-sql/admin.html @@ -0,0 +1,204 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Chapter 5. Administrating Berkeley DB SQL Databases</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="prev" href="rep_usageexamples.html" title="Replication Usage Examples" /> + <link rel="next" href="sync.html" title="Syncing with Oracle Databases" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Chapter 5. Administrating Berkeley DB SQL Databases</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="rep_usageexamples.html">Prev</a> </td> + <th width="60%" align="center"> </th> + <td width="20%" align="right"> <a accesskey="n" href="sync.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="chapter" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title"><a id="admin"></a>Chapter 5. Administrating Berkeley DB SQL Databases</h2> + </div> + </div> + </div> + <div class="toc"> + <p> + <b>Table of Contents</b> + </p> + <dl> + <dt> + <span class="sect1"> + <a href="admin.html#backup">Backing Up Berkeley DB SQL Databases</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="admin.html#idp50743400">Backing Up Replicated Berkeley DB SQL Databases</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="sync.html">Syncing with Oracle Databases</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="sync.html#syncunix">Syncing on Unix Platforms</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sync.html#syncwin">Syncing on Windows Platforms</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sync.html#syncwinmobile">Syncing on Windows Mobile Platforms</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="datamigration.html">Data Migration</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="datamigration.html#shellmigrate">Migration Using the Shells</a> + </span> + </dt> + </dl> + </dd> + </dl> + </div> + <p> + This chapter provides administrative procedures that are unique + to the Berkeley DB SQL interface. + </p> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="backup"></a>Backing Up Berkeley DB SQL Databases</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="admin.html#idp50743400">Backing Up Replicated Berkeley DB SQL Databases</a> + </span> + </dt> + </dl> + </div> + <p> + You can use the standard SQLite <code class="literal">.dump</code> + command to backup the data managed by the BDB SQL interface. + </p> + <p> + The BDB SQL interface supports the standard SQLite Online Backup API. + However, there is a small difference between the two interfaces. + In the BDB SQL interface, the value returned by the <code class="literal">sqlite3_backup_remaining</code> method + and the number of pages passed to the <code class="literal">sqlite3_backup_step</code> method, + are estimates of the number of pages to be copied and not exact values. + To be certain that the backup process is complete, + check if the <code class="literal">sqlite3_backup_step</code> method has returned <code class="literal">SQLITE_DONE</code>. + To learn how to use SQLite Online Backup API, see the official <a class="ulink" href="http://www.sqlite.org/backup.html" target="_top">SQLite + Documentation Page.</a> + </p> + <p> + If you are using replication, you will also need to copy the + file that contains the replication pragma information in order + to have a full backup. To do that copy the file named <code class="literal"> + pragma</code> from the database journal directory. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="idp50743400"></a>Backing Up Replicated Berkeley DB SQL Databases</h3> + </div> + </div> + </div> + <p> + When BDB SQL interface databases are replicated the process for backing up + a regular database should be followed. The user must then copy + some additional files for the backup to be complete. + </p> + <p> + The additional files can be found in the journal directory of + the source database, and should be copied into the journal + directory of the backup copy. The journal directory is + automatically created when a Berkeley DB SQL interface database is created. + The journal directory is created in the same directory as the + database file, it has the name of the database file with a + <code class="literal">-journal</code> appendix. + </p> + <p> + The files that need to be copied into the backup journal directory are: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <code class="literal">__db.rep.egen</code> + </li> + <li> + <code class="literal">__db.rep.gen</code> + </li> + <li> + <code class="literal">__db.rep.init</code> + </li> + <li> + <code class="literal">__db.rep.system</code> + </li> + </ul> + </div> + <p> + </p> + </div> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="rep_usageexamples.html">Prev</a> </td> + <td width="20%" align="center"> </td> + <td width="40%" align="right"> <a accesskey="n" href="sync.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Replication Usage Examples </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Syncing with Oracle Databases</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/bdb-concepts.html b/docs/bdb-sql/bdb-concepts.html new file mode 100644 index 00000000..61308339 --- /dev/null +++ b/docs/bdb-sql/bdb-concepts.html @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Berkeley DB Concepts</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="miscdiff.html" title="Miscellaneous Differences" /> + <link rel="next" href="sql_encryption.html" title="Encryption" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Berkeley DB Concepts</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="miscdiff.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="sql_encryption.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="bdb-concepts"></a>Berkeley DB Concepts</h2> + </div> + </div> + </div> + <p> + If you are a SQLite user who is migrating to the BDB SQL interface, + then there are a few Berkeley DB-specific concepts you might want + to know about. + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + Environments. The directory that is created + alongside your database file, and which ends with + the "-journal" suffix, is actually a Berkeley DB + environment directory. + </p> + </li> + <li> + <p> + The Locking Subsystem + </p> + <p> + The Berkeley DB library implements locking in a different + way to SQLite. SQLite implements locking at a database + level - any operation will take a lock on the entire + database. Berkeley DB implements a scheme called page + level locking. The database divides data into relatively + small blocks. Each block corresponds to a page in + database terms. Each block can contain multiple pieces + of user information. Berkeley DB takes locks on + individual pages. This allows for greater concurrency + in applications, but means that applications are more + likely to encounter deadlocks. + </p> + <p> + See: + <a class="xref" href="lockingnotes.html" title="Chapter 2. Locking Notes">Locking Notes</a> + for more information. + </p> + </li> + <li> + <p> + The Journal Subsystem + </p> + <p> + The BDB SQL interface implements write ahead logging (WAL), + it stores journal files differently to the SQLite + WAL implementation. BDB SQL interface rolls over journal files + when they get to a certain size (default 10MB). It is + possible for the to be multiple journal files active + at one time with BDB SQL interface. + </p> + </li> + </ul> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="miscdiff.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="sql_encryption.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Miscellaneous Differences </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Encryption</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/bfile-c.html b/docs/bdb-sql/bfile-c.html new file mode 100644 index 00000000..49108de9 --- /dev/null +++ b/docs/bdb-sql/bfile-c.html @@ -0,0 +1,470 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>BFILE C/C++ Objects and Functions</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="bfile-extension.html" title="Appendix A. Using the BFILE Extension" /> + <link rel="prev" href="bfile-sql.html" title="BFILE SQL Objects and Functions" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">BFILE C/C++ Objects and Functions</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="bfile-sql.html">Prev</a> </td> + <th width="60%" align="center">Appendix A. Using the BFILE Extension</th> + <td width="20%" align="right"> </td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="bfile-c"></a>BFILE C/C++ Objects and Functions</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_column_bfile">sqlite3_column_bfile</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_open">sqlite3_bfile_open</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_close">sqlite3_bfile_close</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_is_open">sqlite3_bfile_is_open</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_read">sqlite3_bfile_read</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_file_exists">sqlite3_bfile_file_exists</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_size">sqlite3_bfile_size</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_final">sqlite3_bfile_final</a> + </span> + </dt> + </dl> + </div> + <p> + The BFILE extension can optionally make available to you some + additional C language data types and functions for use with the + SQLite C/C++ interface. These are available to you only if + you take the proper steps when you compile Berkeley DB. See the + <em class="citetitle">Berkeley DB Installation and Build Guide</em> for more information. + </p> + <p> + Once enabled, the BFILE C extension makes the following new + structure available to you: + </p> + <pre class="programlisting">typedef struct sqlite3_bfile sqlite3_bfile;</pre> + <p> + This structure serves as the BFILE handle when you are using + the BFILE extension along with the SQLite C/C++ interface. + </p> + <p> + In addition to the new structure, you can also use the + following new C functions: + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="sqlite3_column_bfile"></a>sqlite3_column_bfile</h3> + </div> + </div> + </div> + <pre class="programlisting">int +sqlite3_column_bfile(sqlite3_stmt *pStmt, int iCol, + sqlite3_bfile **ppBfile); </pre> + <p> + Returns a result set from a query against a column of type + BFILE. + </p> + <p> + On success, <code class="literal">SQLITE_OK</code> is returned and + the new BFILE handle is written to + <span class="bold"><strong>ppBfile</strong></span>. Otherwise, + <code class="literal">SQLITE_ERROR</code> is returned. + </p> + <p> + Parameters are: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <span class="bold"><strong>pStmt</strong></span> + </p> + <p> + Pointer to the prepared statement that the function + is evaluating. The statement is created + using <code class="literal">sqlite3_prepare_v2()</code> + or one of its variants. + </p> + <p> + If this statement does not point to a valid row, + the result is undefined. + </p> + </li> + <li> + <p> + <span class="bold"><strong>iCol</strong></span> + </p> + <p> + Index of the column for which information should be + returned. The left-most column of the result set + is index <code class="literal">0</code>. Use + <code class="literal">sqlite3_column_count()</code> to discover + the number of columns in the result set. + </p> + <p> + If the column index is out of range, the result is + undefined. + </p> + </li> + <li> + <p> + <span class="bold"><strong>ppBfile</strong></span> + </p> + <p> + The BFILE handle that you are using for the query. + This pointer is valid only until + <code class="literal">sqlite3_step()</code>, + <code class="literal">sqlite3_reset()</code> or + <code class="literal">sqlite3_finalize()</code> have been + called. + </p> + <p> + The memory space used to hold this handle is freed by + <a class="xref" href="bfile-c.html#sqlite3_bfile_final" title="sqlite3_bfile_final">sqlite3_bfile_final</a> + Do not pass these pointers to <code class="literal">sqlite3_free()</code>. + </p> + </li> + </ul> + </div> + <p> + This function can be called successfully only if all of the + following conditions are true. If any of the following are + not true, the result is undefined: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + The most recent call to + <code class="literal">sqlite3_step()</code> has returned + <code class="literal">SQLITE_ROW</code>. + </p> + </li> + <li> + <p> + Neither <code class="literal">sqlite3_reset()</code> nor + <code class="literal">sqlite3_finalize()</code> have been + called since the last time + <code class="literal">sqlite3_step()</code> was called. + </p> + </li> + <li> + <p> + <code class="literal">sqlite3_step()</code>, + <code class="literal">sqlite3_reset()</code> or + <code class="literal">sqlite3_finalize()</code> have not been + called from a different thread while this routine + is pending. + </p> + </li> + </ul> + </div> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="sqlite3_bfile_open"></a>sqlite3_bfile_open</h3> + </div> + </div> + </div> + <pre class="programlisting">int +sqlite3_bfile_open(sqlite3_bfile *pBfile); </pre> + <p> + Opens a file for incremental read. + </p> + <p> + On success, <code class="literal">SQLITE_OK</code> is returned. + Otherwise, <code class="literal">SQLITE_ERROR</code> is returned. + </p> + <p> + To avoid a resource leak, every opened BFILE handle should + eventually be closed with the + <a class="xref" href="bfile-c.html#sqlite3_bfile_close" title="sqlite3_bfile_close">sqlite3_bfile_close</a> + function. Note that <span class="bold"><strong>pBfile</strong></span> + is always initialized such that it is always safe to invoke + <code class="literal">sqlite_bfile_close()</code> against it, + regardless of the success or failure of this function. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="sqlite3_bfile_close"></a>sqlite3_bfile_close</h3> + </div> + </div> + </div> + <pre class="programlisting">int +sqlite3_bfile_close(sqlite3_bfile *pBfile); </pre> + <p> + Closes an open BFILE handle. The BFILE is closed + unconditionally. Even if this function returns an error, + the BFILE is still closed. + </p> + <p> + Calling this routine with a null pointer (such as would be + returned by failed call to sqlite3_column_bfile()) is a + harmless non-operation. + </p> + <p> + On success, <code class="literal">SQLITE_OK</code> is returned. + Otherwise, <code class="literal">SQLITE_ERROR</code> is returned. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="sqlite3_bfile_is_open"></a>sqlite3_bfile_is_open</h3> + </div> + </div> + </div> + <pre class="programlisting">int +sqlite3_bfile_is_open(sqlite3_bfile *pBfile, int *open); </pre> + <p> + Checks whether a BFILE handle is open. The + <code class="literal">open</code> parameter is set to 1 if the file + is open, otherwise it is 0. + </p> + <p> + On success, <code class="literal">SQLITE_OK</code> is returned. + Otherwise, <code class="literal">SQLITE_ERROR</code> is returned. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="sqlite3_bfile_read"></a>sqlite3_bfile_read</h3> + </div> + </div> + </div> + <pre class="programlisting">int +sqlite3_bfile_read(sqlite3_bfile *pBfile, void *oBuff, int nSize, + int iOffset, int *nRead); </pre> + <p> + This function is used to read data from an opened BFILE + handle into a caller-supplied buffer. + </p> + <p> + On success, <code class="literal">SQLITE_OK</code> is returned, the + data that has been read is written to the output buffer, + <span class="bold"><strong>oBuff</strong></span>, + and the amount of data written to the buffer is recorded in + <span class="bold"><strong>nRead</strong></span>. + Otherwise, <code class="literal">SQLITE_ERROR</code> is returned. + </p> + <p> + Parameters are: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <span class="bold"><strong>pBfile</strong></span> + </p> + <p> + The BFILE handle from which the data is read. + </p> + <p> + This function only works on a BFILE handle which + has been created by a prior successful call to + <a class="xref" href="bfile-c.html#sqlite3_bfile_open" title="sqlite3_bfile_open">sqlite3_bfile_open</a> + and which has not been closed by + <a class="xref" href="bfile-c.html#sqlite3_bfile_close" title="sqlite3_bfile_close">sqlite3_bfile_close</a>. + Passing any other pointer in to this function + results in undefined and probably undesirable + behavior. + </p> + </li> + <li> + <p> + <span class="bold"><strong>oBuff</strong></span> + </p> + <p> + The buffer used to contain the data that is read + from <span class="bold"><strong>pBfile</strong></span>. It + must be at least <span class="bold"><strong>nSize</strong></span> + bytes in size. + </p> + </li> + <li> + <p> + <span class="bold"><strong>nSize</strong></span> + </p> + <p> + The amount of data, in bytes, to read from the + BFILE. + </p> + </li> + <li> + <p> + <span class="bold"><strong>iOffset</strong></span> + </p> + <p> + The offset from the beginning of the file where the + read operation is to begin. + </p> + </li> + <li> + <p> + <span class="bold"><strong>nRead</strong></span> + </p> + <p> + Contains the amount of data, in bytes, actually + written to buffer <span class="bold"><strong>oBuff</strong></span> + once the read operation is completed. + </p> + </li> + </ul> + </div> + <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> + <h3 class="title">Note</h3> + <p> + The size of the BFILE can be determined using the + <a class="xref" href="bfile-c.html#sqlite3_bfile_size" title="sqlite3_bfile_size">sqlite3_bfile_size</a> + function. + </p> + </div> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="sqlite3_bfile_file_exists"></a>sqlite3_bfile_file_exists</h3> + </div> + </div> + </div> + <pre class="programlisting">int +sqlite3_bfile_file_exists(sqlite3_bfile *pBfile, int *exist); </pre> + <p> + Checks whether a BFILE exists. The + <code class="literal">exists</code> parameter is set to 1 if the file + is exists, otherwise it is 0. + </p> + <p> + On success, <code class="literal">SQLITE_OK</code> is returned. + Otherwise, <code class="literal">SQLITE_ERROR</code> is returned. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="sqlite3_bfile_size"></a>sqlite3_bfile_size</h3> + </div> + </div> + </div> + <pre class="programlisting">int +sqlite3_bfile_size(sqlite3_bfile *pBfile, off_t *size); </pre> + <p> + Returns the size of the BFILE, in bytes. + </p> + <p> + On success, <code class="literal">SQLITE_OK</code> is returned, and + <span class="bold"><strong>size</strong></span> is set to the size of + the BFILE, in bytes. + Otherwise, <code class="literal">SQLITE_ERROR</code> is returned. + </p> + <p> + This function only works on a BFILE handle which + has been created by a prior successful call to + <a class="xref" href="bfile-c.html#sqlite3_column_bfile" title="sqlite3_column_bfile">sqlite3_column_bfile</a> + and which has not been finalized by + <a class="xref" href="bfile-c.html#sqlite3_bfile_final" title="sqlite3_bfile_final">sqlite3_bfile_final</a>. + Passing any other pointer in to this function + results in undefined and probably undesirable + behavior. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="sqlite3_bfile_final"></a>sqlite3_bfile_final</h3> + </div> + </div> + </div> + <pre class="programlisting">int +sqlite3_bfile_final(sqlite3_bfile *pBfile); </pre> + <p> + Frees a BFILE handle. + </p> + <p> + On success, <code class="literal">SQLITE_OK</code> is returned. + Otherwise, <code class="literal">SQLITE_ERROR</code> is returned. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="bfile-sql.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="bfile-extension.html">Up</a> + </td> + <td width="40%" align="right"> </td> + </tr> + <tr> + <td width="40%" align="left" valign="top">BFILE SQL Objects and Functions </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> </td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/bfile-extension.html b/docs/bdb-sql/bfile-extension.html new file mode 100644 index 00000000..67f91c93 --- /dev/null +++ b/docs/bdb-sql/bfile-extension.html @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Appendix A. Using the BFILE Extension</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="prev" href="datamigration.html" title="Data Migration" /> + <link rel="next" href="bfile-sql.html" title="BFILE SQL Objects and Functions" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Appendix A. Using the BFILE Extension</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="datamigration.html">Prev</a> </td> + <th width="60%" align="center"> </th> + <td width="20%" align="right"> <a accesskey="n" href="bfile-sql.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="appendix" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title"><a id="bfile-extension"></a>Appendix A. Using the BFILE Extension</h2> + </div> + </div> + </div> + <p> + The BFILE data type allows the BDB SQL interface to access binary files that + are stored in the file system outside of the database. The binary + file can be queried in exactly the same way as any other data type + stored in the database, but Berkeley DB is able to save space in the + database file by not embedding a large amount of binary data in it. + This also helps overall database performance. + </p> + <p> + Internally, a BFILE column or attribute stores a BFILE locater, + which serves as a pointer to the binary file. The locater maintains + the directory alias and the filename. You can change the path of + BFILE without affecting the base table by using the BFILENAME function. + BFILE is somewhat like the BLOB data type, but it does not participate in + transactions and it is not recoverable. Instead, the underlying + operating system is expected to provide file integrity and durability. + </p> + <p> + The remainder of this section describes the various objects and + functions that the BFILE extension makes available to you. + In addition, complete examples of using these extensions are + available with your Berkeley DB distribution. They are placed in the + following location: + </p> + <pre class="programlisting"><db-dist>/lang/sql/sqlite/ext/bfile/examples</pre> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="bfile-support"></a>Supported Platforms and Languages</h2> + </div> + </div> + </div> + <p> + The BFILE extension is currently only supported for *nix platforms. + </p> + <p> + The BFILE extension it is not available in your library by + default. Instead, you must enable the extension when you + compile Berkeley DB. See the <em class="citetitle">Berkeley DB Installation and Build Guide</em> + for information on how to enable this extension when you build + Berkeley DB. Once you have enabled the extension, applications will + also need to load the BFILE library file: + <code class="literal">libbfile_ext.so</code>. + </p> + <p> + By default, the BFILE extension provides support for additional SQL + statements. With some extra configuration at Berkeley DB compile + time, you can also obtain support for extensions to the SQLite + C/C++ interface. Both the SQL extensions and the extensions + to the SQLite C/C++ interface are described in the + following sections. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="datamigration.html">Prev</a> </td> + <td width="20%" align="center"> </td> + <td width="40%" align="right"> <a accesskey="n" href="bfile-sql.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Data Migration </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> BFILE SQL Objects and Functions</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/bfile-sql.html b/docs/bdb-sql/bfile-sql.html new file mode 100644 index 00000000..d4b6d20e --- /dev/null +++ b/docs/bdb-sql/bfile-sql.html @@ -0,0 +1,278 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>BFILE SQL Objects and Functions</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="bfile-extension.html" title="Appendix A. Using the BFILE Extension" /> + <link rel="prev" href="bfile-extension.html" title="Appendix A. Using the BFILE Extension" /> + <link rel="next" href="bfile-c.html" title="BFILE C/C++ Objects and Functions" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">BFILE SQL Objects and Functions</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="bfile-extension.html">Prev</a> </td> + <th width="60%" align="center">Appendix A. Using the BFILE Extension</th> + <td width="20%" align="right"> <a accesskey="n" href="bfile-c.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="bfile-sql"></a>BFILE SQL Objects and Functions</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_create_directory">BFILE_CREATE_DIRECTORY</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_replace_directory">BFILE_REPLACE_DIRECTORY</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_drop_directory">BFILE_DROP_DIRECTORY</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_name">BFILE_NAME</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_fullpath">BFILE_FULLPATH</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_open">BFILE_OPEN</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_read">BFILE_READ</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_close">BFILE_CLOSE</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_size">BFILE_SIZE</a> + </span> + </dt> + </dl> + </div> + <p> + When the BFILE extension is enabled, you can create a + <code class="literal">DIRECTORY</code> object. These objects are required + before you can store a pointer to a file in a + <code class="literal">BFILE</code> column. + </p> + <p> + <code class="literal">DIRECTORY</code> objects are stored + in a special table called <code class="literal">BFILE_DIRECTORY</code>. + This table is automatically created for you when it is needed. + You should <span class="emphasis"><em>not</em></span> manually create this table. + </p> + <p> + You manage <code class="literal">DIRECTORY</code> objects using the + following SQL functions: + </p> + <table class="simplelist" border="0" summary="Simple list"> + <tr> + <td> + <a class="xref" href="bfile-sql.html#bfile_create_directory" title="BFILE_CREATE_DIRECTORY">BFILE_CREATE_DIRECTORY</a> + </td> + </tr> + <tr> + <td> + <a class="xref" href="bfile-sql.html#bfile_replace_directory" title="BFILE_REPLACE_DIRECTORY">BFILE_REPLACE_DIRECTORY</a> + </td> + </tr> + <tr> + <td> + <a class="xref" href="bfile-sql.html#bfile_drop_directory" title="BFILE_DROP_DIRECTORY">BFILE_DROP_DIRECTORY</a> + </td> + </tr> + </table> + <p> + The following sections describe the SQL functions that you can + use when the BFILE extension is enabled. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bfile_create_directory"></a>BFILE_CREATE_DIRECTORY</h3> + </div> + </div> + </div> + <pre class="programlisting">BFILE_CREATE_DIRECTORY(directory, path)</pre> + <p> + Creates a <code class="literal">DIRECTORY</code> object as a path. + The specified path must not already exist, or + <code class="literal">Directory already exists</code> + is returned. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bfile_replace_directory"></a>BFILE_REPLACE_DIRECTORY</h3> + </div> + </div> + </div> + <pre class="programlisting">BFILE_REPLACE_DIRECTORY(directory, path)</pre> + <p> + Replaces the named <code class="literal">DIRECTORY</code> object using the specified path. + If the object does not exist, <code class="literal">Directory does not exist</code> + is returned. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bfile_drop_directory"></a>BFILE_DROP_DIRECTORY</h3> + </div> + </div> + </div> + <pre class="programlisting">BFILE_DROP_DIRECTORY(directory)</pre> + <p> + Drops the named <code class="literal">DIRECTORY</code> object. If + the object does not exist, + <code class="literal">Directory does not exist</code> is returned. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bfile_name"></a>BFILE_NAME</h3> + </div> + </div> + </div> + <pre class="programlisting">BFILE_NAME(directory, filename)</pre> + <p> + Returns the BFILE locator. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bfile_fullpath"></a>BFILE_FULLPATH</h3> + </div> + </div> + </div> + <pre class="programlisting">BFILE_FULLPATH(column)</pre> + <p> + Returns the full path. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bfile_open"></a>BFILE_OPEN</h3> + </div> + </div> + </div> + <pre class="programlisting">BFILE_OPEN(column)</pre> + <p> + Extracts the directory and file names from the BFILE + locator, and then opens that file. On success, a BFILE + handle is returned. Otherwise, <code class="literal">0</code> + is returned. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bfile_read"></a>BFILE_READ</h3> + </div> + </div> + </div> + <pre class="programlisting">BFILE_READ(BFILE handle, amt, offset)</pre> + <p> + Reads at most <code class="literal">amt</code> data from the BFILE + handle, starting at <code class="literal">offset</code>. On success, + <code class="literal">Data</code> is returned. Otherwise, + <code class="literal">0</code> is returned to indicate that no more + valid data is available. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bfile_close"></a>BFILE_CLOSE</h3> + </div> + </div> + </div> + <pre class="programlisting">BFILE_CLOSE(BFILE handle)</pre> + <p> + Closes the BFILE handle. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bfile_size"></a>BFILE_SIZE</h3> + </div> + </div> + </div> + <pre class="programlisting">BFILE_SIZE(column)</pre> + <p> + Returns the size of the BFILE. On success, the size is + returned. Otherwise, -1 is returned. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="bfile-extension.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="bfile-extension.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="bfile-c.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Appendix A. Using the BFILE Extension </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> BFILE C/C++ Objects and Functions</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/buildinstall.html b/docs/bdb-sql/buildinstall.html new file mode 100644 index 00000000..b0256550 --- /dev/null +++ b/docs/bdb-sql/buildinstall.html @@ -0,0 +1,364 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Getting and Installing BDB SQL</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="next" href="accessing_bdb_sql_databases.title.html" title="Accessing BDB SQL Databases" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Getting and Installing BDB SQL</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="dbsqlbasics.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="accessing_bdb_sql_databases.title.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="buildinstall"></a>Getting and Installing BDB SQL</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="buildinstall.html#onwin">On Windows Systems</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="buildinstall.html#onunix">On Unix</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="buildinstall.html#ado_net">The BDB SQL ADO.NET Interface</a> + </span> + </dt> + </dl> + </div> + <p> + The BDB SQL interface comes as a part of the Oracle Berkeley DB + download. This can be downloaded from the + <a class="ulink" href="http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html" target="_top">Oracle Berkeley DB download page</a>. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="onwin"></a>On Windows Systems</h3> + </div> + </div> + </div> + <p> + The BDB SQL interface is automatically built and installed + whenever you build or install Berkeley DB for a Windows + system. The BDB SQL interface <code class="literal">dll</code>s and the + command line interpreter have names that differ from a + standard SQLite distribution as follows: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <code class="literal">dbsql.exe</code> + </p> + <p> + This is the command line shell. It operates + identically to the SQLite + <span class="command"><strong>sqlite3.exe</strong></span> shell. + </p> + </li> + <li> + <p> + <code class="literal">libdb_sql50.dll</code> + </p> + <p> + This is the library that provides the BDB SQL interface. + It is the equivalent of the SQLite + <code class="literal">sqlite3.dll</code> library. + </p> + </li> + </ul> + </div> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="onunix"></a>On Unix</h3> + </div> + </div> + </div> + <p> + In order to build the BDB SQL interface, you download and build + Berkeley DB, configuring it so that the BDB SQL interface is also built. + Be aware that it is not built by default. Instead, you + need to tell the Berkeley DB <code class="literal">configure</code> + script to also build the BDB SQL interface. For instructions on + building the BDB SQL interface, see <a href="../installation/build_unix.html#build_unix_sqlinter" class="olink">Building the DB SQL Interface</a> in the + <em class="citetitle">Berkeley DB Installation and Build Guide</em>. + </p> + <p> + The library and application names used when building + the BDB SQL interface are different than those used by SQLite. + If you want library and command shell names that are + consistent with the names used by SQLite, configure + the BDB SQL interface build using the compatibility + (<code class="literal">--enable-sql_compat</code>) option. + </p> + <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> + <h3 class="title">Warning</h3> + <p> + The compatibility option can break other + applications on your platform that rely on standard + SQLite. This is especially true of Mac OS X, which + uses standard SQLite for a number of default + applications. + </p> + <p> + <span class="emphasis"><em> + Use the compatibility option only if you know + exactly what you are doing. + </em></span> + </p> + </div> + <p> + Unless you built the BDB SQL interface with the compatibility + option, libraries and a command line shell + are built with the following names: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <a href="../api_reference/C/dbsql.html" class="olink">dbsql</a> + </p> + <p> + This is the command line shell. It operates + identically to the SQLite + <span class="command"><strong>sqlite3</strong></span> shell. + </p> + </li> + <li> + <p> + <code class="literal">libdb_sql</code> + </p> + <p> + This is the library that provides the BDB SQL interface. + It is the equivalent of the SQLite + <code class="literal">libsqlite3</code> library. + </p> + </li> + </ul> + </div> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="ado_net"></a>The BDB SQL ADO.NET Interface</h3> + </div> + </div> + </div> + <p> + Download the ADO.NET package from the + <a class="ulink" href="http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html" target="_top">Oracle Berkeley DB download page</a>. + </p> + <div class="sect3" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h4 class="title"><a id="ado_prereqs"></a>Prerequisites For Building The ADO.NET Package</h4> + </div> + </div> + </div> + <div class="itemizedlist"> + <ul type="disc"> + <li> + To build the Linq package, you will need to install + <code class="literal">Microsoft .NET Framework 3.5 SP1</code>. + </li> + <li> + To build SQLite.Designer, you will need to install the + <code class="literal">Microsoft Visual Studio SDK</code>. + </li> + <li> + To build on Windows Mobile you will need to install the + <code class="literal">Microsoft Windows Mobile 6.5.3 Developer Tool Kit (DTK)</code>. + </li> + <li> + To build on Windows Mobile you will need to use Visual + Studio 2008. + </li> + </ul> + </div> + </div> + <div class="sect3" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h4 class="title"><a id="ado_build_steps"></a>Building BDB SQL ADO.NET Interface For Windows</h4> + </div> + </div> + </div> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + The package contains Visual Studio solution files: + </p> + <div class="itemizedlist"> + <ul type="circle"> + <li> + <p> + <code class="literal">SQLite.NET.2008.sln</code> + and + <code class="literal">SQLite.NET.2010.sln</code> + </p> + <p> + For use by with Visual Studio 2008 + or 2010. Note that these solution + files do not build support for Linq + or SQLite Designer. + </p> + </li> + <li> + <p> + <code class="literal">SQLite.NET.2008.MSBuild.sln</code> + and + <code class="literal">SQLite.NET.2010.MSBuild.sln</code> + </p> + <p> + For use with MSBuild (Microsoft + Build Engine). These can also be + used with Visual Studio. These + solutions exclude SQLite Designer + and CompactFramework. By default, + these do not build support for + Linq. + </p> + </li> + </ul> + </div> + </li> + <li> + Change the current platform target to + <code class="literal">ReleaseNativeOnly</code> choose either + <code class="literal">Win32</code> or <code class="literal">x64</code> + depending on your target platform. + </li> + <li> + Build the solution. + </li> + </ul> + </div> + </div> + <div class="sect3" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h4 class="title"><a id="ado_build_steps_ce"></a> + Building BDB SQL ADO.NET Interface For Windows Mobile + </h4> + </div> + </div> + </div> + <p> + Building BDB SQL ADO.NET for Windows Mobile + requires Windows Mobile 6.5.3 Professional DTK. + Typical requirements for installing this toolkit + are: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + Visual Studio 2005 SP1 or Later + </p> + </li> + <li> + <p> + ActiveSync 4.5 + </p> + </li> + <li> + <p> + .NET CompactFramework 2.0 SP1 + </p> + </li> + <li> + <p> + Windows Mobile 6 SDK + </p> + </li> + </ul> + </div> + <p> + To build BDB SQL ADO.NET for Windows Mobile, do + the following: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + Open the <code class="literal">SQLite.NET.2008.WinCE.sln</code> + solution file in Visual Studio 2008. + </li> + <li> + Select <code class="literal">Load Project Normally</code></li> + <li> + Change the current platform to <code class="literal">ReleaseNativeOnly</code>. + </li> + <li> + Select <code class="literal">Configuration Manager</code>-><code class="literal">new</code>, + then type or select the platform + <code class="literal">Windows Mobile 6.5.3 Professional DTK (ARMV4I)</code>. + Choose to copy settings from + <code class="literal">Pocket PC 2003 (ARMV4I)</code></li> + <li> + Build the solution. + </li> + </ul> + </div> + </div> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="dbsqlbasics.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="accessing_bdb_sql_databases.title.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Chapter 1. Berkeley DB SQL: The Absolute Basics </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Accessing BDB SQL Databases</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/changedpragmas.html b/docs/bdb-sql/changedpragmas.html new file mode 100644 index 00000000..32d8729a --- /dev/null +++ b/docs/bdb-sql/changedpragmas.html @@ -0,0 +1,199 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Changed PRAGMAs</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="unsupportedpragmas.html" title="Unsupported PRAGMAs" /> + <link rel="next" href="addedpragmas.html" title="Added PRAGMAs" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Changed PRAGMAs</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="unsupportedpragmas.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="addedpragmas.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="changedpragmas"></a>Changed PRAGMAs</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="changedpragmas.html#auto_vacuum">PRAGMA auto_vacuum</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="changedpragmas.html#incremental_vacuum">PRAGMA incremental_vacuum</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="changedpragmas.html#journal_size_limit">PRAGMA journal_size_limit</a> + </span> + </dt> + </dl> + </div> + <p> + The following PRAGMAs are available in the BDB SQL interface, but they + behave differently in some way from standard SQLite. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="auto_vacuum"></a>PRAGMA auto_vacuum</h3> + </div> + </div> + </div> + <p> + The syntax for this PRAGMA is: + </p> + <pre class="programlisting">PRAGMA auto_vacuum +PRAGMA auto_vacuum = 0 | NONE | 1 | FULL | 2 | INCREMENTAL </pre> + <p> + Standard SQLite does not allow you to enable or + disable auto-vacuum after a table has been created. + Berkeley DB, however, allows you to change this at any time. + </p> + <p> + In the previous syntax, <code class="literal">0</code> and + <code class="literal">NONE</code> both turn off auto vacuuming. + </p> + <p> + <code class="literal">1</code> or <code class="literal">FULL</code> causes + full vacuuming to occur. That is, the BDB SQL interface will vacuum + the entire database at each commit using a very low + fill percentage (1%) in order to return emptied pages + to the file system. Because Berkeley DB allows you to call + this PRAGMA at any time, it is recommended that you do + not turn on FULL vacuuming because doing so can result + in a great deal of overhead to your transaction + commits. + </p> + <p> + If <code class="literal">2</code> or <code class="literal">INCREMENTAL</code> + is used, then incremental vacuuming is enabled. The + amount of vacuuming that is performed for incremental + vacuum is controlled using the following PRAGMAs: + </p> + <table class="simplelist" border="0" summary="Simple list"> + <tr> + <td> + <a class="xref" href="addedpragmas.html#bdbsql_vacuum_fillpercent" title="PRAGMA bdbsql_vacuum_fillpercent">PRAGMA bdbsql_vacuum_fillpercent</a> + </td> + </tr> + <tr> + <td> + <a class="xref" href="addedpragmas.html#bdbsql_vacuum_pages" title="PRAGMA bdbsql_vacuum_pages">PRAGMA bdbsql_vacuum_pages</a> + </td> + </tr> + </table> + <p> + Note that you can call + <a class="xref" href="changedpragmas.html#incremental_vacuum" title="PRAGMA incremental_vacuum">PRAGMA incremental_vacuum</a> + to perform an incremental vacuum operation on demand. + </p> + <p> + When performing vacuum operations, Berkeley DB + defragments and repacks individual database pages, + while SQLite only truncates the freelist pages from + the database file. + </p> + <p> + For more information on auto vacuum, see + <a class="ulink" href="http://www.sqlite.org/pragma.html#pragma_auto_vacuum" target="_top">PRAGMA auto_vacuum</a> + in the SQLite documentation. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="incremental_vacuum"></a>PRAGMA incremental_vacuum</h3> + </div> + </div> + </div> + <p> + Performs incremental vacuum operations on demand. You can cause + incremental vacuum operations to be performed automatically using + <a class="xref" href="changedpragmas.html#auto_vacuum" title="PRAGMA auto_vacuum">PRAGMA auto_vacuum</a>. + </p> + <p> + Note that for SQLite, this PRAGMA is used to specify + the maximum number of pages to be freed during + vacuuming. For Berkeley DB, you use + <code class="literal">PRAGMA bdbsql_vacuum_pages</code> instead. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="journal_size_limit"></a>PRAGMA journal_size_limit</h3> + </div> + </div> + </div> + <p> + For standard SQLite, this pragma identifies the + maximum size that the journal file is allowed to be. + </p> + <p> + Berkeley DB uses multiple journal files, Berkeley DB journal + files are different to a SQLite journal file in that they + contain information about multiple transactions, rather + than a single transaction (similar to the SQLite WAL + journal file). Over the course + of the database's lifetime, Berkeley DB will probably create + multiple journal files. A new journal file is created when + the current journal file has reached the maximum size + configured using the journal_size_limit pragma. + </p> + <p> + Note that a BDB SQL interface journal file is referred to as a log + file in the Berkeley DB documentation. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="unsupportedpragmas.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="addedpragmas.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Unsupported PRAGMAs </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Added PRAGMAs</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/datamigration.html b/docs/bdb-sql/datamigration.html new file mode 100644 index 00000000..fe0951f1 --- /dev/null +++ b/docs/bdb-sql/datamigration.html @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Data Migration</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="admin.html" title="Chapter 5. Administrating Berkeley DB SQL Databases" /> + <link rel="prev" href="sync.html" title="Syncing with Oracle Databases" /> + <link rel="next" href="bfile-extension.html" title="Appendix A. Using the BFILE Extension" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Data Migration</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="sync.html">Prev</a> </td> + <th width="60%" align="center">Chapter 5. Administrating Berkeley DB SQL Databases</th> + <td width="20%" align="right"> <a accesskey="n" href="bfile-extension.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="datamigration"></a>Data Migration</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="datamigration.html#shellmigrate">Migration Using the Shells</a> + </span> + </dt> + </dl> + </div> + <p> + If you have a database created by SQLite, you can migrate + it to a Berkeley DB database for use with the BDB SQL interface. For + production applications, you should do this only when your + application is shutdown. + </p> + <p> + All data and schema supported by SQLite can be migrated to a + Berkeley DB database. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="shellmigrate"></a>Migration Using the Shells</h3> + </div> + </div> + </div> + <p> + To migrate your data from SQLite to a Berkeley DB database: + </p> + <div class="orderedlist"> + <ol type="1"> + <li> + <p> + Make sure your application is shutdown. + </p> + </li> + <li> + <p> + Open the SQLite database within the + <span class="command"><strong>sqlite3</strong></span> shell. + </p> + </li> + <li> + <p> + Execute the <code class="literal">.output</code> command to + specify the location where you want to dump data. + </p> + </li> + <li> + <p> + Dump the database using the SQLite + <code class="literal">.dump</code> command. + </p> + </li> + <li> + <p> + Close the <span class="command"><strong>sqlite3</strong></span> shell and open + the Berkeley DB + <span> + <a href="../api_reference/C/dbsql.html" class="olink">dbsql</a> shell. + </span> + + </p> + </li> + <li> + <p> + Load the dumped data using the + <code class="literal">.read</code> command. + </p> + </li> + </ol> + </div> + <p> + Note that you can migrate in the reverse direction as well. + Dump the Berkeley DB database by calling <code class="literal">.dump</code> + from within the Berkeley DB + <span> + <a href="../api_reference/C/dbsql.html" class="olink">dbsql</a> shell, + </span> + + and load it into SQLite by <code class="literal">.read</code> from within + SQLite's <span class="command"><strong>sqlite3</strong></span> shell. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="sync.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="admin.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="bfile-extension.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Syncing with Oracle Databases </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Appendix A. Using the BFILE Extension</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/dbfeatures.html b/docs/bdb-sql/dbfeatures.html new file mode 100644 index 00000000..d20be241 --- /dev/null +++ b/docs/bdb-sql/dbfeatures.html @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Chapter 3. Berkeley DB Features</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="prev" href="lockhandling.html" title="Lock Handling" /> + <link rel="next" href="mvcc.html" title="Using Multiversion Concurrency Control" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Chapter 3. Berkeley DB Features</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="lockhandling.html">Prev</a> </td> + <th width="60%" align="center"> </th> + <td width="20%" align="right"> <a accesskey="n" href="mvcc.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="chapter" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title"><a id="dbfeatures"></a>Chapter 3. Berkeley DB Features</h2> + </div> + </div> + </div> + <div class="toc"> + <p> + <b>Table of Contents</b> + </p> + <dl> + <dt> + <span class="sect1"> + <a href="dbfeatures.html#bulkloading">Using Bulk Loading</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="mvcc.html">Using Multiversion Concurrency Control</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="selectpage_size.html">Selecting the Page Size</a> + </span> + </dt> + </dl> + </div> + <p> + When using the Berkeley DB SQL API, there are features that you + can manage using PRAGMAs that are unique to Berkeley DB. This + chapter discusses these features. + </p> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="bulkloading"></a>Using Bulk Loading</h2> + </div> + </div> + </div> + <p> + Bulk loading is an I/O optimization feature that is useful + when loading large amounts of data to the database inside + of a single transaction. + The bulk load optimization avoids writing some log records to + the journal file. This can provide significant performance + benefits when loading a large number of new rows into a + database. + </p> + <p> + When you use bulk load, nested transactions are + disabled. This means that you cannot undo any + single operation. Instead, if you want to undo a + given operation, you must undo everything performed + within the transaction. + </p> + <p> + It is not possible to use the bulk load functionality when + replication is enabled. + </p> + <p> + To enable bulk loading, use: + </p> + <p> + <span class="bold"><strong>PRAGMA TXN_BULK</strong></span> = 0 | 1; + </p> + <p> + Default value is <code class="literal">0</code>, which means the + PRAGMA is turned off and so bulk loading is not in use. + <code class="literal">1</code> means bulk loading is in use. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="lockhandling.html">Prev</a> </td> + <td width="20%" align="center"> </td> + <td width="40%" align="right"> <a accesskey="n" href="mvcc.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Lock Handling </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Using Multiversion Concurrency Control</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/dbsqlbasics.html b/docs/bdb-sql/dbsqlbasics.html new file mode 100644 index 00000000..2fb8f662 --- /dev/null +++ b/docs/bdb-sql/dbsqlbasics.html @@ -0,0 +1,295 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Chapter 1. Berkeley DB SQL: The Absolute Basics</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="prev" href="moreinfo.html" title="For More Information" /> + <link rel="next" href="buildinstall.html" title="Getting and Installing BDB SQL" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="moreinfo.html">Prev</a> </td> + <th width="60%" align="center"> </th> + <td width="20%" align="right"> <a accesskey="n" href="buildinstall.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="chapter" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title"><a id="dbsqlbasics"></a>Chapter 1. Berkeley DB SQL: The Absolute Basics</h2> + </div> + </div> + </div> + <div class="toc"> + <p> + <b>Table of Contents</b> + </p> + <dl> + <dt> + <span class="sect1"> + <a href="dbsqlbasics.html#identicalusage">BDB SQL Is Nearly Identical to SQLite</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="buildinstall.html">Getting and Installing BDB SQL</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="buildinstall.html#onwin">On Windows Systems</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="buildinstall.html#onunix">On Unix</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="buildinstall.html#ado_net">The BDB SQL ADO.NET Interface</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="accessing_bdb_sql_databases.title.html">Accessing BDB SQL Databases</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="journaldirectory.html">The Journal Directory</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="unsupportedpragmas.html">Unsupported PRAGMAs</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="changedpragmas.html">Changed PRAGMAs</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="changedpragmas.html#auto_vacuum">PRAGMA auto_vacuum</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="changedpragmas.html#incremental_vacuum">PRAGMA incremental_vacuum</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="changedpragmas.html#journal_size_limit">PRAGMA journal_size_limit</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="addedpragmas.html">Added PRAGMAs</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_error_file">PRAGMA bdbsql_error_file</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_lock_tablesize">PRAGMA bdbsql_lock_tablesize</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_shared_resources">PRAGMA bdbsql_shared_resources</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_single_process">PRAGMA bdbsql_single_process</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_system_memory">PRAGMA bdbsql_system_memory</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_vacuum_fillpercent">PRAGMA bdbsql_vacuum_fillpercent</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_vacuum_pages">PRAGMA bdbsql_vacuum_pages</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#multiversion">PRAGMA multiversion</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#snapshot_isolation">PRAGMA snapshot_isolation</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#trickle">PRAGMA trickle</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#txn_bulk">PRAGMA txn_bulk</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#replication_pragmas">Replication PRAGMAs</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="miscdiff.html">Miscellaneous Differences</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="bdb-concepts.html">Berkeley DB Concepts</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="sql_encryption.html">Encryption</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="sequencesupport.html">Using Sequences</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#create_sequence">create_sequence</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#seq_nextval">nextval</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#seq_currval">currval</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#seq_drop_sequence">drop_sequence</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="normal-sql.html">Differences for Users of other SQL Engines</a> + </span> + </dt> + </dl> + </div> + <p> + Welcome to the Berkeley DB SQL interface. If you are a SQLite user who is + using the BDB SQL interface for reasons other than performance + enhancements, this chapter tells you the minimum things you + need to know about the interface. You should simply read this + chapter and then skip the rest of this book. + </p> + <p> + If, however, you are using the BDB SQL interface for performance reasons, + then you need to read this chapter, plus most of the rest of + the chapters in this book (although you can probably skip most + of <a class="xref" href="admin.html" title="Chapter 5. Administrating Berkeley DB SQL Databases">Administrating Berkeley DB SQL Databases</a>, unless you + want to administer your database "the Berkeley DB way"). + </p> + <p> + Also, if you are an existing Berkeley DB user who is interested in + the BDB SQL interface, read this chapter plus the rest of this book. + </p> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="identicalusage"></a>BDB SQL Is Nearly Identical to SQLite</h2> + </div> + </div> + </div> + <p> + Your interaction with the BDB SQL interface is almost identical to + SQLite. You use the same APIs, the same command shell + environment, the same SQL statements, and the same PRAGMAs + to work with the database created by the BDB SQL interface as you + would if you were using SQLite. + </p> + <p> + To learn how to use SQLite, see the official + <a class="ulink" href="http://www.sqlite.org/docs.html" target="_top">SQLite + Documentation Page.</a> + </p> + <p> + That said, there are a few small differences between the + two interfaces. These are described in the remainder of + this chapter. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="moreinfo.html">Prev</a> </td> + <td width="20%" align="center"> </td> + <td width="40%" align="right"> <a accesskey="n" href="buildinstall.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">For More Information </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Getting and Installing BDB SQL</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/gettingStarted.css b/docs/bdb-sql/gettingStarted.css new file mode 100644 index 00000000..6a2b24b2 --- /dev/null +++ b/docs/bdb-sql/gettingStarted.css @@ -0,0 +1,50 @@ +body { width: 45em; + margin-left: 3em; + font-family: Arial, Helvetica, sans-serif; + font-size: 11pt; + } + +h2.title { margin-left: -1em; + font-family: Verdana, serif; + font-size: 16pt; + } + +h3.title { font-family: Verdana, serif; + font-size: 14pt; + } + +pre.programlisting { + font-family: monospace; + background-color: #eae8e9; +} + +div.navheader { font-size: 10pt; + width: 60em; + margin-left: -2em; + } + +div.navheader table tr td { font-size: 10pt; } + +div.navfooter { font-size: 10pt; + width: 60em; + margin-left: -2em; + } +div.navfooter table tr td { font-size: 10pt; } + +span.emphasis { font-style: italic;} + +div.appendix div.informaltable { font-size: 9pt; } +div.appendix div.informaltable td { vertical-align: top; } +div.appendix div.informaltable p { margin-top: .25em; } +div.appendix div.informaltable p { margin-bottom: .25em; } + +div.variablelist dl dt {margin-top: 1em; } + +div.libver p { + font-size: 8pt; + width: 30%; + margin-left: 2px; + margin-right: 2px; + padding-top: 3px; + padding-bottom: 3px; + } diff --git a/docs/bdb-sql/index.html b/docs/bdb-sql/index.html new file mode 100644 index 00000000..41981dc5 --- /dev/null +++ b/docs/bdb-sql/index.html @@ -0,0 +1,668 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Getting Started with the Oracle Berkeley DB SQL APIs</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="next" href="preface.html" title="Preface" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Getting Started with the Oracle Berkeley DB SQL APIs</th> + </tr> + <tr> + <td width="20%" align="left"> </td> + <th width="60%" align="center"> </th> + <td width="20%" align="right"> <a accesskey="n" href="preface.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="book" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h1 class="title"><a id="idp44688"></a>Getting Started with the Oracle Berkeley DB SQL APIs</h1> + </div> + <div> + <div class="legalnotice"> + <a id="idp50456832"></a> + <p class="legalnotice-title"> + <b>Legal Notice</b> + </p> + <span> + <p> + This documentation is distributed under an open source license. + You may review the terms of this license at: + <a class="ulink" href="http://www.oracle.com/technetwork/database/berkeleydb/downloads/oslicense-093458.html" target="_top">http://www.oracle.com/technetwork/database/berkeleydb/downloads/oslicense-093458.html</a> + + + </p> + + <p> + Oracle, Berkeley DB, + + + and + Sleepycat are trademarks or registered trademarks of + Oracle. All rights to these marks are reserved. + No third-party use is permitted without the + express prior written consent of Oracle. + </p> + + <p> + Other names may be trademarks of their respective owners. + </p> + <p> + To obtain a copy of this document's original source code, please + submit a request to the Oracle Technology Network forum at: + <a class="ulink" href="http://forums.oracle.com/forums/forum.jspa?forumID=271" target="_top">http://forums.oracle.com/forums/forum.jspa?forumID=271</a> + + + </p> + </span> + </div> + </div> + <div> + <p class="pubdate">5/11/2012</p> + </div> + </div> + <hr /> + </div> + <div class="toc"> + <p> + <b>Table of Contents</b> + </p> + <dl> + <dt> + <span class="preface"> + <a href="preface.html">Preface</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect1"> + <a href="preface.html#conventions">Conventions Used in this Book</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="moreinfo.html">For More Information</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="moreinfo.html#contact_us">Contact Us</a> + </span> + </dt> + </dl> + </dd> + </dl> + </dd> + <dt> + <span class="chapter"> + <a href="dbsqlbasics.html">1. Berkeley DB SQL: The Absolute Basics</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect1"> + <a href="dbsqlbasics.html#identicalusage">BDB SQL Is Nearly Identical to SQLite</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="buildinstall.html">Getting and Installing BDB SQL</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="buildinstall.html#onwin">On Windows Systems</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="buildinstall.html#onunix">On Unix</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="buildinstall.html#ado_net">The BDB SQL ADO.NET Interface</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="accessing_bdb_sql_databases.title.html">Accessing BDB SQL Databases</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="journaldirectory.html">The Journal Directory</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="unsupportedpragmas.html">Unsupported PRAGMAs</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="changedpragmas.html">Changed PRAGMAs</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="changedpragmas.html#auto_vacuum">PRAGMA auto_vacuum</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="changedpragmas.html#incremental_vacuum">PRAGMA incremental_vacuum</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="changedpragmas.html#journal_size_limit">PRAGMA journal_size_limit</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="addedpragmas.html">Added PRAGMAs</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_error_file">PRAGMA bdbsql_error_file</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_lock_tablesize">PRAGMA bdbsql_lock_tablesize</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_shared_resources">PRAGMA bdbsql_shared_resources</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_single_process">PRAGMA bdbsql_single_process</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_system_memory">PRAGMA bdbsql_system_memory</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_vacuum_fillpercent">PRAGMA bdbsql_vacuum_fillpercent</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#bdbsql_vacuum_pages">PRAGMA bdbsql_vacuum_pages</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#multiversion">PRAGMA multiversion</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#snapshot_isolation">PRAGMA snapshot_isolation</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#trickle">PRAGMA trickle</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#txn_bulk">PRAGMA txn_bulk</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="addedpragmas.html#replication_pragmas">Replication PRAGMAs</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="miscdiff.html">Miscellaneous Differences</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="bdb-concepts.html">Berkeley DB Concepts</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="sql_encryption.html">Encryption</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="sequencesupport.html">Using Sequences</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#create_sequence">create_sequence</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#seq_nextval">nextval</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#seq_currval">currval</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#seq_drop_sequence">drop_sequence</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="normal-sql.html">Differences for Users of other SQL Engines</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="chapter"> + <a href="lockingnotes.html">2. Locking Notes</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect1"> + <a href="lockingnotes.html#dbusage">Internal Database Usage</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="lockhandling.html">Lock Handling</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="lockhandling.html#sqllockmodel">SQLite Lock Usage</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="lockhandling.html#bdblockusage">Lock Usage with the BDB SQL Interface</a> + </span> + </dt> + </dl> + </dd> + </dl> + </dd> + <dt> + <span class="chapter"> + <a href="dbfeatures.html">3. Berkeley DB Features</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect1"> + <a href="dbfeatures.html#bulkloading">Using Bulk Loading</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="mvcc.html">Using Multiversion Concurrency Control</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="selectpage_size.html">Selecting the Page Size</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="chapter"> + <a href="sqlrep.html">4. Using Replication with the SQL API</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect1"> + <a href="sqlrep.html#repoverview">Replication Overview</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="sqlrep.html#repmasters">Replication Masters</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sqlrep.html#repelect">Elections</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sqlrep.html#repdurability">Durability Guarantees</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sqlrep.html#twositerep">Two-Site Replication Groups</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="reppragma.html">Replication PRAGMAs</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication">PRAGMA replication</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_initial_master">PRAGMA replication_initial_master</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_local_site">PRAGMA replication_local_site</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_remote_site">PRAGMA replication_remote_site</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_remove_site">PRAGMA replication_remove_site</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_verbose_output">PRAGMA replication_verbose_output</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_verbose_file">PRAGMA replication_verbose_file</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="repstatistics.html">Displaying Replication Statistics</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="rep_usageexamples.html">Replication Usage Examples</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="rep_usageexamples.html#rep_ex1">Example 1: Distributed Read at 3 Sites</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="rep_usageexamples.html#rep_ex2">Example 2: 2-Site Failover</a> + </span> + </dt> + </dl> + </dd> + </dl> + </dd> + <dt> + <span class="chapter"> + <a href="admin.html">5. Administrating Berkeley DB SQL Databases</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect1"> + <a href="admin.html#backup">Backing Up Berkeley DB SQL Databases</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="admin.html#idp50743400">Backing Up Replicated Berkeley DB SQL Databases</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="sync.html">Syncing with Oracle Databases</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="sync.html#syncunix">Syncing on Unix Platforms</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sync.html#syncwin">Syncing on Windows Platforms</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sync.html#syncwinmobile">Syncing on Windows Mobile Platforms</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="datamigration.html">Data Migration</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="datamigration.html#shellmigrate">Migration Using the Shells</a> + </span> + </dt> + </dl> + </dd> + </dl> + </dd> + <dt> + <span class="appendix"> + <a href="bfile-extension.html">A. Using the BFILE Extension</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect1"> + <a href="bfile-extension.html#bfile-support">Supported Platforms and Languages</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="bfile-sql.html">BFILE SQL Objects and Functions</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_create_directory">BFILE_CREATE_DIRECTORY</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_replace_directory">BFILE_REPLACE_DIRECTORY</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_drop_directory">BFILE_DROP_DIRECTORY</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_name">BFILE_NAME</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_fullpath">BFILE_FULLPATH</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_open">BFILE_OPEN</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_read">BFILE_READ</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_close">BFILE_CLOSE</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-sql.html#bfile_size">BFILE_SIZE</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="bfile-c.html">BFILE C/C++ Objects and Functions</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_column_bfile">sqlite3_column_bfile</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_open">sqlite3_bfile_open</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_close">sqlite3_bfile_close</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_is_open">sqlite3_bfile_is_open</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_read">sqlite3_bfile_read</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_file_exists">sqlite3_bfile_file_exists</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_size">sqlite3_bfile_size</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="bfile-c.html#sqlite3_bfile_final">sqlite3_bfile_final</a> + </span> + </dt> + </dl> + </dd> + </dl> + </dd> + </dl> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"> </td> + <td width="20%" align="center"> </td> + <td width="40%" align="right"> <a accesskey="n" href="preface.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top"> </td> + <td width="20%" align="center"> </td> + <td width="40%" align="right" valign="top"> Preface</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/journaldirectory.html b/docs/bdb-sql/journaldirectory.html new file mode 100644 index 00000000..3a0e4cde --- /dev/null +++ b/docs/bdb-sql/journaldirectory.html @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>The Journal Directory</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="accessing_bdb_sql_databases.title.html" title="Accessing BDB SQL Databases" /> + <link rel="next" href="unsupportedpragmas.html" title="Unsupported PRAGMAs" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">The Journal Directory</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="accessing_bdb_sql_databases.title.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="unsupportedpragmas.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="journaldirectory"></a>The Journal Directory</h2> + </div> + </div> + </div> + <p> + When you create a database using the BDB SQL interface, a + directory is created alongside of it. This directory + has the same name as your database file, but with a + <code class="literal">-journal</code> suffix. + </p> + <p> + That is, if you create a database called "mydb" then + the BDB SQL interface also creates a directory alongside of the + "mydb" file called "mydb-journal". + </p> + <p> + This directory contains files that are very important + for the proper functioning of the BDB SQL interface. Do not delete + this directory or any of its files unless you know what you + are doing. + </p> + <p> + In Berkeley DB terms, the journal directory contains the + environment files that are required to provide access to + databases across multiple processes. + </p> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="accessing_bdb_sql_databases.title.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="unsupportedpragmas.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Accessing BDB SQL Databases </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Unsupported PRAGMAs</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/lockhandling.html b/docs/bdb-sql/lockhandling.html new file mode 100644 index 00000000..8b3dd006 --- /dev/null +++ b/docs/bdb-sql/lockhandling.html @@ -0,0 +1,287 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Lock Handling</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="lockingnotes.html" title="Chapter 2. Locking Notes" /> + <link rel="prev" href="lockingnotes.html" title="Chapter 2. Locking Notes" /> + <link rel="next" href="dbfeatures.html" title="Chapter 3. Berkeley DB Features" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Lock Handling</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="lockingnotes.html">Prev</a> </td> + <th width="60%" align="center">Chapter 2. Locking Notes</th> + <td width="20%" align="right"> <a accesskey="n" href="dbfeatures.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="lockhandling"></a>Lock Handling</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="lockhandling.html#sqllockmodel">SQLite Lock Usage</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="lockhandling.html#bdblockusage">Lock Usage with the BDB SQL Interface</a> + </span> + </dt> + </dl> + </div> + <p> + There is a difference in how applications written for the + BDB SQL interface handle deadlocks as opposed to how deadlocks are handled + for SQLite applications. For the SQLite developer, the + following information is a necessary review in order to + understand how the BDB SQL interface behaves differently. + </p> + <p> + From a usage point of view, the BDB SQL interface behaves in the same way + as SQLite in shared cache mode. The implications of this + are explained below. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="sqllockmodel"></a>SQLite Lock Usage</h3> + </div> + </div> + </div> + <p> + As mentioned previously in this chapter, SQLite locks the + entire database while performing a transaction. It also has a + locking model that is different from the BDB SQL interface, one that + supports multiple readers, but only a single writer. In SQLite, + transactions can start as follows: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <code class="literal">BEGIN</code> + </p> + <p> + Begins the transaction, locking the entire database for + reading. Use this if you only want to read from the + database. + </p> + </li> + <li> + <p> + <code class="literal">BEGIN IMMEDIATE</code> + </p> + <p> + Begins the transaction, acquiring a "modify" lock. This + is also known as a RESERVED lock. Use this if you are + modifying the database (that is, performing + <code class="literal">INSERT</code>, <code class="literal">UPDATE</code>, + or <code class="literal">DELETE</code>). RESERVED locks and read + locks can co-exist. + </p> + </li> + <li> + <p> + <code class="literal">BEGIN EXCLUSIVE</code> + </p> + <p> + Begins the transaction, acquiring a write lock. + Transactions begun this way will be written to the disk + upon commit. No other lock can co-exist with an + exclusive lock. + </p> + </li> + </ul> + </div> + <p> + The last two statements are a kind of a contract. If you can + get them to complete (that is, not return + <code class="literal">SQLITE_LOCKED</code>), then you can start modifying + the database (that is, change data in the in-memory cache), and + you will eventually be able to commit (write) your + modifications to the database. + </p> + <p> + In order to avoid deadlocks in SQLite, programmers who want + to modify a SQLite database start the transaction with + <code class="literal">BEGIN IMMEDIATE</code>. If the transaction cannot + acquire the necessary locks, it will fail, returning + <code class="literal">SQLITE_BUSY</code>. At that point, the transaction + falls back to an unlocked state whereby it holds no locks + against the database. This means that any existing transactions in a + RESERVED state can safely wait for the necessary EXCLUSIVE lock + in order to finally write their modifications from the + in-memory cache to the on-disk database. + </p> + <p> + The important point here is that so long as the programmer uses + these locks correctly, he can assume that he can proceed with + his work without encountering a deadlock. (Assuming that all + database readers and writers are also using these locks + correctly.) + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="bdblockusage"></a>Lock Usage with the BDB SQL Interface</h3> + </div> + </div> + </div> + <p> + When you use the BDB SQL interface, you can + begin your transaction with <code class="literal">BEGIN</code> or <code class="literal">BEGIN EXCLUSIVE</code>. + </p> + <p> + Note that the <code class="literal">IMMEDIATE</code> keyword is ignored in the BDB SQL interface (<code class="literal">BEGIN IMMEDIATE</code> behaves like <code class="literal">BEGIN</code>). + </p> + <p> + When you begin your transaction with <code class="literal">BEGIN</code>, Berkeley DB decides what kind of a lock + you need based on what you are doing to the database. If + you perform an action that is read-only, it acquires a read + lock. If you perform a write action, it acquires a write + lock. + </p> + <p> + Also, the BDB SQL interface supports multiple readers + <span class="emphasis"><em>and</em></span> multiple writers. This means that + multiple transactions can acquire locks + as long as they are not trying to modify the + same page. For example: + </p> + <p> + <span class="bold"><strong>Session 1:</strong></span> + </p> + <pre class="programlisting">dbsql> create table a(x int); +dbsql> begin; +dbsql> insert into a values (1); +dbsql> commit; </pre> + <p> + <span class="bold"><strong>Session 2:</strong></span> + </p> + <pre class="programlisting">dbsql> create table b(x int); +dbsql> begin; +dbsql> insert into b values (1); +dbsql> commit; </pre> + <p> + Because these two sessions are operating on different pages + in the Berkeley DB cache, this example will work. If you tried + this with SQLite, you could not start the second + transaction until the first had completed. + </p> + <p> + However, if you do this using the BDB SQL interface: + </p> + <p> + <span class="bold"><strong>Session 1:</strong></span> + </p> + <pre class="programlisting">dbsql> begin; +dbsql> insert into a values (2);</pre> + <p> + <span class="bold"><strong>Session 2:</strong></span> + </p> + <pre class="programlisting">dbsql> begin; +dbsql> insert into a values (2); </pre> + <p> + The second session blocks until the first session commits + the transaction. Again, this is because both sessions are + operating on the same database page(s). However, if you + simultaneously attempt to write pages in reverse order, you + can deadlock. For example: + </p> + <p> + <span class="bold"><strong>Session 1:</strong></span> + </p> + <pre class="programlisting">dbsql> begin; +dbsql> insert into a values (3); +dbsql> insert into b values (3); +</pre> + <p> + <span class="bold"><strong>Session 2:</strong></span> + </p> + <pre class="programlisting">dbsql> begin; +dbsql> insert into b values (3); +dbsql> insert into a values (3); +Error: database table is locked +</pre> + <p> + What happens here is that Session 1 is blocked waiting + for a lock on table b, while Session 2 is blocked + waiting for a lock on table a. The application can make + no forward progress, and so it is deadlocked. + </p> + <p> + When such a deadlock is detected one session loses the lock it got + when executing its last statement, and that statement is automatically rolled back. + The rest of the statements in the session will still be valid, and you can + continue to execute statements in that session. + The session that does not lose its lock to deadlock detection + will continue to execute as if nothing happened. + </p> + <p> + Assume Session 2 was sacrificed to deadlock detection, no value would be inserted into a and an error will be returned. + But the insertion of value 3 into b would still be valid. + Session 1 would continue to wait while inserting into table b + until Session 2 either commits or aborts, thus freeing the lock it has on table b. + </p> + <p> + When you begin your transaction with <code class="literal">BEGIN EXCLUSIVE</code>, the session is + never aborted due to deadlock or lock contention with another transaction. + Non-exclusive transactions are allowed to execute concurrently with the exclusive + transaction, but the non-exclusive transactions will have their locks + released if deadlock with the exclusive transaction occurs. If two or + more exclusive transactions are running at the same time, they + will be forced to execute in serial. + </p> + <p>If Session 1 was using an exclusive transaction, + then Session 2 would lose its locks when deadlock is detected between the two. + If both Session 1 and Session 2 start an exclusive transaction, then the + last one to start the exclusive transaction would be blocked after + executing <code class="literal">BEGIN EXCLUSIVE</code> until the first one is committed or aborted. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="lockingnotes.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="lockingnotes.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="dbfeatures.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Chapter 2. Locking Notes </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Chapter 3. Berkeley DB Features</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/lockingnotes.html b/docs/bdb-sql/lockingnotes.html new file mode 100644 index 00000000..c5da5a5b --- /dev/null +++ b/docs/bdb-sql/lockingnotes.html @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Chapter 2. Locking Notes</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="prev" href="normal-sql.html" title="Differences for Users of other SQL Engines" /> + <link rel="next" href="lockhandling.html" title="Lock Handling" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Chapter 2. Locking Notes</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="normal-sql.html">Prev</a> </td> + <th width="60%" align="center"> </th> + <td width="20%" align="right"> <a accesskey="n" href="lockhandling.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="chapter" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title"><a id="lockingnotes"></a>Chapter 2. Locking Notes</h2> + </div> + </div> + </div> + <div class="toc"> + <p> + <b>Table of Contents</b> + </p> + <dl> + <dt> + <span class="sect1"> + <a href="lockingnotes.html#dbusage">Internal Database Usage</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="lockhandling.html">Lock Handling</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="lockhandling.html#sqllockmodel">SQLite Lock Usage</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="lockhandling.html#bdblockusage">Lock Usage with the BDB SQL Interface</a> + </span> + </dt> + </dl> + </dd> + </dl> + </div> + <p> + There are some important performance differences between the + BDB SQL interface and SQLite, especially in a concurrent environment. + This chapter gives you enough information about how the BDB SQL interface + uses its database, as opposed to how SQLite uses its + database, in order for you to understand the difference between + the two interfaces. It then gives you some advice on how to + best approach working with the BDB SQL interface in a multi-threaded + environment. + </p> + <p> + If you are an existing user of SQLite, and you care about + improving your application performance when using the BDB SQL interface in + a concurrent situation, you should read this chapter. Existing + users of Berkeley DB may also find some interesting information in + this chapter, although it is mostly geared towards SQLite + users. + </p> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="dbusage"></a>Internal Database Usage</h2> + </div> + </div> + </div> + <p> + The BDB SQL interface and SQLite do different things + when it comes to locking data in their databases. In order + to provide ACID transactions, both products must prevent + concurrent access during write operations. Further, both + products prevent concurrent access by obtaining software + level locks that allow only the current holder of the lock to + perform write access to the locked data. + </p> + <p> + The difference between the two is that when SQLite + requires a lock (such as when a transaction is underway), it + locks the entire database and all tables. (This is known as + <span class="emphasis"><em>database level locking</em></span>.) The BDB SQL interface, on the + other hand, only locks the portion of the table being + operated on within the current transactional context (this is + known as <span class="emphasis"><em>page level locking</em></span>). In most + situations, this allows applications using the BDB SQL interface to + operate concurrently and so have better read/write + throughput than applications using SQLite. + This is because there is less lock contention. + </p> + <p> + By default, one Berkeley DB logical database is created within the + single database file for every SQL table that you create. Within + each such logical database, each table row is represented as a + Berkeley DB key/data pair. + </p> + <p> + This is important because the BDB SQL interface uses Berkeley DB's Transaction + Data Store product. This means that Berkeley DB does not have to + lock an entire database (all the tables within a database + file) when it acquires a lock. Instead, it locks a single + Berkeley DB database page (which usually contains a small sub-set + of rows within a single table). + </p> + <p> + The size of database pages will differ from platform to + platform (you can also manually configure this), but usually + a database page can hold multiple key/data pairs; that is, + multiple rows from a SQL table. Exactly how many table + rows fit on a database page depends on the size of your page + and the size of your table rows. + </p> + <p> + If you have an exceptionally small table, it is possible for + the entire table to fit on a single database page. In this + case, Berkeley DB is in essence forced to serialize access to the + entire table when it requires a lock for it. + </p> + <p> + Note, however, that the case of a single table fitting on a + single database page is very rare, and it in fact represents the + abnormal case. Normally tables span multiple pages and so Berkeley DB + will lock only portions of your tables. This locking behavior is + automatic and transparent to your application. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="normal-sql.html">Prev</a> </td> + <td width="20%" align="center"> </td> + <td width="40%" align="right"> <a accesskey="n" href="lockhandling.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Differences for Users of other SQL Engines </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Lock Handling</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/miscdiff.html b/docs/bdb-sql/miscdiff.html new file mode 100644 index 00000000..491b9a48 --- /dev/null +++ b/docs/bdb-sql/miscdiff.html @@ -0,0 +1,189 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Miscellaneous Differences</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="addedpragmas.html" title="Added PRAGMAs" /> + <link rel="next" href="bdb-concepts.html" title="Berkeley DB Concepts" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Miscellaneous Differences</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="addedpragmas.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="bdb-concepts.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="miscdiff"></a>Miscellaneous Differences</h2> + </div> + </div> + </div> + <p> + The following miscellaneous differences also exist between + the BDB SQL interface and SQLite: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + The BDB SQL interface does not support the <code class="literal">IMMEDIATE</code> keyword + (<code class="literal">BEGIN IMMEDIATE</code> behaves just like <code class="literal">BEGIN</code>). + </p> + </li> + <li> + <p> + When an exclusive transaction is active, it will + block any new transactions from beginning (they + will be blocked during their first operation until + the exclusive transactions commits or aborts). + Non-exclusive transactions that are active when the + exclusive transaction begins will not be able to + execute any more operations without being blocked + until the exclusive transactions finishes. + </p> + </li> + <li> + <p> + Enabling MVCC mostly disables exclusive + transactions. Exclusive transactions can still be + used, but they will run concurrently with regular + transactions, even ones that write to the database. + The only advantage of exclusive transactions in + this case is that two exclusive transactions will + be forced to run in serial, and that if an + exclusive transaction and non-exclusive transaction + experience deadlock, then the non-exclusive + transaction will always be the transaction forced + to release its locks. + </p> + <p> + For more information on MVCC and snapshot + isolation, see + <a class="xref" href="mvcc.html" title="Using Multiversion Concurrency Control">Using Multiversion Concurrency Control</a> + </p> + </li> + <li> + <p> + There are differences in how the two products work + in a concurrent application that will cause the + BDB SQL interface to deadlock where SQLite would result in a + different error. This is because the products use + different locking paradigms. See + <a class="xref" href="lockingnotes.html" title="Chapter 2. Locking Notes">Locking Notes</a> + for more information. + </p> + </li> + <li> + <p> + The BDB SQL does not call the busy callback when a + session attempts to operate the same database page + that another session has locked. It blocks + instead. This means that the functions + <code class="literal">sqlite3_busy_handler</code> and + <code class="literal">sqlite3_busy_timeout</code> are not + effective in BDB SQL. + </p> + </li> + <li> + <p> + The BDB SQL does not support two phase commit across databases. + Attaching to multiple databases can lead to inconsistency + after recovery and undetected deadlocks when + accessing multiple databases from concurrent transactions + in different order. Hence, applications must ensure that + they access databases in the same order in any transaction + that spans multiple databases. Else, a deadlock can + occur that causes threads to block, and the deadlock will + not be detected by Berkeley DB. + </p> + </li> + <li> + <p> + In BDB SQL, when two sessions accessing the same database + perform conflicting operations on the same page, one session + will be blocked until the conflicting operations are resolved. + For example, + </p> + <p><span class="bold"><strong>Session 1:</strong></span> + </p> + <pre class="programlisting">dbsql> insert into a values (4); +dbsql> begin; +dbsql> insert into a values (5); </pre> + <p> + <span class="bold"><strong>Session 2:</strong></span> + </p> + <pre class="programlisting">dbsql> select * from a; +</pre> + <p> + What happens here is that Session 2 is blocked until Session 1 commits the transaction. + </p> + <p><span class="bold"><strong>Session 1:</strong></span> + </p> + <pre class="programlisting">dbsql> commit; +</pre> + <p> + <span class="bold"><strong>Session 2:</strong></span> + </p> + <pre class="programlisting">dbsql> select * from a; +4 +5 +</pre> + <p> + Under such situations in SQLite, operations poll + instead of blocking, and a callback is used to + determine whether to continue polling. + </p> + </li> + <li> + <p> + By default, you always only have a single database + file when you use BDB SQL interface SQL, just as you do + when you use SQLite. However, you can configure + BDB SQL interface at compile time to create one BDB SQL interface + database file for each SQL table that you + create. How to perform this configuration is + described in the <em class="citetitle">Berkeley DB Installation and Build Guide</em>. + </p> + </li> + </ul> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="addedpragmas.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="bdb-concepts.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Added PRAGMAs </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Berkeley DB Concepts</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/moreinfo.html b/docs/bdb-sql/moreinfo.html new file mode 100644 index 00000000..04966f49 --- /dev/null +++ b/docs/bdb-sql/moreinfo.html @@ -0,0 +1,142 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>For More Information</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="preface.html" title="Preface" /> + <link rel="prev" href="preface.html" title="Preface" /> + <link rel="next" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">For More Information</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="preface.html">Prev</a> </td> + <th width="60%" align="center">Preface</th> + <td width="20%" align="right"> <a accesskey="n" href="dbsqlbasics.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="moreinfo"></a>For More Information</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="moreinfo.html#contact_us">Contact Us</a> + </span> + </dt> + </dl> + </div> + <p> + Beyond this manual, you may also find the following sources of + information useful when using the Berkeley DB SQL interface: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <a class="ulink" href="http://download.oracle.com/docs/cd/E17076_02/html/installation/index.html" target="_top"> + Berkeley DB Installation and Build Guide + </a> + </p> + </li> + <li> + <p> + <a class="ulink" href="http://download.oracle.com/docs/cd/E17076_02/html/programmer_reference/index.html" target="_top"> + Berkeley DB Programmer's Reference Guide + </a> + </p> + </li> + <li> + <p> + <a class="ulink" href="http://download.oracle.com/docs/cd/E17076_02/html/gsg_db_rep/C/index.html" target="_top"> + Berkeley DB Getting Started with Replicated Applications + </a> + </p> + </li> + </ul> + </div> + <span> + <p> + To download the latest + + + + documentation along with white papers and other collateral, + visit <a class="ulink" href="http://www.oracle.com/technetwork/indexes/documentation/index.html" target="_top">http://www.oracle.com/technetwork/indexes/documentation/index.html</a>. + </p> + <p> + For the latest version of the Oracle + + + + downloads, visit + <a class="ulink" href="http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html" target="_top">http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html</a>. + </p> + </span> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="contact_us"></a>Contact Us</h3> + </div> + </div> + </div> + <p> + You can post your comments and questions at the Oracle + Technology (OTN) forum for + <span> + Oracle Berkeley DB at: <a class="ulink" href="http://forums.oracle.com/forums/forum.jspa?forumID=271" target="_top">http://forums.oracle.com/forums/forum.jspa?forumID=271</a>, + or for Oracle Berkeley DB High Availability at: <a class="ulink" href="http://forums.oracle.com/forums/forum.jspa?forumID=272" target="_top">http://forums.oracle.com/forums/forum.jspa?forumID=272</a>. + </span> + + + </p> + <p> + For sales or support information, email to: + <a class="ulink" href="mailto:berkeleydb-info_us@oracle.com" target="_top">berkeleydb-info_us@oracle.com</a> + You can subscribe to a low-volume email announcement list for + the Berkeley DB product family by sending email to: + <a class="ulink" href="mailto:bdb-join@oss.oracle.com" target="_top">bdb-join@oss.oracle.com</a> + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="preface.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="preface.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="dbsqlbasics.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Preface </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Chapter 1. Berkeley DB SQL: The Absolute Basics</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/mvcc.html b/docs/bdb-sql/mvcc.html new file mode 100644 index 00000000..2cec5b0c --- /dev/null +++ b/docs/bdb-sql/mvcc.html @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Using Multiversion Concurrency Control</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbfeatures.html" title="Chapter 3. Berkeley DB Features" /> + <link rel="prev" href="dbfeatures.html" title="Chapter 3. Berkeley DB Features" /> + <link rel="next" href="selectpage_size.html" title="Selecting the Page Size" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Using Multiversion Concurrency Control</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="dbfeatures.html">Prev</a> </td> + <th width="60%" align="center">Chapter 3. Berkeley DB Features</th> + <td width="20%" align="right"> <a accesskey="n" href="selectpage_size.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="mvcc"></a>Using Multiversion Concurrency Control</h2> + </div> + </div> + </div> + <p> + Multiversion Concurrency Control (MVCC) enables snapshot + isolation. Snapshot isolation means that whenever a + transaction would take a read lock on a page, it + makes a copy of the page instead, and then performs its + operations on that copied page. This frees other writers + from blocking due to a read locks held by other + transactions. + </p> + <p> + You should use snapshot isolation whenever you have a lot + of read-only transactions operating at the same time that + read-write transactions. In this case, snapshot isolation + will improve transaction throughput, albeit at the cost of + greater resource usage. + </p> + <p> + MVCC is described in more detail in + <a href="../programmer_reference/transapp_read.html#snapshot_isolation" class="olink">Snapshot Isolation.</a> + </p> + <p> + To use MVCC, you must enable it before you access any + database tables. Once MVCC is enabled, you can turn + snapshot isolation on and off at anytime during the life of + your application. + </p> + <p> + To turn MVCC on, use: + </p> + <p> + <span class="bold"><strong>PRAGMA multiversion</strong></span> = on | off; + </p> + <p> + This PRAGMA must be enabled before you access any database + tables during your application runtime, or an error is + returned. Turning MVCC on automatically enables snapshot + isolation. By default MVCC is turned off. + </p> + <p> + Once MVCC is enabled, you can turn snapshot isolation on + and off using: + </p> + <p> + <span class="bold"><strong>PRAGMA snapshot_isolation</strong></span> = on | off; + </p> + <p> + This PRAGMA can be used at any time during the life of your + application <span class="emphasis"><em>after</em></span> MVCC has been turned + on. If you attempt to enable or disable snapshot isolation + before MVCC is enabled, an error is returned. + </p> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="dbfeatures.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbfeatures.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="selectpage_size.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Chapter 3. Berkeley DB Features </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Selecting the Page Size</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/normal-sql.html b/docs/bdb-sql/normal-sql.html new file mode 100644 index 00000000..403510b3 --- /dev/null +++ b/docs/bdb-sql/normal-sql.html @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Differences for Users of other SQL Engines</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="sequencesupport.html" title="Using Sequences" /> + <link rel="next" href="lockingnotes.html" title="Chapter 2. Locking Notes" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Differences for Users of other SQL Engines</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="sequencesupport.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="lockingnotes.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="normal-sql"></a>Differences for Users of other SQL Engines</h2> + </div> + </div> + </div> + <p> + If you are used to a SQL implementation from other SQL + engine (such as Oracle's RDBMS), the SQL used by the BDB SQL interface + (which is the same as used by SQLite) may hold some surprises for + you. + </p> + <p> + Some things in particular to take note of: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + Datatyping is weaker in SQLite than it is with + standard SQL. For example, SQLite does not + enforce the length of a <code class="literal">VARCHAR</code>. + While standard SQL will truncate a + <code class="literal">VARCHAR</code> that is too long, you + could (for example) declare a + <code class="literal">VARCHAR(10)</code> then put 500 + characters in it without any truncation, ever. + </p> + <p> + SQLite datatyping is described in detail on the + Datatypes in SQLite Version 3 page. + </p> + </li> + <li> + <p> + Do not use autocommit with SQLite. Instead, use + <code class="literal">begin exclusive</code> + and then <code class="literal">commit</code>. + </p> + </li> + <li> + <p> + How NULLs are handled in SQLite may be different from what + you are used to. See + + NULL Handling in SQLite Versus Other Database Engines + + for details. + </p> + </li> + <li> + <p> + There are some features of SQL that SQLite does + not support. For more information, see + + SQL Features That SQLite Does Not Implement. + + </p> + </li> + </ul> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="sequencesupport.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="lockingnotes.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Using Sequences </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Chapter 2. Locking Notes</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/preface.html b/docs/bdb-sql/preface.html new file mode 100644 index 00000000..3d3f8a49 --- /dev/null +++ b/docs/bdb-sql/preface.html @@ -0,0 +1,147 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Preface</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="prev" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="next" href="moreinfo.html" title="For More Information" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Preface</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td> + <th width="60%" align="center"> </th> + <td width="20%" align="right"> <a accesskey="n" href="moreinfo.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="preface" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title"><a id="preface"></a>Preface</h2> + </div> + </div> + </div> + <div class="toc"> + <p> + <b>Table of Contents</b> + </p> + <dl> + <dt> + <span class="sect1"> + <a href="preface.html#conventions">Conventions Used in this Book</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="moreinfo.html">For More Information</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="moreinfo.html#contact_us">Contact Us</a> + </span> + </dt> + </dl> + </dd> + </dl> + </div> + <p> + Welcome to the Berkeley DB SQL interface. This manual describes how to + configure and use the SQL interface to Berkeley DB 11<span class="emphasis"><em>g</em></span> Release 2. + This manual also describes common administrative + tasks, such as backup and restore, database dump and load, and data + migration when using the BDB SQL interface. + </p> + <p> + This manual is intended for anyone who wants to use the BDB SQL interface. + Because usage of the BDB SQL interface is very nearly identical to SQLite, + prior knowledge of SQLite is assumed by this manual. No prior + knowledge of Berkeley DB is necessary, but it is helpful. + </p> + <p> + To learn about SQLite, see the + official SQLite website at: + <a class="ulink" href="http://www.sqlite.org/" target="_top"> + http://www.sqlite.org + </a> + </p> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="conventions"></a>Conventions Used in this Book</h2> + </div> + </div> + </div> + <p> + The following typographical conventions are used within in this manual: + </p> + <p> + Keywords or literal text that you are expected to type is presented + in a <code class="literal">monospaced font</code>. For example: "Use the + <code class="literal">DB_HOME</code> environment variable to identify the + location of your environment directory." + </p> + <p> + Variable or non-literal text is presented in <span class="emphasis"><em>italics</em></span>. For example: + "Go to your <span class="emphasis"><em>DB_INSTALL</em></span> directory." + </p> + <p> + Program examples and literal text that you might type are displayed in a + <code class="literal">monospaced font</code> on a shaded background. + For example: + </p> + <pre class="programlisting">/* File: gettingstarted_common.h */ +typedef struct stock_dbs { + DB *inventory_dbp; /* Database containing inventory information */ + DB *vendor_dbp; /* Database containing vendor information */ + + char *db_home_dir; /* Directory containing the database files */ + char *inventory_db_name; /* Name of the inventory database */ + char *vendor_db_name; /* Name of the vendor database */ +} STOCK_DBS; </pre> + <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> + <h3 class="title">Note</h3> + <p> + Finally, notes of interest are represented using a note block such + as this. + </p> + </div> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td> + <td width="20%" align="center"> </td> + <td width="40%" align="right"> <a accesskey="n" href="moreinfo.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Getting Started with the Oracle Berkeley DB SQL APIs </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> For More Information</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/rep_usageexamples.html b/docs/bdb-sql/rep_usageexamples.html new file mode 100644 index 00000000..1894ef10 --- /dev/null +++ b/docs/bdb-sql/rep_usageexamples.html @@ -0,0 +1,243 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Replication Usage Examples</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="sqlrep.html" title="Chapter 4. Using Replication with the SQL API" /> + <link rel="prev" href="repstatistics.html" title="Displaying Replication Statistics" /> + <link rel="next" href="admin.html" title="Chapter 5. Administrating Berkeley DB SQL Databases" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Replication Usage Examples</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="repstatistics.html">Prev</a> </td> + <th width="60%" align="center">Chapter 4. Using Replication with the SQL API</th> + <td width="20%" align="right"> <a accesskey="n" href="admin.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="rep_usageexamples"></a>Replication Usage Examples</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="rep_usageexamples.html#rep_ex1">Example 1: Distributed Read at 3 Sites</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="rep_usageexamples.html#rep_ex2">Example 2: 2-Site Failover</a> + </span> + </dt> + </dl> + </div> + <p> + In this section we provide two examples of using + replication with BDB SQL. The first example shows a + typical startup process. The second demonstrates master + site failover. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="rep_ex1"></a>Example 1: Distributed Read at 3 Sites</h3> + </div> + </div> + </div> + <p> + This example shows how a typical replication group + startup sequence is performed. It initially populates + the master, then starts two replicas so that read + operations can be distributed. Then it shows what + happens when an attempt is made to write to a replica. + </p> + <p> + Site 1: + </p> + <pre class="programlisting"># Start initial master. +# univ.db does not yet exist. +dbsql univ.db + pragma replication_local_site="site1:7000"; + pragma replication_initial_master=ON; + pragma replication=ON; + + # Create and populate university and country tables. + .read university.sql </pre> + <p> + Site 2: + </p> + <pre class="programlisting"># Start first replica. +# univ.db does not yet exist. +dbsql univ.db + pragma replication_local_site="site2:7001"; + pragma replication_remote_site="site1:7000"; + pragma replication=ON; </pre> + <p> + Site 3: + </p> + <pre class="programlisting"># Start second replica. +# univ.db does not yet exist. +dbsql univ.db + pragma replication_local_site="site3:7002"; + pragma replication_remote_site="site1:7000"; + pragma replication=ON; </pre> + <p> + Site 1: + </p> + <pre class="programlisting"> # Perform some writes and reads on master. + insert into country values ("Greenland","gl", 0, 0, 0, 2); + insert into university values (26, "University College London", + "ucl.edu", "uk", "Europe", 18, 39, 47, 30); + select * from country where abbr = "gl"; + update country set top_1000 = 1 where abbr = "gl"; </pre> + <p> + Site 2: + </p> + <pre class="programlisting"> # Perform some reads on first replica. + select * from university where region = "Europe"; + select count(*) from country where top_100 > 0; + + # Attempt to write on first replica. + insert into country values ("Antarctica","an", 0, 0, 0, 0); + .../univ.db: DBcursor->put: attempt to modify a read-only database + Error: attempt to write to a readonly database</pre> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="rep_ex2"></a>Example 2: 2-Site Failover</h3> + </div> + </div> + </div> + <p> + This example demonstrates failover of the master from + one site to another. It shows how a failed site can + rejoin the replication group, and it shows that there + is a window of time during which write operations + cannot be performed for the replication group. Finally, + it shows how to check the master's location. + </p> + <p> + Site 1: + </p> + <pre class="programlisting"># Start initial master. +# quote.db does not yet exist. +dbsql quote.db + pragma replication_local_site="site1:7000"; + pragma replication_initial_master=ON; + pragma replication=ON; + + # Create stock quote application table. + create table stock_quote (company_name text(40), price real);</pre> + <p> + Site 2: + </p> + <pre class="programlisting"># Start replica. +# quote.db does not yet exist. +dbsql quote.db + pragma replication_local_site="site2:7001"; + pragma replication_remote_site="site1:7000"; + pragma replication=ON; </pre> + <p> + Site 1: + </p> + <pre class="programlisting"> # Perform some writes on master. + insert into stock_quote values ("General Electric", 20.25); + insert into stock_quote values ("Nabisco", 24.75); + insert into stock_quote values ("United Healthcare", 31.00); + update stock_quote set price=25.25 where company_name = "Nabisco";</pre> + <p> + Site 2: + </p> + <pre class="programlisting"> # Perform some reads on replica. + select * from stock_quote where price < 30.00; + select price from stock_quote where + company_name = "General Electric";</pre> + <p> + Site 1: + </p> + <pre class="programlisting"> # Stop the initial master. + .exit </pre> + <p> + Site 2: + </p> + <pre class="programlisting"> ########## + ### Now the remaining site does not accept write operations until + ### the other site rejoins the replication group. + ########## + insert into stock_quote values ("Prudential", 17.25); + .../quote.db: DBcursor->put: attempt to modify a read-only database + Error: attempt to write to a readonly database</pre> + <p> + Site 1: + </p> + <pre class="programlisting"># Restart site, will rejoin replication group. +dbsql quote.db + # The earlier replication=ON causes replication to be + # automatically started. This site may or may not become master + # after rejoining replication group. Check status of site's + # startup and determine whether it is a master or a replica. + .stat :rep: + Replication summary statistics + Environment configured as a replication master + 1/49056 Maximum permanent LSN + 2 Number of environments in the replication group + 0 Number of failed message sends + 0 Number of messages ignored due to pending recovery + 0 Number of log records currently queued + + # Assuming this site became master, perform some writes. + # If this site is not the master, these writes will not + # succeed and must be performed at the other site. + insert into stock_quote values ("Raytheon", 9.25); + insert into stock_quote values ("Cadbury", 7.75); </pre> + <p> + Site 2: + </p> + <pre class="programlisting"> # Read operations can be performed on master or replica + # site. + select * from stock_quote where price < 21.00; </pre> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="repstatistics.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="sqlrep.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="admin.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Displaying Replication Statistics </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Chapter 5. Administrating Berkeley DB SQL Databases</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/reppragma.html b/docs/bdb-sql/reppragma.html new file mode 100644 index 00000000..dac81daf --- /dev/null +++ b/docs/bdb-sql/reppragma.html @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Replication PRAGMAs</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="sqlrep.html" title="Chapter 4. Using Replication with the SQL API" /> + <link rel="prev" href="sqlrep.html" title="Chapter 4. Using Replication with the SQL API" /> + <link rel="next" href="repstatistics.html" title="Displaying Replication Statistics" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Replication PRAGMAs</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="sqlrep.html">Prev</a> </td> + <th width="60%" align="center">Chapter 4. Using Replication with the SQL API</th> + <td width="20%" align="right"> <a accesskey="n" href="repstatistics.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="reppragma"></a>Replication PRAGMAs</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication">PRAGMA replication</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_initial_master">PRAGMA replication_initial_master</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_local_site">PRAGMA replication_local_site</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_remote_site">PRAGMA replication_remote_site</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_remove_site">PRAGMA replication_remove_site</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_verbose_output">PRAGMA replication_verbose_output</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_verbose_file">PRAGMA replication_verbose_file</a> + </span> + </dt> + </dl> + </div> + <p> + To control replication when using the Berkeley DB SQL + interface, you use the following PRAGMAs. For an example of + how to use these, see + <a class="xref" href="rep_usageexamples.html" title="Replication Usage Examples">Replication Usage Examples</a>. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="pragma_replication"></a>PRAGMA replication</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA replication=ON|OFF </pre> + <p> + Enables the local environment to participate in + replication. + </p> + <p> + Before invoking this PRAGMA for a brand new + database (one that has never been opened), you + must invoke the + <code class="literal">replication_local_site</code> PRAGMA + and then either the + <code class="literal">replication_initial_master</code> or + the <code class="literal">replication_remote_site</code> + PRAGMA. These actions define the way this site fits + into the replication group. + </p> + <p> + If you are enabling replication for an existing + database, it must become the initial master for a + new replication group. You must invoke the + <code class="literal">replication_local_site</code> PRAGMA + followed by the + <code class="literal">replication_initial_master</code> + PRAGMA before enabling replication. + </p> + <p> + If you use this PRAGMA to turn off replication, + then replication is completely disabled for the + environment. In order to enable replication again, + you follow the procedure used to enable replication + on an existing database; that is, invoke the + <code class="literal">replication_local_site</code> PRAGMA + followed by the + <code class="literal">replication_initial_master</code> + PRAGMA, followed by + <code class="literal">PRAGMA replication=ON</code>. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="pragma_replication_initial_master"></a>PRAGMA replication_initial_master</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA replication_initial_master=ON|OFF </pre> + <p> + Causes the local environment to start up as a + master site. This PRAGMA must be used once and only + once in the replicated lifetime of a BDB SQL + environment. + </p> + <p> + This PRAGMA is usually invoked for the first site in a + new replication group before the + <code class="literal">replication</code> PRAGMA is invoked + and before BDB SQL initially creates the underlying + BDB environment for a SQL database. Starting + replication on the initial master site establishes + the new replication group so that other sites can + join it. + </p> + <p> + However, you must call this PRAGMA + when enabling replication for a database that + already exists. Doing so causes the existing + database to become the replication master for a new + replication group. + </p> + <p> + Note that subsequent election activity can cause + other sites in the replication group to become + master. Do not assume that the initial master site + will remain master indefinitely, or that it will + rejoin the replication group as master after a + shutdown. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="pragma_replication_local_site"></a>PRAGMA replication_local_site</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA replication_local_site="hostname:port" </pre> + <p> + Sets the local site information for replication. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="pragma_replication_remote_site"></a>PRAGMA replication_remote_site</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA replication_remote_site="hostname:port" </pre> + <p> + Sets information about a remote helper site in the + replication group. + </p> + <p> + This PRAGMA is needed when a site first joins an + existing replication group to specify a site that + is already in the replication group. It must be + invoked before the <code class="literal">replication</code> + PRAGMA is invoked. This PRAGMA is not needed on + the initial master site or when restarting a site + that is already a member of the replication group. + However, supplying this PRAGMA in those situations + does no harm. + </p> + <p> + Note that the information provided to this PRAGMA + can be superseded by normal replication activity + over the course of the environment's lifetime. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="pragma_replication_remove_site"></a>PRAGMA replication_remove_site</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA replication_remove_site="hostname:port" </pre> + <p> + Removes the specified site from the replication group. + Use this PRAGMA if you truly want to remove the + site permanently from the group. It is not + desirable to call this PRAGMA if a site has been + temporarily shut down or disconnected from the rest + of the replication group. + </p> + <p> + Removing a site from the replication group means + that the site is no longer counted towards the + total number of sites belonging to the group. This + is important when the replication group requires + knowledge about whether a quorum has been reached + (such as when, for example, elections are held). + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="pragma_replication_verbose_output"></a>PRAGMA replication_verbose_output</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA replication_verbose_output=ON|OFF </pre> + <p> + If set to TRUE, additional logging information + specifically related to replication is created. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="pragma_replication_verbose_file"></a>PRAGMA replication_verbose_file</h3> + </div> + </div> + </div> + <pre class="programlisting">PRAGMA replication_verbose_file="filename" </pre> + <p> + Indicates that verbose replication output should be + sent to the specified file, as opposed to STDOUT. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="sqlrep.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="sqlrep.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="repstatistics.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Chapter 4. Using Replication with the SQL API </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Displaying Replication Statistics</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/repstatistics.html b/docs/bdb-sql/repstatistics.html new file mode 100644 index 00000000..a94c5d5c --- /dev/null +++ b/docs/bdb-sql/repstatistics.html @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Displaying Replication Statistics</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="sqlrep.html" title="Chapter 4. Using Replication with the SQL API" /> + <link rel="prev" href="reppragma.html" title="Replication PRAGMAs" /> + <link rel="next" href="rep_usageexamples.html" title="Replication Usage Examples" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Displaying Replication Statistics</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="reppragma.html">Prev</a> </td> + <th width="60%" align="center">Chapter 4. Using Replication with the SQL API</th> + <td width="20%" align="right"> <a accesskey="n" href="rep_usageexamples.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="repstatistics"></a>Displaying Replication Statistics</h2> + </div> + </div> + </div> + <p> + You can display a brief summary of replication statistics + using <code class="literal">.stat :rep:</code>. This + command displays the most basic information about + replication status, as well as some information that is + useful for troubleshooting. + </p> + <pre class="programlisting">dbsql> .stat :rep: +Replication summary statistics +Environment configured as a replication client +Startup complete +1/50232 Maximum permanent LSN +2 Number of environments in the replication group +0 Number of failed message sends +0 Number of messages ignored due to pending recovery +0 Number of log records currently queued </pre> + <p> + In the above output: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <code class="literal">Environment configured as a replication client</code> + </p> + <p> + Identifies the current role of the site within the + replication group. In this example, the current + site is not the master site. <span class="emphasis"><em>Replication + client</em></span> is another term for + <span class="emphasis"><em>replica</em></span>. + </p> + </li> + <li> + <p> + <code class="literal">Startup complete</code> + </p> + <p> + Indicates that this replica site has completed its + synchronization with the master site. Replica + synchronization can take some time if there are + many master transactions with which it needs to + catch up. + </p> + </li> + <li> + <p> + <code class="literal">Maximum permanent LSN</code> + </p> + <p> + Identifies the most recent log record that is + durably replicated on a master or acknowledged by a + replica. You can compare a replica's maximum + permanent LSN to the master's maximum permanent LSN + to determine if the replica is caught up with the + master. + </p> + </li> + <li> + <p> + <code class="literal">Number of failed message sends</code> + </p> + <p> + If this number is increasing, it could be an + indication of network or communications problems + between sites in the replication group. + </p> + </li> + <li> + <p> + <code class="literal">Number of messages ignored due to pending recovery</code> + </p> + <p> + If this number is increasing, this site is ignoring + messages because it is starting up or recovering + and may need some time to catch up with the rest of + the replication group. + </p> + </li> + <li> + <p> + <code class="literal">Number of log records currently queued</code> + </p> + <p> + If this number is increasing, it means that + connections to other sites may be unavailable or + congested and that there may be delays in durably + replicating master transactions. + </p> + </li> + </ul> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="reppragma.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="sqlrep.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="rep_usageexamples.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Replication PRAGMAs </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Replication Usage Examples</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/selectpage_size.html b/docs/bdb-sql/selectpage_size.html new file mode 100644 index 00000000..24534435 --- /dev/null +++ b/docs/bdb-sql/selectpage_size.html @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Selecting the Page Size</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbfeatures.html" title="Chapter 3. Berkeley DB Features" /> + <link rel="prev" href="mvcc.html" title="Using Multiversion Concurrency Control" /> + <link rel="next" href="sqlrep.html" title="Chapter 4. Using Replication with the SQL API" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Selecting the Page Size</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="mvcc.html">Prev</a> </td> + <th width="60%" align="center">Chapter 3. Berkeley DB Features</th> + <td width="20%" align="right"> <a accesskey="n" href="sqlrep.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="selectpage_size"></a>Selecting the Page Size</h2> + </div> + </div> + </div> + <p> + When using the BDB SQL interface, you configure your database page size in + exactly the same way as you do when using + SQLite. That is, use <code class="literal">PRAGMA page_size</code> + to report and set the page size. This PRAGMA must be called + before you create your first SQLite table. See the + <a class="ulink" href="http://www.sqlite.org/pragma.html#pragma_page_size" target="_top">PRAGMA page_size</a> + documentation for more information. + </p> + <p> + When you use + <code class="literal">PRAGMA cache_size</code> to size your in-memory + cache, you provide the cache size in terms of a number of + pages. Therefore, your database page size influences how large your + cache is, and so determines how much of your + database will fit into memory. + </p> + <p> + The size of your pages can also affect how efficient your + application is at performing disk I/O. It will also + determine just how fine-grained the fine-grained locking + actually is. This is because Berkeley DB locks database pages + when it acquires a lock. + </p> + <p> + Note that the default value for your page size is + probably correct for the physical hardware that you are using. In + almost all situations, the default page size value will + give your application the best possible I/O performance. For + this reason, tuning the page size should rarely, if + ever, be attempted. + </p> + <p> + That said, when using the BDB SQL interface, the page size affects + how much of your tables are locked when read and/or + write locks are acquired. (See + <a class="xref" href="lockingnotes.html#dbusage" title="Internal Database Usage">Internal Database Usage</a> + for more information.) + Increasing your page size will typically improve the + bandwidth you get accessing the disk, but it also may + increase contention if too many key data pairs are on + the same page. Decreasing your page size frequently + improves concurrency, but may increase the number of + locks you need to acquire and may decrease your disk + bandwidth. + </p> + <p> + When changing your page size, make sure the value you + select is a power of 2 that is greater than 512 and + less than or equal to 64KB. (Note that the standard + SQLite <code class="literal">MAX_PAGE_SIZE</code> limit is not + examined for this upper bound.) + </p> + <p> + Beyond that, there are some additional things + that you need to consider when selecting your page + size. For a thorough treatment of selecting your page size, + see the section on <span><a href="../programmer_reference/general_am_conf.html#am_conf_pagesize" class="olink">Selecting a page size</a></span> + in the + <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>. + </p> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="mvcc.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbfeatures.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="sqlrep.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Using Multiversion Concurrency Control </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Chapter 4. Using Replication with the SQL API</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/sequencesupport.html b/docs/bdb-sql/sequencesupport.html new file mode 100644 index 00000000..71c251bd --- /dev/null +++ b/docs/bdb-sql/sequencesupport.html @@ -0,0 +1,265 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Using Sequences</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="sql_encryption.html" title="Encryption" /> + <link rel="next" href="normal-sql.html" title="Differences for Users of other SQL Engines" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Using Sequences</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="sql_encryption.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="normal-sql.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="sequencesupport"></a>Using Sequences</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#create_sequence">create_sequence</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#seq_nextval">nextval</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#seq_currval">currval</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sequencesupport.html#seq_drop_sequence">drop_sequence</a> + </span> + </dt> + </dl> + </div> + <p> + You can use sequences with the SQL API. + Sequences provide for an arbitrary number of increasing or + decreasing integers that persist across database accesses. + Use sequences if you need to create unique values in a + highly efficient and persistent way. + </p> + <p> + To create and access a sequence, you must use SQL + functionality that is unique to the BDB SQL interface; no + corresponding functionality exists in SQLite. The + sequence functionality is implemented using SQLite + function plugins, as such it is necessary to use the + 'select' keyword as a prefix to all sequence APIs. + </p> + <p> + The SQL API sequence support is a partial implementation of + the sequence API defined in the SQL 2003 specification. + </p> + <p> + The following sections describe the BDB SQL interface sequence API. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="create_sequence"></a>create_sequence</h3> + </div> + </div> + </div> + <p> + Creates a new sequence. A name is required, all other + parameters are optional. For example: + </p> + <pre class="programlisting">SELECT create_sequence("my_sequence", "start", 100, "incr", 10, + "maxvalue", 300);</pre> + <p> + This creates a sequence called <code class="literal">my_sequence</code> + starting at 100 and incrementing by 10 until it reaches + 300. + </p> + <pre class="programlisting">SELECT create_sequence("my_decr_sequence", "incr", -100, + "minvalue", -10000);</pre> + <p> + This creates a sequence call <code class="literal">my_decr_sequence</code> + starting at 0 and decreasing by 100 until it reaches + -10000. + </p> + <p> + Parameters are: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <code class="literal">name</code> + </p> + <p> + Required parameter that provides the name of + the sequence. It is an error to create a + sequence with another name that is currently in + use within the database. + </p> + </li> + <li> + <p> + <code class="literal">start</code> + </p> + <p> + The starting value for the sequence. If this + parameter is not provided then + <code class="literal">0</code> is used. + </p> + </li> + <li> + <p> + <code class="literal">minvalue</code> + </p> + <p> + The lowest value generated by the sequence. If + this parameter is not provided and a + decrementing sequence is created, then + INT64_MIN is used. + </p> + </li> + <li> + <p> + <code class="literal">maxvalue</code> + </p> + <p> + The largest value generated by the sequence. + If this parameter is not provided and an + incrementing sequence is created, then + INT64_MAX is used. + </p> + </li> + <li> + <p> + <code class="literal">incr</code> + </p> + <p> + The amount the sequence is incremented for each + get operation. This value can be positive or + negative. If this parameter is not provided, + then <code class="literal">1</code> is used. + </p> + </li> + <li> + <p> + <code class="literal">cache</code> + </p> + <p> + Causes each handle to keep a cache of sequence + values. So long as there are values available + in the cache, retrieving the next value is + cheap and does not lead to contention between + handles. + </p> + <p> + Sequences with caches cannot be created or dropped + within an explicit transaction. + </p> + <p> + Operations on caching sequences are not + transactionally protected. That is, a rollback + will not result in a value being returned to + the sequence. + </p> + <p> + Sequences with caches do not support the + <code class="literal">currval</code> function. + </p> + <p> + The parameter following the cache parameter must be + an integer value specifying the size of the cache. + </p> + </li> + </ul> + </div> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="seq_nextval"></a>nextval</h3> + </div> + </div> + </div> + <p> + Retrieves the next value from the named sequence. For + example: + </p> + <pre class="programlisting">SELECT nextval("my_sequence");</pre> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="seq_currval"></a>currval</h3> + </div> + </div> + </div> + <p> + Retrieves the last value that was returned from the + named sequence. For example: + </p> + <pre class="programlisting">SELECT currval("my_sequence");</pre> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="seq_drop_sequence"></a>drop_sequence</h3> + </div> + </div> + </div> + <p> + Removes the sequence. For example: + </p> + <pre class="programlisting">SELECT drop_sequence("my_sequence");</pre> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="sql_encryption.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="normal-sql.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Encryption </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Differences for Users of other SQL Engines</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/sql_encryption.html b/docs/bdb-sql/sql_encryption.html new file mode 100644 index 00000000..c575776a --- /dev/null +++ b/docs/bdb-sql/sql_encryption.html @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Encryption</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="bdb-concepts.html" title="Berkeley DB Concepts" /> + <link rel="next" href="sequencesupport.html" title="Using Sequences" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Encryption</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="bdb-concepts.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="sequencesupport.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="sql_encryption"></a>Encryption</h2> + </div> + </div> + </div> + <p> + The Berkeley DB SQL interface supports the SQLite Encryption Extension (SEE) to ensure security of + your data. The supported encryption algorithm is AES-128 in CBC mode. + For more information on the concepts relating to BDB encryption, see the + <span> + <a href="../programmer_reference/env_encrypt.html" class="olink">Berkeley DB Programmer's Reference Guide.</a> + </span> + + </p> + <p> + To learn how to use the SQLite Encryption Extension (SEE), see the + official <a class="ulink" href="http://www.hwaci.com/sw/sqlite/see.html" target="_top">SQLite + Documentation Page.</a> + </p> + <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> + <h3 class="title">Note</h3> + <p> + The Berkeley DB SQL interface does not support the sqlite3_rekey method. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="bdb-concepts.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="sequencesupport.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Berkeley DB Concepts </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Using Sequences</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/sqlrep.html b/docs/bdb-sql/sqlrep.html new file mode 100644 index 00000000..56822bdb --- /dev/null +++ b/docs/bdb-sql/sqlrep.html @@ -0,0 +1,390 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Chapter 4. Using Replication with the SQL API</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="prev" href="selectpage_size.html" title="Selecting the Page Size" /> + <link rel="next" href="reppragma.html" title="Replication PRAGMAs" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Chapter 4. Using Replication with the SQL API</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="selectpage_size.html">Prev</a> </td> + <th width="60%" align="center"> </th> + <td width="20%" align="right"> <a accesskey="n" href="reppragma.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="chapter" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title"><a id="sqlrep"></a>Chapter 4. Using Replication with the SQL API</h2> + </div> + </div> + </div> + <div class="toc"> + <p> + <b>Table of Contents</b> + </p> + <dl> + <dt> + <span class="sect1"> + <a href="sqlrep.html#repoverview">Replication Overview</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="sqlrep.html#repmasters">Replication Masters</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sqlrep.html#repelect">Elections</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sqlrep.html#repdurability">Durability Guarantees</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sqlrep.html#twositerep">Two-Site Replication Groups</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="reppragma.html">Replication PRAGMAs</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication">PRAGMA replication</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_initial_master">PRAGMA replication_initial_master</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_local_site">PRAGMA replication_local_site</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_remote_site">PRAGMA replication_remote_site</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_remove_site">PRAGMA replication_remove_site</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_verbose_output">PRAGMA replication_verbose_output</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="reppragma.html#pragma_replication_verbose_file">PRAGMA replication_verbose_file</a> + </span> + </dt> + </dl> + </dd> + <dt> + <span class="sect1"> + <a href="repstatistics.html">Displaying Replication Statistics</a> + </span> + </dt> + <dt> + <span class="sect1"> + <a href="rep_usageexamples.html">Replication Usage Examples</a> + </span> + </dt> + <dd> + <dl> + <dt> + <span class="sect2"> + <a href="rep_usageexamples.html#rep_ex1">Example 1: Distributed Read at 3 Sites</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="rep_usageexamples.html#rep_ex2">Example 2: 2-Site Failover</a> + </span> + </dt> + </dl> + </dd> + </dl> + </div> + <p> + The Berkeley DB SQL interface allows you to use Berkeley DB's + replication feature. You configure and start replication using + PRAGMAs that are specific to the task. + </p> + <p> + This chapter provides a high-level introduction of + Berkeley DB replication. It then shows how to configure and use + replication with the SQL API. + </p> + <p> + For a more detailed description of Berkeley DB replication, + see: + </p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p> + <em class="citetitle">Berkeley DB Getting Started with Replicated Applications</em> + </p> + </li> + <li> + <p> + <em class="citetitle">Berkeley DB Programmer's Reference Guide</em> + </p> + </li> + </ul> + </div> + <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> + <h3 class="title">Note</h3> + <p> + You cannot access a BDB SQL database using multiple + processes if you enable replication for that database. + </p> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="repoverview"></a>Replication Overview</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="sqlrep.html#repmasters">Replication Masters</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sqlrep.html#repelect">Elections</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sqlrep.html#repdurability">Durability Guarantees</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sqlrep.html#twositerep">Two-Site Replication Groups</a> + </span> + </dt> + </dl> + </div> + <p> + Berkeley DB's replication feature allows you to automatically + distribute your database write operations to one or more + read-only <span class="emphasis"><em>replicas</em></span>. For this reason, BDB's + replication implementation is said to be a <span class="emphasis"><em>single + master, multiple replica</em></span> replication strategy. + </p> + <p> + A single replication master and all of its replicas are + referred to as a <span class="emphasis"><em>replication group</em></span>. + Each replication group can have one and only one master + site. + </p> + <p> + When discussing Berkeley DB replication, we sometimes refer + to <span class="emphasis"><em>replication sites</em></span>. This is because + most production applications place each of their replication + participants on separate physical machines. In fact, each + replication participant must be assigned a hostname/port + pair that is unique within the replication group. + </p> + <p> + Note that under the hood, the unit of replication is the + environment. That is, data is replicated from one Berkeley + DB environment to one or more other Berkeley DB + environments. However, when used with the BDB SQL interface, + you can think of this as replicating between Berkeley DB + databases, because the BDB SQL interface results in a single + database file for each environment. + </p> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="repmasters"></a>Replication Masters</h3> + </div> + </div> + </div> + <p> + Every replication group has one and only one master. + The master site is where you perform write operations. + These operations are then automatically replicated to + the other sites in the replication group. Because + the other replica sites in the replication group are + read-only, it is an error for you to attempt to perform + write operatons on them. + </p> + <p> + The replication master is usually automatically + selected by the replication group using elections. + Replication elections simply determine which + replication site has the most up-to-date copy of the + data, and so is in the best position to serve as the + master site. + </p> + <p> + Note that when you initially start up your BDB SQL + replicated application, you must explicitly designate a + specific site as the master. Over time, the master site + can move from one environment to the next. For example, + if the master site is shut down, becomes unavailable, + or a network partition causes it to lose contact with + the rest of the replication group, then the replication + group will elect a new master if it can successfully + hold an election. When the old master comes back + online, it rejoins the replication group as a read-only + replica site. + </p> + <p> + Also, if you are enabling replication for an existing + database, then that database must be designated as the + master. Doing this is required; otherwise the entire + contents of the existing database might be deleted + during the replication startup process. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="repelect"></a>Elections</h3> + </div> + </div> + </div> + <p> + A replication group selects the master site by holding + an election. In simplistic terms, each participant in + the replication group votes on who it believes has the + most up-to-date version of the data that the + replication group is managing. The site that receives + the most number of votes becomes the master site, and + all data write activity must occur there. + </p> + <p> + In order to hold an election, the replication group + must have a quorum. In order to achieve a quorum, a + simple majority of the sites must be available to + select the master. That is, + <span class="emphasis"><em>n/2 + 1</em></span> sites must be available, where + <span class="emphasis"><em>n</em></span> is the total number of replication + group participants. By requiring a simple majority, the + replication group avoids the possibility of + simultaneously running with two master sites due to a + network partition. + </p> + <p> + If a replication group cannot select a master, then it + can only be used in read-only mode. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="repdurability"></a>Durability Guarantees</h3> + </div> + </div> + </div> + <p> + Durability is a term that means data modifications have + met some pre-defined set of guarantees that the + modifications will remain persistent across application + run times. Usually, this means that there is some + assurance that the data modification has been written + to stable storage (that is, written to a hard drive). + </p> + <p> + For replicated BDB SQL applications, the durability + guarantee is extended because data modifications are + also replicated to those environments that are + participating in the replication group. This ensures + higher data durability than non-replicated applications + by placing data in multiple environments that usually + reside on separate physical machines. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="twositerep"></a>Two-Site Replication Groups</h3> + </div> + </div> + </div> + <p> + In a replication group that consists of exactly two + sites, both sites must be available in order to achieve + a quorum. Without a quorum, a new master site cannot + be elected. This means that if the master site is + unable to participate in the replication group, then + the remaining read-only replica cannot become the + master site. + </p> + <p> + In other words, if you have a group that consists of + exactly two sites, if you lose your master site then + the replication group must exist in read-only mode until + the master site becomes available again. + </p> + </div> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="selectpage_size.html">Prev</a> </td> + <td width="20%" align="center"> </td> + <td width="40%" align="right"> <a accesskey="n" href="reppragma.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Selecting the Page Size </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Replication PRAGMAs</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/sync.html b/docs/bdb-sql/sync.html new file mode 100644 index 00000000..7bbd4d85 --- /dev/null +++ b/docs/bdb-sql/sync.html @@ -0,0 +1,209 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Syncing with Oracle Databases</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="admin.html" title="Chapter 5. Administrating Berkeley DB SQL Databases" /> + <link rel="prev" href="admin.html" title="Chapter 5. Administrating Berkeley DB SQL Databases" /> + <link rel="next" href="datamigration.html" title="Data Migration" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Syncing with Oracle Databases</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="admin.html">Prev</a> </td> + <th width="60%" align="center">Chapter 5. Administrating Berkeley DB SQL Databases</th> + <td width="20%" align="right"> <a accesskey="n" href="datamigration.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="sync"></a>Syncing with Oracle Databases</h2> + </div> + </div> + </div> + <div class="toc"> + <dl> + <dt> + <span class="sect2"> + <a href="sync.html#syncunix">Syncing on Unix Platforms</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sync.html#syncwin">Syncing on Windows Platforms</a> + </span> + </dt> + <dt> + <span class="sect2"> + <a href="sync.html#syncwinmobile">Syncing on Windows Mobile Platforms</a> + </span> + </dt> + </dl> + </div> + <p> + Oracle's SQLite Mobile Client product allows you to synchronize a + SQLite database with a back-end Oracle database. Because the + BDB SQL interface is a drop-in replacement for SQLite, this means you + can synchronize a Berkeley DB database with an Oracle back-end as well. + </p> + <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> + <h3 class="title">Note</h3> + <p> + Berkeley DB SQL databases are not compatible with + SQLite databases. In order for sync to work, you + must remove any currently existing SQLite + databases. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="syncunix"></a>Syncing on Unix Platforms</h3> + </div> + </div> + </div> + <p> + For Unix platforms, the easiest way to use Oracle's SQLite Mobile Client + is to build the BDB SQL interface with the + compatibility option. That is, specify both + <code class="literal">--enable-sql</code> and + <code class="literal">--enable-sql-compat</code> when you configure + your Berkeley DB installation. This causes libraries with the exact + same name as the SQLite libraries to be created when you + build Berkeley DB. + </p> + <p> + Having done that, you must then change your platform's + library search path so that it finds the Berkeley DB libraries + <span class="emphasis"><em>before</em></span> any installed SQLite libraries. + On many (but not all) Unix platforms, you do this by + modifying the <code class="literal">LD_LIBRARY_PATH</code> environment + variable. See your operating system documentation for + information on how to change your search path for dynamically + linked libraries. + </p> + <p> + Once you have properly configured and built your Berkeley DB + installation, and you have properly configured your operating + system, you can use the Oracle SQLite Mobile Client in + exactly the same way as you would if you were using standard + SQLite libraries and databases with it. See the + <a class="ulink" href="http://download.oracle.com/docs/cd/E12095_01/nav/portal_booklist.htm" target="_top"> + Oracle Database Lite + </a> + documentation for information on using SQLite Mobile Client. + </p> + <p> + For information on building the BDB SQL interface, see the + <a href="../installation/build_unix_sql.html" class="olink">Configuring the SQL Interface</a> section in the + <em class="citetitle">Berkeley DB Installation and Build Guide</em>. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="syncwin"></a>Syncing on Windows Platforms</h3> + </div> + </div> + </div> + <p> + For Windows platforms, you use Oracle's SQLite Mobile Client + by building the BDB SQL interface in the same way as you normally do. + See the <a href="../installation/build_win.html" class="olink">Building Berkeley DB for Windows</a> + chapter in the <em class="citetitle">Berkeley DB Installation and Build Guide</em> for more information. + </p> + <p> + Once you have built the product, rename the Berkeley DB + SQL dlls so that they are named identically to the standard + SQLite dlls (sqlite3.dll). Install the renamed Berkeley DB SQL dll along with the + main Berkeley DB dll (libdb5x.dll) in the same directory as the SQLite dlls. See the + <a href="../installation/build_win_sql.html" class="olink">Building the SQL API</a> section for details. + </p> + <p> + Finally, configure your Windows PATH environment variable so + that it finds your Berkeley DB dlls before it finds any standard + SQLite dlls that might be installed on your system. + </p> + <p> + Once you have built your Berkeley DB installation and renamed your + dlls, and you have properly configured your operating system, + you can use the Oracle SQLite Mobile Client in exactly the + same way as you would if you were using standard SQLite + libraries and databases with it. See the + <a class="ulink" href="http://download.oracle.com/docs/cd/E12095_01/nav/portal_booklist.htm" target="_top"> + Oracle Database Lite </a> documentation for + information on using SQLite Mobile Client. + </p> + </div> + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a id="syncwinmobile"></a>Syncing on Windows Mobile Platforms</h3> + </div> + </div> + </div> + <p> + For Windows Mobile platforms, you use Oracle's SQLite Mobile Client + by building the BDB SQL interface in the same way as you normally do. + See the <a href="../installation/build_wince.html" class="olink">Building Berkeley DB for Windows Mobile</a> + chapter in the <em class="citetitle">Berkeley DB Installation and Build Guide</em> for more information. + </p> + <p> + Once you have built the product, rename the Berkeley DB + SQL dll to <code class="literal">sqlite3.dll</code>. Then, copy + the dll to the <code class="literal">\Windows</code> path on + the phone. Note that you only need the new + <code class="literal">sqlite3.dll</code>; you do not need any + of the other Berkeley DB dlls. + </p> + <p> + Once you have built your Berkeley DB installation and renamed your + dlls, and you have properly configured your operating system, + you can use the Oracle SQLite Mobile Client in exactly the + same way as you would if you were using standard SQLite + libraries and databases with it. See the + <a class="ulink" href="http://download.oracle.com/docs/cd/E12095_01/nav/portal_booklist.htm" target="_top"> + Oracle Database Lite </a> documentation for + information on using SQLite Mobile Client. + </p> + </div> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="admin.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="admin.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="datamigration.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">Chapter 5. Administrating Berkeley DB SQL Databases </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Data Migration</td> + </tr> + </table> + </div> + </body> +</html> diff --git a/docs/bdb-sql/unsupportedpragmas.html b/docs/bdb-sql/unsupportedpragmas.html new file mode 100644 index 00000000..afb2c513 --- /dev/null +++ b/docs/bdb-sql/unsupportedpragmas.html @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Unsupported PRAGMAs</title> + <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> + <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> + <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> + <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" /> + <link rel="prev" href="journaldirectory.html" title="The Journal Directory" /> + <link rel="next" href="changedpragmas.html" title="Changed PRAGMAs" /> + </head> + <body> + <div xmlns="" class="navheader"> + <div class="libver"> + <p>Library Version 11.2.5.3</p> + </div> + <table width="100%" summary="Navigation header"> + <tr> + <th colspan="3" align="center">Unsupported PRAGMAs</th> + </tr> + <tr> + <td width="20%" align="left"><a accesskey="p" href="journaldirectory.html">Prev</a> </td> + <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th> + <td width="20%" align="right"> <a accesskey="n" href="changedpragmas.html">Next</a></td> + </tr> + </table> + <hr /> + </div> + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a id="unsupportedpragmas"></a>Unsupported PRAGMAs</h2> + </div> + </div> + </div> + <p> + The following PRAGMAs are not supported by the BDB SQL interface. + </p> + <table class="simplelist" border="0" summary="Simple list"> + <tr> + <td> + <a class="ulink" href="http://www.sqlite.org/pragma.html#pragma_journal_mode" target="_top"> + PRAGMA journal_mode + </a> + </td> + </tr> + <tr> + <td> + <a class="ulink" href="http://www.sqlite.org/pragma.html#pragma_legacy_file_format" target="_top"> + PRAGMA legacy_file_format + </a> + </td> + </tr> + </table> + <p> + Also, + <a class="ulink" href="http://www.sqlite.org/pragma.html#pragma_fullfsync" target="_top">PRAGMA fullfsync</a> + is always on for the BDB SQL interface. (This is an issue only for Mac OS + X platforms.) + </p> + </div> + <div class="navfooter"> + <hr /> + <table width="100%" summary="Navigation footer"> + <tr> + <td width="40%" align="left"><a accesskey="p" href="journaldirectory.html">Prev</a> </td> + <td width="20%" align="center"> + <a accesskey="u" href="dbsqlbasics.html">Up</a> + </td> + <td width="40%" align="right"> <a accesskey="n" href="changedpragmas.html">Next</a></td> + </tr> + <tr> + <td width="40%" align="left" valign="top">The Journal Directory </td> + <td width="20%" align="center"> + <a accesskey="h" href="index.html">Home</a> + </td> + <td width="40%" align="right" valign="top"> Changed PRAGMAs</td> + </tr> + </table> + </div> + </body> +</html> |