Debian Codegraph @

docs/programmer_reference/transapp_logfile.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>Log file removal</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="Berkeley DB Programmer's Reference Guide" />
10 <link rel="up" href="transapp.html" title="Chapter 11.  Berkeley DB Transactional Data Store Applications" />
11 <link rel="prev" href="transapp_archival.html" title="Database and log file archival" />
12 <link rel="next" href="transapp_recovery.html" title="Recovery procedures" />
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">Log file removal</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="transapp_archival.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 11. 
26 Berkeley DB Transactional Data Store Applications
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="transapp_recovery.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="transapp_logfile"></a>Log file removal</h2>
38 </div>
39 </div>
40 </div>
41 <p>The fourth component of the infrastructure, log file removal, concerns
42 the ongoing disk consumption of the database log files. Depending on
43 the rate at which the application writes to the databases and the
44 available disk space, the number of log files may increase quickly
45 enough so that disk space will be a resource problem. For this reason,
46 you will periodically want to remove log files in order to conserve disk
47 space. This procedure is distinct from database and log file archival
48 for catastrophic recovery, and you cannot remove the current log files
49 simply because you have created a database snapshot or copied log files
50 to archival media.</p>
51 <p>Log files may be removed at any time, as long as:</p>
52 <div class="itemizedlist">
53 <ul type="disc">
54 <li>the log file is not involved in an active transaction.</li>
55 <li>a checkpoint has been written subsequent to the log file's
56 creation.</li>
57 <li>the log file is not the only log file in the environment.</li>
58 </ul>
59 </div>
60 <p>Additionally, when Replication Manager is running
61 the log file is older than the most out of date active site in the
62 replication group.</p>
63 <p>If you are preparing for catastrophic failure, you will want to copy
64 the log files to archival media before you remove them as described in
65 <a class="xref" href="transapp_archival.html" title="Database and log file archival">Database and log file archival</a>.</p>
66 <p>If you are not preparing for catastrophic failure, any one of the
67 following methods can be used to remove log files:</p>
68 <div class="orderedlist">
69 <ol type="1">
70 <li>Run the standalone <a href="../api_reference/C/db_archive.html" class="olink">db_archive</a> utility with the <span class="bold"><strong>-d</strong></span>
71 option, to remove any log files that are no longer needed at the time
72 the command is executed.</li>
73 <li>Call the <a href="../api_reference/C/logarchive.html" class="olink">DB_ENV-&gt;log_archive()</a> method from the application, with the
74 <a href="../api_reference/C/logarchive.html#archive_DB_ARCH_REMOVE" class="olink">DB_ARCH_REMOVE</a> flag, to remove any log files that are no longer
75 needed at the time the call is made.</li>
76 <li>Call the <a href="../api_reference/C/envlog_set_config.html" class="olink">DB_ENV-&gt;log_set_config()</a> method from the application, with the
77 <a href="../api_reference/C/envlog_set_config.html#log_set_config_DB_LOG_AUTO_REMOVE" class="olink">DB_LOG_AUTO_REMOVE</a> flag, to remove any log files that are no
78 longer needed on an ongoing basis. With this configuration, Berkeley DB will
79 automatically remove log files, and the application will not have an
80 opportunity to copy the log files to backup media.</li>
81 </ol>
82 </div>
83 </div>
84 <div class="navfooter">
85 <hr />
86 <table width="100%" summary="Navigation footer">
87 <tr>
88 <td width="40%" align="left"><a accesskey="p" href="transapp_archival.html">Prev</a> </td>
89 <td width="20%" align="center">
90 <a accesskey="u" href="transapp.html">Up</a>
91 </td>
92 <td width="40%" align="right"> <a accesskey="n" href="transapp_recovery.html">Next</a></td>
93 </tr>
94 <tr>
95 <td width="40%" align="left" valign="top">Database and log file archival </td>
96 <td width="20%" align="center">
97 <a accesskey="h" href="index.html">Home</a>
98 </td>
99 <td width="40%" align="right" valign="top"> Recovery procedures</td>
100 </tr>
101 </table>
102 </div>
103 </body>
104 </html>