~ubuntu-branches/ubuntu/precise/postgresql-9.1/precise-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/html/maintenance.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<HTML
 
3
><HEAD
 
4
><TITLE
 
5
>Routine Database Maintenance Tasks</TITLE
 
6
><META
 
7
NAME="GENERATOR"
 
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 
9
REV="MADE"
 
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
 
11
REL="HOME"
 
12
TITLE="PostgreSQL 9.1beta1 Documentation"
 
13
HREF="index.html"><LINK
 
14
REL="UP"
 
15
TITLE="Server Administration"
 
16
HREF="admin.html"><LINK
 
17
REL="PREVIOUS"
 
18
TITLE="Character Set Support"
 
19
HREF="multibyte.html"><LINK
 
20
REL="NEXT"
 
21
TITLE="Routine Vacuuming"
 
22
HREF="routine-vacuuming.html"><LINK
 
23
REL="STYLESHEET"
 
24
TYPE="text/css"
 
25
HREF="stylesheet.css"><META
 
26
HTTP-EQUIV="Content-Type"
 
27
CONTENT="text/html; charset=ISO-8859-1"><META
 
28
NAME="creation"
 
29
CONTENT="2011-04-27T21:20:33"></HEAD
 
30
><BODY
 
31
CLASS="CHAPTER"
 
32
><DIV
 
33
CLASS="NAVHEADER"
 
34
><TABLE
 
35
SUMMARY="Header navigation table"
 
36
WIDTH="100%"
 
37
BORDER="0"
 
38
CELLPADDING="0"
 
39
CELLSPACING="0"
 
40
><TR
 
41
><TH
 
42
COLSPAN="5"
 
43
ALIGN="center"
 
44
VALIGN="bottom"
 
45
><A
 
46
HREF="index.html"
 
47
>PostgreSQL 9.1beta1 Documentation</A
 
48
></TH
 
49
></TR
 
50
><TR
 
51
><TD
 
52
WIDTH="10%"
 
53
ALIGN="left"
 
54
VALIGN="top"
 
55
><A
 
56
TITLE="Character Set Support"
 
57
HREF="multibyte.html"
 
58
ACCESSKEY="P"
 
59
>Prev</A
 
60
></TD
 
61
><TD
 
62
WIDTH="10%"
 
63
ALIGN="left"
 
64
VALIGN="top"
 
65
><A
 
66
TITLE="Localization"
 
67
HREF="charset.html"
 
68
>Fast Backward</A
 
69
></TD
 
70
><TD
 
71
WIDTH="60%"
 
72
ALIGN="center"
 
73
VALIGN="bottom"
 
74
></TD
 
75
><TD
 
76
WIDTH="10%"
 
77
ALIGN="right"
 
78
VALIGN="top"
 
79
><A
 
80
TITLE="Backup and Restore"
 
81
HREF="backup.html"
 
82
>Fast Forward</A
 
83
></TD
 
84
><TD
 
85
WIDTH="10%"
 
86
ALIGN="right"
 
87
VALIGN="top"
 
88
><A
 
89
TITLE="Routine Vacuuming"
 
90
HREF="routine-vacuuming.html"
 
91
ACCESSKEY="N"
 
92
>Next</A
 
93
></TD
 
94
></TR
 
95
></TABLE
 
96
><HR
 
97
ALIGN="LEFT"
 
98
WIDTH="100%"></DIV
 
99
><DIV
 
100
CLASS="CHAPTER"
 
101
><H1
 
102
><A
 
103
NAME="MAINTENANCE"
 
104
></A
 
105
>Chapter 23. Routine Database Maintenance Tasks</H1
 
106
><DIV
 
107
CLASS="TOC"
 
108
><DL
 
109
><DT
 
110
><B
 
111
>Table of Contents</B
 
112
></DT
 
113
><DT
 
114
>23.1. <A
 
115
HREF="routine-vacuuming.html"
 
116
>Routine Vacuuming</A
 
117
></DT
 
118
><DD
 
119
><DL
 
120
><DT
 
121
>23.1.1. <A
 
122
HREF="routine-vacuuming.html#VACUUM-BASICS"
 
123
>Vacuuming Basics</A
 
124
></DT
 
125
><DT
 
126
>23.1.2. <A
 
127
HREF="routine-vacuuming.html#VACUUM-FOR-SPACE-RECOVERY"
 
128
>Recovering Disk Space</A
 
129
></DT
 
130
><DT
 
131
>23.1.3. <A
 
132
HREF="routine-vacuuming.html#VACUUM-FOR-STATISTICS"
 
133
>Updating Planner Statistics</A
 
134
></DT
 
135
><DT
 
136
>23.1.4. <A
 
137
HREF="routine-vacuuming.html#VACUUM-FOR-WRAPAROUND"
 
138
>Preventing Transaction ID Wraparound Failures</A
 
139
></DT
 
140
><DT
 
141
>23.1.5. <A
 
142
HREF="routine-vacuuming.html#AUTOVACUUM"
 
143
>The Autovacuum Daemon</A
 
144
></DT
 
145
></DL
 
146
></DD
 
147
><DT
 
148
>23.2. <A
 
149
HREF="routine-reindex.html"
 
150
>Routine Reindexing</A
 
151
></DT
 
152
><DT
 
153
>23.3. <A
 
154
HREF="logfile-maintenance.html"
 
155
>Log File Maintenance</A
 
156
></DT
 
157
></DL
 
158
></DIV
 
159
><P
 
160
>   <SPAN
 
161
CLASS="PRODUCTNAME"
 
162
>PostgreSQL</SPAN
 
163
>, like any database software, requires that certain tasks
 
164
   be performed regularly to achieve optimum performance. The tasks
 
165
   discussed here are <SPAN
 
166
CLASS="emphasis"
 
167
><I
 
168
CLASS="EMPHASIS"
 
169
>required</I
 
170
></SPAN
 
171
>, but they
 
172
   are repetitive in nature and can easily be automated using standard
 
173
   tools such as <SPAN
 
174
CLASS="APPLICATION"
 
175
>cron</SPAN
 
176
> scripts or
 
177
   Windows' <SPAN
 
178
CLASS="APPLICATION"
 
179
>Task Scheduler</SPAN
 
180
>.  It is the database
 
181
   administrator's responsibility to set up appropriate scripts, and to
 
182
   check that they execute successfully.
 
183
  </P
 
184
><P
 
185
>   One obvious maintenance task is the creation of backup copies of the data on a
 
186
   regular schedule.  Without a recent backup, you have no chance of recovery
 
187
   after a catastrophe (disk failure, fire, mistakenly dropping a critical
 
188
   table, etc.).  The backup and recovery mechanisms available in
 
189
   <SPAN
 
190
CLASS="PRODUCTNAME"
 
191
>PostgreSQL</SPAN
 
192
> are discussed at length in
 
193
   <A
 
194
HREF="backup.html"
 
195
>Chapter 24</A
 
196
>.
 
197
  </P
 
198
><P
 
199
>   The other main category of maintenance task is periodic <SPAN
 
200
CLASS="QUOTE"
 
201
>"vacuuming"</SPAN
 
202
>
 
203
   of the database.  This activity is discussed in
 
204
   <A
 
205
HREF="routine-vacuuming.html"
 
206
>Section 23.1</A
 
207
>.  Closely related to this is updating
 
208
   the statistics that will be used by the query planner, as discussed in
 
209
   <A
 
210
HREF="routine-vacuuming.html#VACUUM-FOR-STATISTICS"
 
211
>Section 23.1.3</A
 
212
>.
 
213
  </P
 
214
><P
 
215
>   Another task that might need periodic attention is log file management.
 
216
   This is discussed in <A
 
217
HREF="logfile-maintenance.html"
 
218
>Section 23.3</A
 
219
>.
 
220
  </P
 
221
><P
 
222
>   <A
 
223
HREF="http://bucardo.org/wiki/Check_postgres"
 
224
TARGET="_top"
 
225
><SPAN
 
226
CLASS="APPLICATION"
 
227
>check_postgres</SPAN
 
228
></A
 
229
>
 
230
   is available for monitoring database health and reporting unusual
 
231
   conditions.  <SPAN
 
232
CLASS="APPLICATION"
 
233
>check_postgres</SPAN
 
234
> integrates with
 
235
   Nagios and MRTG, but can be run standalone too.
 
236
  </P
 
237
><P
 
238
>   <SPAN
 
239
CLASS="PRODUCTNAME"
 
240
>PostgreSQL</SPAN
 
241
> is low-maintenance compared
 
242
   to some other database management systems.  Nonetheless,
 
243
   appropriate attention to these tasks will go far towards ensuring a
 
244
   pleasant and productive experience with the system.
 
245
  </P
 
246
></DIV
 
247
><DIV
 
248
CLASS="NAVFOOTER"
 
249
><HR
 
250
ALIGN="LEFT"
 
251
WIDTH="100%"><TABLE
 
252
SUMMARY="Footer navigation table"
 
253
WIDTH="100%"
 
254
BORDER="0"
 
255
CELLPADDING="0"
 
256
CELLSPACING="0"
 
257
><TR
 
258
><TD
 
259
WIDTH="33%"
 
260
ALIGN="left"
 
261
VALIGN="top"
 
262
><A
 
263
HREF="multibyte.html"
 
264
ACCESSKEY="P"
 
265
>Prev</A
 
266
></TD
 
267
><TD
 
268
WIDTH="34%"
 
269
ALIGN="center"
 
270
VALIGN="top"
 
271
><A
 
272
HREF="index.html"
 
273
ACCESSKEY="H"
 
274
>Home</A
 
275
></TD
 
276
><TD
 
277
WIDTH="33%"
 
278
ALIGN="right"
 
279
VALIGN="top"
 
280
><A
 
281
HREF="routine-vacuuming.html"
 
282
ACCESSKEY="N"
 
283
>Next</A
 
284
></TD
 
285
></TR
 
286
><TR
 
287
><TD
 
288
WIDTH="33%"
 
289
ALIGN="left"
 
290
VALIGN="top"
 
291
>Character Set Support</TD
 
292
><TD
 
293
WIDTH="34%"
 
294
ALIGN="center"
 
295
VALIGN="top"
 
296
><A
 
297
HREF="admin.html"
 
298
ACCESSKEY="U"
 
299
>Up</A
 
300
></TD
 
301
><TD
 
302
WIDTH="33%"
 
303
ALIGN="right"
 
304
VALIGN="top"
 
305
>Routine Vacuuming</TD
 
306
></TR
 
307
></TABLE
 
308
></DIV
 
309
></BODY
 
310
></HTML
 
311
>
 
 
b'\\ No newline at end of file'