-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-pgcombinebackup.html
More file actions
293 lines (293 loc) · 28.8 KB
/
app-pgcombinebackup.html
File metadata and controls
293 lines (293 loc) · 28.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<?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>pg_combinebackup</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="pgbench.html" title="pgbench" /><link rel="next" href="app-pgconfig.html" title="pg_config" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="reference-client.html" title="PostgreSQLクライアントアプリケーション">PostgreSQLクライアントアプリケーション</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?template=bug_report.yml&what-happened=version 18.3 : app-pgcombinebackup.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="pgbench.html" title="pgbench">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="reference-client.html" title="PostgreSQLクライアントアプリケーション">上へ</a></td><td width="60%" align="center"><span class="application">pg_combinebackup</span></td><td width="20%" align="right"> <a accesskey="n" href="app-pgconfig.html" title="pg_config">次へ</a></td></tr></table><hr /></div><div class="refentry" id="APP-PGCOMBINEBACKUP"><div class="titlepage"></div><a id="id-1.9.4.12.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle"><span class="application">pg_combinebackup</span></span></h2><p>pg_combinebackup<span class="original">
<refpurpose>reconstruct a full backup from an incremental backup and dependent backups</refpurpose>
</span> — 増分バックアップと依存するバックアップ群からフルバックアップを再構築する</p></div><div class="refsynopsisdiv"><h2>概要</h2><div class="cmdsynopsis"><p id="id-1.9.4.12.4.1"><code class="command">pg_combinebackup</code> [<em class="replaceable"><code>option</code></em>...] [<em class="replaceable"><code>backup_directory</code></em>...]</p></div></div><div class="refsect1" id="id-1.9.4.12.5"><h2>説明</h2><span class="original">
<title>Description</title>
</span><p>
<span class="original">
<application>pg_combinebackup</application> is used to reconstruct a
synthetic full backup from an
<link linkend="backup-incremental-backup">incremental backup</link> and the
earlier backups upon which it depends.
</span>
<span class="application">pg_combinebackup</span>は、<a class="link" href="continuous-archiving.html#BACKUP-INCREMENTAL-BACKUP" title="25.3.3. 増分バックアップを作成する">増分バックアップ</a>とそれが依存する以前のバックアップから、合成フルバックアップを再構築するために使用されます。
</p><p>
<span class="original">
Specify all of the required backups on the command line from oldest to newest.
That is, the first backup directory should be the path to the full backup, and
the last should be the path to the final incremental backup
that you wish to restore. The reconstructed backup will be written to the
output directory specified by the <option>-o</option> option.
</span>
コマンドラインで、古いバックアップから最新のバックアップまで、必要なすべてのバックアップを指定します。
つまり、最初のバックアップディレクトリはフルバックアップへのパスでなければならず、最後のバックアップはリストアしたい最後の増分バックアップへのパスでなければなりません。
再構築されたバックアップは、<code class="option">-o</code>オプションで指定された出力ディレクトリに書き込まれます。
</p><p>
<span class="original">
<application>pg_combinebackup</application> will attempt to verify
that the backups you specify form a legal backup chain from which a correct
full backup can be reconstructed. However, it is not designed to help you
keep track of which backups depend on which other backups. If you remove
one or more of the previous backups upon which your incremental
backup relies, you will not be able to restore it. Moreover,
<application>pg_combinebackup</application> only attempts to verify that the
backups have the correct relationship to each other, not that each
individual backup is intact; for that, use
<xref linkend="app-pgverifybackup" />.
</span>
<span class="application">pg_combinebackup</span>は、指定したバックアップが正しいフルバックアップを再構築できる正当なバックアップチェーンを形成しているかどうかを検証します。
ただし、どのバックアップがどのバックアップに依存しているかを追跡するための機能は備えていません。
増分バックアップが依存する以前のバックアップを1つでも削除すると、その増分バックアップはリストアできなくなります。
さらに、<span class="application">pg_combinebackup</span>は、バックアップが互いに正しい関係を持っているかどうかを検証するだけで、個々のバックアップが損なわれていないかどうかは検証しません。そのためには<a class="xref" href="app-pgverifybackup.html" title="pg_verifybackup"><span class="refentrytitle"><span class="application">pg_verifybackup</span></span></a>を使用してください。
</p><p>
<span class="original">
Since the output of <application>pg_combinebackup</application> is a
synthetic full backup, it can be used as an input to a future invocation of
<application>pg_combinebackup</application>. The synthetic full backup would
be specified on the command line in lieu of the chain of backups from which
it was reconstructed.
</span>
<span class="application">pg_combinebackup</span>の出力は合成フルバックアップであるため、将来の<span class="application">pg_combinebackup</span>の呼び出しの入力として使用できます。
再構築に使われたバックアップチェーンの代わりに合成フルバックアップをコマンドラインで指定します。
</p></div><div class="refsect1" id="id-1.9.4.12.6"><h2>オプション</h2><span class="original">
<title>Options</title>
</span><p>
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-d</code><br /></span><span class="term"><code class="option">--debug</code></span></dt><dd><p>
<span class="original">
Print lots of debug logging output on <filename>stderr</filename>.
</span>
<code class="filename">stderr</code>に大量のデバッグログを出力します。
</p></dd><dt><span class="term"><code class="option">-k</code><br /></span><span class="term"><code class="option">--link</code></span></dt><dd><p>
<span class="original">
Use hard links instead of copying files to the synthetic backup.
Reconstruction of the synthetic backup might be faster (no file copying)
and use less disk space, but care must be taken when using the output
directory, because any modifications to that directory (for example,
starting the server) can also affect the input directories. Likewise,
changes to the input directories (for example, starting the server on
the full backup) could affect the output directory. Thus, this option
is best used when the input directories are only copies that will be
removed after <application>pg_combinebackup</application> has completed.
</span>
合成バックアップにファイルをコピーする代わりにハードリンクを使います。
合成バックアップの再構築はより高速(ファイルコピーなし)であり、使用するディスクスペースは少なくなりますが、出力ディレクトリを使用する場合は注意が必要です。そのディレクトリへの変更(例えば、サーバの開始)がすべて入力ディレクトリにも影響する可能性があるためです。
同様に、入力ディレクトリへの変更(例えば、フルバックアップでサーバを開始)は、出力ディレクトリに影響する可能性があります。
したがって、このオプションは、入力ディレクトリが<span class="application">pg_combinebackup</span>が完了した後に削除されるコピーのみである場合に使用するのが最善です。
</p><p>
<span class="original">
Requires that the input backups and the output directory are in the
same file system.
</span>
入力のバックアップと出力のディレクトリが同じファイルシステムにあることが必要です。
</p><p>
<span class="original">
If a backup manifest is not available or does not contain checksum of
the right type, hard links will still be created, but the file will be
also read block-by-block for the checksum calculation.
</span>
バックアップマニフェストが使用できない場合、または正しいタイプのチェックサムが含まれていない場合、ハードリンクは作成されますが、ファイルはチェックサム計算のためにブロックごとに読み取られます。
</p></dd><dt><span class="term"><code class="option">-n</code><br /></span><span class="term"><code class="option">--dry-run</code></span></dt><dd><p>
<span class="original">
The <option>-n</option>/<option>&#45;-dry-run</option> option instructs
<command>pg_combinebackup</command> to figure out what would be done
without actually creating the target directory or any output files.
It is particularly useful in combination with <option>&#45;-debug</option>.
</span>
<code class="option">-n</code>/<code class="option">--dry-run</code>オプションは、ターゲットディレクトリや出力ファイルを実際には作成せずに、<code class="command">pg_combinebackup</code>が何を行うかを報告します。
これは<code class="option">--debug</code>と組み合わせて使用すると特に便利です。
</p></dd><dt><span class="term"><code class="option">-N</code><br /></span><span class="term"><code class="option">--no-sync</code></span></dt><dd><p>
<span class="original">
By default, <command>pg_combinebackup</command> will wait for all files
to be written safely to disk. This option causes
<command>pg_combinebackup</command> to return without waiting, which is
faster, but means that a subsequent operating system crash can leave
the output backup corrupt. Generally, this option is useful for testing
but should not be used when creating a production installation.
</span>
デフォルトでは、<code class="command">pg_combinebackup</code>はすべてのファイルがディスクに安全に書き込まれるまで待機します。
このオプションを指定すると、<code class="command">pg_combinebackup</code>は待機せずに返ります。
これは高速ですが、後続のオペレーティングシステムのクラッシュによって出力バックアップが破損する可能性があります。
通常、このオプションは試験用では有用ですが、実用のインストレーションを作成する際に使用すべきではありません。
</p></dd><dt><span class="term"><code class="option">-o <em class="replaceable"><code>outputdir</code></em></code><br /></span><span class="term"><code class="option">--output=<em class="replaceable"><code>outputdir</code></em></code></span></dt><dd><p>
<span class="original">
Specifies the output directory to which the synthetic full backup
should be written. Currently, this argument is required.
</span>
合成フルバックアップを書き込む出力ディレクトリを指定します。
現在、この引数は必須です。
</p></dd><dt><span class="term"><code class="option">-T <em class="replaceable"><code>olddir</code></em>=<em class="replaceable"><code>newdir</code></em></code><br /></span><span class="term"><code class="option">--tablespace-mapping=<em class="replaceable"><code>olddir</code></em>=<em class="replaceable"><code>newdir</code></em></code></span></dt><dd><p>
<span class="original">
Relocates the tablespace in directory <replaceable>olddir</replaceable>
to <replaceable>newdir</replaceable> during the backup.
<replaceable>olddir</replaceable> is the absolute path of the tablespace
as it exists in the final backup specified on the command line,
and <replaceable>newdir</replaceable> is the absolute path to use for the
tablespace in the reconstructed backup. If either path needs to contain
an equal sign (<literal>=</literal>), precede that with a backslash.
This option can be specified multiple times for multiple tablespaces.
</span>
バックアップ時にディレクトリ<em class="replaceable"><code>olddir</code></em>内のテーブル空間を<em class="replaceable"><code>newdir</code></em>に再配置します。
<em class="replaceable"><code>olddir</code></em>はコマンドラインで指定された最終バックアップに存在するテーブル空間の絶対パスで、<em class="replaceable"><code>newdir</code></em>は再構築されたバックアップでテーブル空間に使用される絶対パスです。
どちらかのパスに等号(<code class="literal">=</code>)が含まれる場合、その前にバックスラッシュを置きます。
このオプションは、複数のテーブル空間に対して複数回指定できます。
</p></dd><dt><span class="term"><code class="option">--clone</code></span></dt><dd><p>
<span class="original">
Use efficient file cloning (also known as <quote>reflinks</quote> on
some systems) instead of copying files to the new data directory,
which can result in near-instantaneous copying of the data files.
</span>
新しいデータディレクトリにファイルをコピーする代わりに、効率的なファイルクローニング(一部のシステムでは<span class="quote">「<span class="quote">reflinks</span>」</span>とも呼ばれます)を使用します。これによりデータファイルをほぼ瞬時にコピーすることができます。
</p><p>
<span class="original">
If a backup manifest is not available or does not contain checksum of
the right type, file cloning will be used to copy the file, but the
file will be also read block-by-block for the checksum calculation.
</span>
バックアップマニフェストが使用できない場合、または正しいタイプのチェックサムが含まれていない場合、ファイルコピーのためにクローニングが使われますが、ファイルはチェックサム計算のためにブロックごとに読み取られます。
</p><p>
<span class="original">
File cloning is only supported on some operating systems and file
systems. If it is selected but not supported, the
<application>pg_combinebackup</application> run will error. At present,
it is supported on Linux (kernel 4.5 or later) with Btrfs and XFS (on
file systems created with reflink support), and on macOS with APFS.
</span>
ファイルのクローニングは、一部のオペレーティングシステムおよびファイルシステムでのみサポートされています。
選択されているけれどもサポートされていない場合、<span class="application">pg_combinebackup</span>の実行はエラーになります。
現在、Linux(カーネル4.5以上)のBtrfsと、XFS(reflinkを有効にして作成されたファイルシステム)、および、macOSのAPFSでサポートされています。
</p></dd><dt><span class="term"><code class="option">--copy</code></span></dt><dd><p>
<span class="original">
Perform regular file copy. This is the default. (See also
<option>&#45;-copy-file-range</option>, <option>&#45;-clone</option>, and
<option>-k</option>/<option>&#45;-link</option>.)
</span>
通常のファイルコピーを行います。
これがデフォルトです。
(<code class="option">--copy-file-range</code>、<code class="option">--clone</code>および<code class="option">-k</code>/<code class="option">--link</code>も参照してください。)
</p></dd><dt><span class="term"><code class="option">--copy-file-range</code></span></dt><dd><p>
<span class="original">
Use the <function>copy_file_range</function> system call for efficient
copying. On some file systems this gives results similar to
<option>&#45;-clone</option>, sharing physical disk blocks, while on others
it may still copy blocks, but do so via an optimized path. At present,
it is supported on Linux and FreeBSD.
</span>
システムコール<code class="function">copy_file_range</code>を使用して、効率的なコピーを行います。
ファイルシステムによって、物理ディスクブロックを共有して<code class="option">--clone</code>と似た効果を得られるものもあれば、依然としてブロックをコピーするものの最適化されたパスを介して動作するものもあります。
現在、LinuxとFreeBSDでサポートされています。
</p><p>
<span class="original">
If a backup manifest is not available or does not contain checksum of
the right type, <function>copy_file_range</function> will be used to
copy the file, but the file will be also read block-by-block for the
checksum calculation.
</span>
バックアップマニフェストが利用できないか、正しいタイプのチェックサムを含んでいない場合、<code class="function">copy_file_range</code>はファイルをコピーするために使用されますが、ファイルはチェックサム計算のためにブロックごとに読み取られます。
</p></dd><dt><span class="term"><code class="option">--manifest-checksums=<em class="replaceable"><code>algorithm</code></em></code></span></dt><dd><p>
<span class="original">
Like <xref linkend="app-pgbasebackup"/>,
<application>pg_combinebackup</application> writes a backup manifest
in the output directory. This option specifies the checksum algorithm
that should be applied to each file included in the backup manifest.
Currently, the available algorithms are <literal>NONE</literal>,
<literal>CRC32C</literal>, <literal>SHA224</literal>,
<literal>SHA256</literal>, <literal>SHA384</literal>,
and <literal>SHA512</literal>. The default is <literal>CRC32C</literal>.
</span>
<a class="xref" href="app-pgbasebackup.html" title="pg_basebackup"><span class="refentrytitle"><span class="application">pg_basebackup</span></span></a>と同様に、<span class="application">pg_combinebackup</span>はバックアップマニフェストを出力ディレクトリに書き込みます。
このオプションは、バックアップマニフェストに含まれる各ファイルに適用されるチェックサムアルゴリズムを指定します。
現在利用可能なアルゴリズムは、<code class="literal">NONE</code>、<code class="literal">CRC32C</code>、<code class="literal">SHA224</code>、<code class="literal">SHA256</code>、<code class="literal">SHA384</code>、<code class="literal">SHA512</code>です。
デフォルトは<code class="literal">CRC32C</code>です。
</p></dd><dt><span class="term"><code class="option">--no-manifest</code></span></dt><dd><p>
<span class="original">
Disables generation of a backup manifest. If this option is not
specified, a backup manifest for the reconstructed backup will be
written to the output directory.
</span>
バックアップマニフェストの生成を無効にします。
このオプションを指定しない場合、再構築されたバックアップのバックアップマニフェストが出力ディレクトリに書き込まれます。
</p></dd><dt><span class="term"><code class="option">--sync-method=<em class="replaceable"><code>method</code></em></code></span></dt><dd><p>
<span class="original">
When set to <literal>fsync</literal>, which is the default,
<command>pg_combinebackup</command> will recursively open and synchronize
all files in the backup directory. When the plain format is used, the
search for files will follow symbolic links for the WAL directory and
each configured tablespace.
</span>
デフォルトの<code class="literal">fsync</code>に設定すると、<code class="command">pg_combinebackup</code>はバックアップディレクトリ内の全てのファイルを再帰的にオープンして同期します。
plain形式を使用する場合、ファイルの検索はWALディレクトリと設定された各テーブル空間のシンボリックリンクをたどります。
</p><p>
<span class="original">
On Linux, <literal>syncfs</literal> may be used instead to ask the
operating system to synchronize the whole file system that contains the
backup directory. When the plain format is used,
<command>pg_combinebackup</command> will also synchronize the file systems
that contain the WAL files and each tablespace. See
<xref linkend="guc-recovery-init-sync-method"/> for information about
the caveats to be aware of when using <literal>syncfs</literal>.
</span>
Linuxでは、<code class="literal">syncfs</code>を代わりに使用して、バックアップディレクトリを含むファイルシステム全体を同期するようにオペレーティングシステムに要求できます。
plain形式を使用する場合、<code class="command">pg_combinebackup</code>はWALファイルと各テーブル空間を含むファイルシステムも同期させます。
<code class="literal">syncfs</code>を使用する際に注意すべき注意事項については、<a class="xref" href="runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD">recovery_init_sync_method</a>を参照してください。
</p><p>
<span class="original">
This option has no effect when <option>&#45;-no-sync</option> is used.
</span>
このオプションは<code class="option">--no-sync</code>が使われている場合は効果がありません。
</p></dd><dt><span class="term"><code class="option">-V</code><br /></span><span class="term"><code class="option">--version</code></span></dt><dd><p>
<span class="original">
Prints the <application>pg_combinebackup</application> version and
exits.
</span>
<span class="application">pg_combinebackup</span>のバージョンを出力して終了します。
</p></dd><dt><span class="term"><code class="option">-?</code><br /></span><span class="term"><code class="option">--help</code></span></dt><dd><p>
<span class="original">
Shows help about <application>pg_combinebackup</application> command
line arguments, and exits.
</span>
<span class="application">pg_combinebackup</span>コマンドライン引数についてのヘルプを表示して終了します。
</p></dd></dl></div><p>
</p></div><div class="refsect1" id="APP-PGCOMBINEBACKUP-LIMITATIONS"><h2>制限事項</h2><span class="original">
<title>Limitations</title>
</span><p>
<span class="original">
<literal>pg_combinebackup</literal> does not recompute page checksums when
writing the output directory. Therefore, if any of the backups used for
reconstruction were taken with checksums disabled, but the final backup was
taken with checksums enabled, the resulting directory may contain pages
with invalid checksums.
</span>
<code class="literal">pg_combinebackup</code>は出力ディレクトリを書き込む際にページチェックサムを再計算しません。
したがって、再構築に使用されたバックアップのいずれかがチェックサム無効で取得され、最終バックアップがチェックサム有効で取得された場合、結果のディレクトリは無効なチェックサムを持つページを含む可能性があります。
</p><p>
<span class="original">
To avoid this problem, taking a new full backup after changing the checksum
state of the cluster using <xref linkend="app-pgchecksums"/> is
recommended. Otherwise, you can disable and then optionally reenable
checksums on the directory produced by <literal>pg_combinebackup</literal>
in order to correct the problem.
</span>
この問題を回避するには、<a class="xref" href="app-pgchecksums.html" title="pg_checksums"><span class="refentrytitle"><span class="application">pg_checksums</span></span></a>を使用してクラスタのチェックサム状態を変更した後に新しいフルバックアップを取ることをお勧めします。
別な方法としては、問題を修正するために<code class="literal">pg_combinebackup</code>によって生成されたディレクトリのチェックサムを無効にした後、必要に応じて再度有効にすることができます。
</p></div><div class="refsect1" id="id-1.9.4.12.8"><h2>環境</h2><span class="original">
<title>Environment</title>
</span><p>
<span class="original">
This utility, like most other <productname>PostgreSQL</productname> utilities,
uses the environment variables supported by <application>libpq</application>
(see <xref linkend="libpq-envars"/>).
</span>
このユーティリティは、他のほとんどの<span class="productname">PostgreSQL</span>ユーティリティと同様、<span class="application">libpq</span>でサポートされる環境変数を使用します(<a class="xref" href="libpq-envars.html" title="32.15. 環境変数">32.15</a>を参照してください)。
</p><p>
<span class="original">
The environment variable <envar>PG_COLOR</envar> specifies whether to use
color in diagnostic messages. Possible values are
<literal>always</literal>, <literal>auto</literal> and
<literal>never</literal>.
</span>
環境変数<code class="envar">PG_COLOR</code>は診断メッセージで色を使うかどうかを指定します。
指定可能な値は<code class="literal">always</code>、<code class="literal">auto</code>、<code class="literal">never</code>です。
</p></div><div class="refsect1" id="id-1.9.4.12.9"><h2>関連項目</h2><span class="original">
<title>See Also</title>
</span><span class="simplelist"><a class="xref" href="app-pgbasebackup.html" title="pg_basebackup"><span class="refentrytitle"><span class="application">pg_basebackup</span></span></a></span></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pgbench.html" title="pgbench">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-client.html" title="PostgreSQLクライアントアプリケーション">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="app-pgconfig.html" title="pg_config">次へ</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="application">pgbench</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> <span class="application">pg_config</span></td></tr></table></div></body></html>