-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-pgchecksums.html
More file actions
180 lines (179 loc) · 17.1 KB
/
app-pgchecksums.html
File metadata and controls
180 lines (179 loc) · 17.1 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
<?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_checksums</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="pgarchivecleanup.html" title="pg_archivecleanup" /><link rel="next" href="app-pgcontroldata.html" title="pg_controldata" /><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-server.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-pgchecksums.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="pgarchivecleanup.html" title="pg_archivecleanup">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="reference-server.html" title="PostgreSQLサーバアプリケーション">上へ</a></td><td width="60%" align="center"><span class="application">pg_checksums</span></td><td width="20%" align="right"> <a accesskey="n" href="app-pgcontroldata.html" title="pg_controldata">次へ</a></td></tr></table><hr /></div><div class="refentry" id="APP-PGCHECKSUMS"><div class="titlepage"></div><a id="id-1.9.5.5.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle"><span class="application">pg_checksums</span></span></h2><p>pg_checksums<span class="original">
<refpurpose>enable, disable or check data checksums in a <productname>PostgreSQL</productname> database cluster</refpurpose>
</span> — <span class="productname">PostgreSQL</span>データベースクラスタのデータチェックサムを有効化、無効化、あるいは検査する</p></div><div class="refsynopsisdiv"><h2>概要</h2><div class="cmdsynopsis"><p id="id-1.9.5.5.4.1"><code class="command">pg_checksums</code> [<em class="replaceable"><code>option</code></em>...] [[ <code class="option">-D</code> | <code class="option">--pgdata</code> ]<em class="replaceable"><code>datadir</code></em>]</p></div></div><div class="refsect1" id="R1-APP-PGCHECKSUMS-1"><h2>説明</h2><span class="original">
<title>Description</title>
</span><p>
<span class="original">
<application>pg_checksums</application> checks, enables or disables data
checksums in a <productname>PostgreSQL</productname> cluster. The server
must be shut down cleanly before running
<application>pg_checksums</application>. When verifying checksums, the exit
status is zero if there are no checksum errors, and nonzero if at least one
checksum failure is detected. When enabling or disabling checksums, the
exit status is nonzero if the operation failed.
</span>
<span class="application">pg_checksums</span>は<span class="productname">PostgreSQL</span>クラスタのデータチェックサムの検査と有効化、無効化を行います。
<span class="application">pg_checksums</span>を実行する前にサーバは正常停止されていなければなりません。
チェックサムを検査する場合、終了ステータスはチェックサム誤りが無ければゼロで、チェックサム誤りが一つでも在ったなら非ゼロです。
チェックサムの有効化、無効化をする場合、終了ステータスは操作に失敗したときに非ゼロになります。
</p><p>
<span class="original">
When verifying checksums, every file in the cluster is scanned. When
enabling checksums, each relation file block with a changed checksum is
rewritten in-place.
Disabling checksums only updates the file <filename>pg_control</filename>.
</span>
チェックサムを検査する場合、クラスタ内の各ファイルがスキャンされます。
チェックサムの有効化では、チェックサムが変更されたすべてのリレーションファイルブロックがその場で書き換えられます。
チェックサムの無効化では、ファイル<code class="filename">pg_control</code>だけ更新されます。
</p></div><div class="refsect1" id="id-1.9.5.5.6"><h2>オプション</h2><span class="original">
<title>Options</title>
</span><p>
<span class="original">
The following command-line options are available:
</span>
以下のコマンドラインオプションが使用できます。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-D <em class="replaceable"><code>directory</code></em></code><br /></span><span class="term"><code class="option">--pgdata=<em class="replaceable"><code>directory</code></em></code></span></dt><dd><p>
<span class="original">
Specifies the directory where the database cluster is stored.
</span>
データベースクラスタが格納されているディレクトリを指定します。
</p></dd><dt><span class="term"><code class="option">-c</code><br /></span><span class="term"><code class="option">--check</code></span></dt><dd><p>
<span class="original">
Checks checksums. This is the default mode if nothing else is
specified.
</span>
チェックサムを検査します。
これは何も指定しなかった場合のデフォルトのモードです。
</p></dd><dt><span class="term"><code class="option">-d</code><br /></span><span class="term"><code class="option">--disable</code></span></dt><dd><p>
<span class="original">
Disables checksums.
</span>
チェックサムを無効化します。
</p></dd><dt><span class="term"><code class="option">-e</code><br /></span><span class="term"><code class="option">--enable</code></span></dt><dd><p>
<span class="original">
Enables checksums.
</span>
チェックサムを有効化します。
</p></dd><dt><span class="term"><code class="option">-f <em class="replaceable"><code>filenode</code></em></code><br /></span><span class="term"><code class="option">--filenode=<em class="replaceable"><code>filenode</code></em></code></span></dt><dd><p>
<span class="original">
Only validate checksums in the relation with filenode
<replaceable>filenode</replaceable>.
</span>
指定したファイルノード<em class="replaceable"><code>filenode</code></em>のリレーション内のチェックサムだけを検査します。
</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_checksums</command> will wait for all files
to be written safely to disk. This option causes
<command>pg_checksums</command> to return without waiting, which is
faster, but means that a subsequent operating system crash can leave
the updated data directory corrupt. Generally, this option is useful
for testing but should not be used on a production installation.
This option has no effect when using <literal>&#45;-check</literal>.
</span>
<code class="command">pg_checksums</code>はデフォルトでは全てのファイルが安全にディスクに書かれるまで待ちます。
このオプションは、<code class="command">pg_checksums</code>がこれを待たずに応答するようにします。より早いですが、直後のオペレーティングシステムのクラッシュで更新されたデータディレクトリの破損が残る可能性があることを意味します。
一般に、このオプションはテストには有用ですが、本番導入むけには使うべきではありません。
<code class="literal">--check</code>を使う場合には、このオプションは効果がありません。
</p></dd><dt><span class="term"><code class="option">-P</code><br /></span><span class="term"><code class="option">--progress</code></span></dt><dd><p>
<span class="original">
Enable progress reporting. Turning this on will deliver a progress
report while checking or enabling checksums.
</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_checksums</command> will recursively open and synchronize
all files in the data directory. 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_checksums</code>はデータディレクトリ内のすべてのファイルを再帰的に開いて同期します。
ファイルの検索は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 systems that contain the
data directory, 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>を代わりに使用して、データディレクトリ、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">--verbose</code></span></dt><dd><p>
<span class="original">
Enable verbose output. Lists all checked files.
</span>
冗長な出力を有効にします。
チェックした全ファイルの一覧を出力します。
</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">
Print the <application>pg_checksums</application> version and exit.
</span>
<span class="application">pg_checksums</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">
Show help about <application>pg_checksums</application> command line
arguments, and exit.
</span>
<span class="application">pg_checksums</span>のコマンドライン引数のヘルプを表示して終了します。
</p></dd></dl></div><p>
</p></div><div class="refsect1" id="id-1.9.5.5.7"><h2>環境</h2><span class="original">
<title>Environment</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">PGDATA</code></span></dt><dd><p>
<span class="original">
Specifies the directory where the database cluster is
stored; can be overridden using the <option>-D</option> option.
</span>
データベースクラスタが格納されたディレクトリを指定します。
これに対して<code class="option">-D</code>オプションで上書き指定できます。
</p></dd><dt><span class="term"><code class="envar">PG_COLOR</code></span></dt><dd><p>
<span class="original">
Specifies whether to use color in diagnostic messages. Possible values
are <literal>always</literal>, <literal>auto</literal> and
<literal>never</literal>.
</span>
診断メッセージで色を使うかどうかを指定します。
指定可能な値は<code class="literal">always</code>、<code class="literal">auto</code>、<code class="literal">never</code>です。
</p></dd></dl></div></div><div class="refsect1" id="id-1.9.5.5.8"><h2>注釈</h2><span class="original">
<title>Notes</title>
</span><p>
<span class="original">
Enabling checksums in a large cluster can potentially take a long time.
During this operation, the cluster or other programs that write to the
data directory must not be started or else data loss may occur.
</span>
大きいクラスタでチェックサムを有効にするには、場合によっては長時間を要する可能性があります。
この操作中にデータディレクトリに書き込みをするクラスタや他のプログラムを開始してはいけません。さもないとデータ損失が起きるかもしれません。
</p><p>
<span class="original">
When using a replication setup with tools which perform direct copies
of relation file blocks (for example <xref linkend="app-pgrewind"/>),
enabling or disabling checksums can lead to page corruptions in the
shape of incorrect checksums if the operation is not done consistently
across all nodes. When enabling or disabling checksums in a replication
setup, it is thus recommended to stop all the clusters before switching
them all consistently. Destroying all standbys, performing the operation
on the primary and finally recreating the standbys from scratch is also
safe.
</span>
リレーションファイルブロックの直接コピーを行うツール(例えば<a class="xref" href="app-pgrewind.html" title="pg_rewind"><span class="refentrytitle"><span class="application">pg_rewind</span></span></a>)でレプリケーションのセットアップを使う時のチェックサムの有効化や無効化は、操作が全ノードを通して一貫して行われない場合、不正なチェックサムという形でページ破損を引き起こすおそれがあります。
したがって、レプリケーションのセットアップでチェックサムの有効化や無効化をするときには、一貫して切り替える前にすべてのクラスタを停止することを推奨します。
全てのスタンバイを廃棄して、プライマリ上で操作を行い、最後にスタンバイを新たに再作成するのも安全です。
</p><p>
<span class="original">
If <application>pg_checksums</application> is aborted or killed while
enabling or disabling checksums, the cluster's data checksum configuration
remains unchanged, and <application>pg_checksums</application> can be
re-run to perform the same operation.
</span>
チェックサムの有効化や無効化をしている最中に<span class="application">pg_checksums</span>が中断されたり、killされたりした場合、クラスタのデータチェックサム設定は変更されないままとなり、<span class="application">pg_checksums</span>を再実行して同じ操作をおこなえます。
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pgarchivecleanup.html" title="pg_archivecleanup">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-server.html" title="PostgreSQLサーバアプリケーション">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="app-pgcontroldata.html" title="pg_controldata">次へ</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="application">pg_archivecleanup</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_controldata</span></td></tr></table></div></body></html>