Debian Codegraph @

docs/bdb-sql/addedpragmas.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>Added PRAGMAs</title>
7 <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" />
10 <link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" />
11 <link rel="prev" href="changedpragmas.html" title="Changed PRAGMAs" />
12 <link rel="next" href="miscdiff.html" title="Miscellaneous Differences" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">Added PRAGMAs</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="changedpragmas.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th>
26 <td width="20%" align="right"> <a accesskey="n" href="miscdiff.html">Next</a></td>
27 </tr>
28 </table>
29 <hr />
30 </div>
31 <div class="sect1" lang="en" xml:lang="en">
32 <div class="titlepage">
33 <div>
34 <div>
35 <h2 class="title" style="clear: both"><a id="addedpragmas"></a>Added PRAGMAs</h2>
36 </div>
37 </div>
38 </div>
39 <div class="toc">
40 <dl>
41 <dt>
42 <span class="sect2">
43 <a href="addedpragmas.html#bdbsql_error_file">PRAGMA bdbsql_error_file</a>
44 </span>
45 </dt>
46 <dt>
47 <span class="sect2">
48 <a href="addedpragmas.html#bdbsql_lock_tablesize">PRAGMA bdbsql_lock_tablesize</a>
49 </span>
50 </dt>
51 <dt>
52 <span class="sect2">
53 <a href="addedpragmas.html#bdbsql_shared_resources">PRAGMA bdbsql_shared_resources</a>
54 </span>
55 </dt>
56 <dt>
57 <span class="sect2">
58 <a href="addedpragmas.html#bdbsql_single_process">PRAGMA bdbsql_single_process</a>
59 </span>
60 </dt>
61 <dt>
62 <span class="sect2">
63 <a href="addedpragmas.html#bdbsql_system_memory">PRAGMA bdbsql_system_memory</a>
64 </span>
65 </dt>
66 <dt>
67 <span class="sect2">
68 <a href="addedpragmas.html#bdbsql_vacuum_fillpercent">PRAGMA bdbsql_vacuum_fillpercent</a>
69 </span>
70 </dt>
71 <dt>
72 <span class="sect2">
73 <a href="addedpragmas.html#bdbsql_vacuum_pages">PRAGMA bdbsql_vacuum_pages</a>
74 </span>
75 </dt>
76 <dt>
77 <span class="sect2">
78 <a href="addedpragmas.html#multiversion">PRAGMA multiversion</a>
79 </span>
80 </dt>
81 <dt>
82 <span class="sect2">
83 <a href="addedpragmas.html#snapshot_isolation">PRAGMA snapshot_isolation</a>
84 </span>
85 </dt>
86 <dt>
87 <span class="sect2">
88 <a href="addedpragmas.html#trickle">PRAGMA trickle</a>
89 </span>
90 </dt>
91 <dt>
92 <span class="sect2">
93 <a href="addedpragmas.html#txn_bulk">PRAGMA txn_bulk</a>
94 </span>
95 </dt>
96 <dt>
97 <span class="sect2">
98 <a href="addedpragmas.html#replication_pragmas">Replication PRAGMAs</a>
99 </span>
100 </dt>
101 </dl>
102 </div>
103 <p>
104 The following PRAGMAs are added in the Berkeley DB SQL interface.
105 </p>
106 <div class="sect2" lang="en" xml:lang="en">
107 <div class="titlepage">
108 <div>
109 <div>
110 <h3 class="title"><a id="bdbsql_error_file"></a>PRAGMA bdbsql_error_file</h3>
111 </div>
112 </div>
113 </div>
114 <pre class="programlisting">PRAGMA bdbsql_error_file [filename]</pre>
115 <p>
116 Redirects internal Berkeley DB error messages to
117 the named file. If a relative path is specified to
118 <code class="literal">[filename]</code>, then the path is
119 interpreted as being relative to the current
120 working directory.
121 </p>
122 <p>
123 If this PRAGMA is issued with no filename, then the
124 current target for Berkeley DB error output is
125 returned. By default, error messages are sent to
126 <code class="literal">STDERR</code>.
127 </p>
128 <p>
129 This PRAGMA can be issued at any time; initial
130 database access does not have to occur before this
131 PRAGMA can be used.
132 </p>
133 </div>
134 <div class="sect2" lang="en" xml:lang="en">
135 <div class="titlepage">
136 <div>
137 <div>
138 <h3 class="title"><a id="bdbsql_lock_tablesize"></a>PRAGMA bdbsql_lock_tablesize</h3>
139 </div>
140 </div>
141 </div>
142 <pre class="programlisting">PRAGMA bdbsql_lock_tablesize [= N]</pre>
143 <p>
144 Sets or reports the number of buckets in the Berkeley DB environment's
145 lock object hash table.
146 </p>
147 <p>
148 This pragma must be called prior to opening/creating the
149 database environment.
150 </p>
151 <p>
152 For more details, see
153 <a href="../api_reference/C/envget_lk_tablesize.html" class="olink">get_lk_tablesize</a>
154 and
155 <a href="../api_reference/C/envset_lk_tablesize.html" class="olink">set_lk_tablesize</a>.
156 </p>
157 </div>
158 <div class="sect2" lang="en" xml:lang="en">
159 <div class="titlepage">
160 <div>
161 <div>
162 <h3 class="title"><a id="bdbsql_shared_resources"></a>PRAGMA bdbsql_shared_resources</h3>
163 </div>
164 </div>
165 </div>
166 <pre class="programlisting">PRAGMA bdbsql_shared_resources [= N]</pre>
167 <p>
168 Sets or reports the maximum amount of memory (bytes) to be
169 used by shared structures in the main environment region.
170 </p>
171 <p>
172 This pragma must be called prior to opening/creating the
173 database environment.
174 </p>
175 <p>
176 For more details, see
177 <a href="../api_reference/C/envget_memory_max.html" class="olink">get_memory_max</a>
178 and
179 <a href="../api_reference/C/envset_memory_max.html" class="olink">set_memory_max</a>.
180 </p>
181 </div>
182 <div class="sect2" lang="en" xml:lang="en">
183 <div class="titlepage">
184 <div>
185 <div>
186 <h3 class="title"><a id="bdbsql_single_process"></a>PRAGMA bdbsql_single_process</h3>
187 </div>
188 </div>
189 </div>
190 <pre class="programlisting">PRAGMA bdbsql_single_process = boolean</pre>
191 <p>
192 To create a private environment rather than a shared
193 environment, enable this pragma. The cache and other
194 region files will be created in memory rather than
195 using file backed shared memory.
196 </p>
197 <p>
198 In Berkeley DB SQL the default behavior is to allow a
199 database to be opened and operated on by multiple
200 processes simultaneously. When this pragma is enabled,
201 accessing the same database from multiple processes
202 simultaneously can lead to data corruption. Either
203 option supports accessing a database using a single
204 process multi-threaded application.
205 </p>
206 <p>
207 By default omit sharing is disabled. This pragma must
208 be called prior to opening/creating the database
209 environment. Because the setting is not persistent,
210 you may need to invoke it before every database open,
211 or define compile option
212 <code class="literal">BDBSQL_OMIT_SHARING</code> instead.
213 </p>
214 <p>
215 For more information, see <a href="../programmer_reference/env_region.html" class="olink">Shared memory region</a>. Note that this
216 pragma causes the <a href="../api_reference/C/envopen.html#envopen_DB_PRIVATE" class="olink">DB_PRIVATE</a> flag to be specified in
217 the <a href="../api_reference/C/envopen.html" class="olink">DB_ENV-&gt;open()</a> method.
218 </p>
219 </div>
220 <div class="sect2" lang="en" xml:lang="en">
221 <div class="titlepage">
222 <div>
223 <div>
224 <h3 class="title"><a id="bdbsql_system_memory"></a>PRAGMA bdbsql_system_memory</h3>
225 </div>
226 </div>
227 </div>
228 <pre class="programlisting">PRAGMA bdbsql_system_memory [base segment ID]</pre>
229 <p>
230 Queries or sets a flag that causes the database's
231 shared resources to be created in system shared
232 memory. By default the database's shared resources
233 are created in file-backed shared memory.
234 </p>
235 <p>
236 If a [base segment ID] is specified, the shared
237 resources will be created using X/Open style shared
238 memory interfaces. The [base segment ID] will be
239 used as the starting ID for shared resources used
240 by the database. Use different [base segment ID]
241 values for different databases. It is possible for
242 multi-process applications to use a single database
243 by specifying the same [base segment ID] to this
244 PRAGMA. Each connection needs to set this PRAGMA.
245 </p>
246 <p>
247 This PRAGMA may be used to set a [base segment ID]
248 only before the first table is created in the
249 database.
250 </p>
251 </div>
252 <div class="sect2" lang="en" xml:lang="en">
253 <div class="titlepage">
254 <div>
255 <div>
256 <h3 class="title"><a id="bdbsql_vacuum_fillpercent"></a>PRAGMA bdbsql_vacuum_fillpercent</h3>
257 </div>
258 </div>
259 </div>
260 <pre class="programlisting">PRAGMA bdbsql_vacuum_fillpercent [= N]</pre>
261 <p>
262 Sets or reports the page full threshold.
263 Any page in the database that is at or below this
264 percentage full is considered for vacuuming when
265 <code class="literal">PRAGMA incremental_vacuum</code> is
266 enabled. The value is specified as a percentage
267 between 1 and 100. By default, pages 85% full and
268 below are considered for vacuuming.
269 </p>
270 </div>
271 <div class="sect2" lang="en" xml:lang="en">
272 <div class="titlepage">
273 <div>
274 <div>
275 <h3 class="title"><a id="bdbsql_vacuum_pages"></a>PRAGMA bdbsql_vacuum_pages</h3>
276 </div>
277 </div>
278 </div>
279 <pre class="programlisting">PRAGMA bdbsql_vacuum_pages [= N]</pre>
280 <p>
281 Sets or reports the maximum number of pages to be
282 returned to the file system from the free page list
283 when incremental vacuuming is enabled. By
284 default, up to 128 pages are removed from the free
285 list.
286 </p>
287 <p>
288 Page vacuuming is controlled using
289 <a class="xref" href="changedpragmas.html#auto_vacuum" title="PRAGMA auto_vacuum">PRAGMA auto_vacuum</a>.
290 </p>
291 </div>
292 <div class="sect2" lang="en" xml:lang="en">
293 <div class="titlepage">
294 <div>
295 <div>
296 <h3 class="title"><a id="multiversion"></a>PRAGMA multiversion</h3>
297 </div>
298 </div>
299 </div>
300 <pre class="programlisting">PRAGMA multiversion</pre>
301 <p>
302 Controls whether Multiversion Concurrency Control (MVCC) is on
303 or off. You can not use this PRAGMA at any time during
304 your application's runtime after your database tables
305 have been accessed.
306 </p>
307 <p>
308 For more information on MVCC and snapshot isolation,
309 see <a class="xref" href="mvcc.html" title="Using Multiversion Concurrency Control">Using Multiversion Concurrency Control</a>
310 </p>
311 </div>
312 <div class="sect2" lang="en" xml:lang="en">
313 <div class="titlepage">
314 <div>
315 <div>
316 <h3 class="title"><a id="snapshot_isolation"></a>PRAGMA snapshot_isolation</h3>
317 </div>
318 </div>
319 </div>
320 <pre class="programlisting">PRAGMA snapshot_isolation</pre>
321 <p>
322 Controls whether snapshot isolation is turned on. This
323 PRAGMA can be used at any time during your
324 application's runtime <span class="emphasis"><em>after</em></span>
325 Multiversion Concurrency Control (MVCC) has been turned on.
326 </p>
327 <p>
328 For more information on MVCC and snapshot isolation,
329 see <a class="xref" href="mvcc.html" title="Using Multiversion Concurrency Control">Using Multiversion Concurrency Control</a>
330 </p>
331 </div>
332 <div class="sect2" lang="en" xml:lang="en">
333 <div class="titlepage">
334 <div>
335 <div>
336 <h3 class="title"><a id="trickle"></a>PRAGMA trickle</h3>
337 </div>
338 </div>
339 </div>
340 <pre class="programlisting">PRAGMA trickle [percent]</pre>
341 <p>
342 Ensures that at least the specified percentage of
343 pages in the shared cache are clean. This can cause
344 pages that have been modified to be flushed to
345 disk.
346 </p>
347 <p>
348 The trickle functionality enables an application to
349 ensure that a page is available for reading new
350 information into the shared cache without waiting
351 for a write operation to complete.
352 </p>
353 <p>
354 Specifying this PRAGMA without a percentage value
355 causes the current trickle value to be displayed.
356 Specify <code class="literal">0</code> to turn the trickle
357 functionality off.
358 </p>
359 </div>
360 <div class="sect2" lang="en" xml:lang="en">
361 <div class="titlepage">
362 <div>
363 <div>
364 <h3 class="title"><a id="txn_bulk"></a>PRAGMA txn_bulk</h3>
365 </div>
366 </div>
367 </div>
368 <pre class="programlisting">PRAGMA TXN_BULK</pre>
369 <p>
370 Enables transactional bulk loading optimization.
371 For more information, see
372 <a class="xref" href="dbfeatures.html#bulkloading" title="Using Bulk Loading">Using Bulk Loading</a>.
373 </p>
374 </div>
375 <div class="sect2" lang="en" xml:lang="en">
376 <div class="titlepage">
377 <div>
378 <div>
379 <h3 class="title"><a id="replication_pragmas"></a>Replication PRAGMAs</h3>
380 </div>
381 </div>
382 </div>
383 <p>
384 Seven PRAGMAs were added to control replication.
385 They are described in
386 <a class="xref" href="sqlrep.html" title="Chapter 4. Using Replication with the SQL API">Using Replication with the SQL API</a>:
387 </p>
388 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
389 <h3 class="title">Note</h3>
390 <p>
391 If you are using these replication PRAGMAs and you
392 want to perform a backup, there is an additional
393 backup step for the pragma file. See
394 <a class="xref" href="admin.html#backup" title="Backing Up Berkeley DB SQL Databases">Backing Up Berkeley DB SQL Databases</a>
395 for more information.
396 </p>
397 </div>
398 <div class="itemizedlist">
399 <ul type="disc">
400 <li>
401 <p>
402 <span class="bold"><strong>PRAGMA replication</strong></span>
403 </p>
404 </li>
405 <li>
406 <p>
407 <span class="bold"><strong>PRAGMA replication_initial_master</strong></span>
408 </p>
409 </li>
410 <li>
411 <p>
412 <span class="bold"><strong>PRAGMA replication_local_site</strong></span>
413 </p>
414 </li>
415 <li>
416 <p>
417 <span class="bold"><strong>PRAGMA replication_remote_site</strong></span>
418 </p>
419 </li>
420 <li>
421 <p>
422 <span class="bold"><strong>PRAGMA replication_remove_site</strong></span>
423 </p>
424 </li>
425 <li>
426 <p>
427 <span class="bold"><strong>PRAGMA replication_verbose_output</strong></span>
428 </p>
429 </li>
430 <li>
431 <p>
432 <span class="bold"><strong>PRAGMA replication_verbose_file</strong></span>
433 </p>
434 </li>
435 </ul>
436 </div>
437 </div>
438 </div>
439 <div class="navfooter">
440 <hr />
441 <table width="100%" summary="Navigation footer">
442 <tr>
443 <td width="40%" align="left"><a accesskey="p" href="changedpragmas.html">Prev</a> </td>
444 <td width="20%" align="center">
445 <a accesskey="u" href="dbsqlbasics.html">Up</a>
446 </td>
447 <td width="40%" align="right"> <a accesskey="n" href="miscdiff.html">Next</a></td>
448 </tr>
449 <tr>
450 <td width="40%" align="left" valign="top">Changed PRAGMAs </td>
451 <td width="20%" align="center">
452 <a accesskey="h" href="index.html">Home</a>
453 </td>
454 <td width="40%" align="right" valign="top"> Miscellaneous Differences</td>
455 </tr>
456 </table>
457 </div>
458 </body>
459 </html>