提交 0df32e3c 编写于 作者: B Bruce Momjian

Allow pg_resetxlog -f to reset pg_control counters using xlog

information, and add a -r option to reset pg_control without affecting
xlog.

yuanjia lee
上级 3289a932
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_resetxlog.sgml,v 1.13 2006/04/25 21:02:33 momjian Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/pg_resetxlog.sgml,v 1.14 2006/04/26 02:17:15 momjian Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -20,6 +20,7 @@ PostgreSQL documentation ...@@ -20,6 +20,7 @@ PostgreSQL documentation
<command>pg_resetxlog</command> <command>pg_resetxlog</command>
<arg>-f</arg> <arg>-f</arg>
<arg>-n</arg> <arg>-n</arg>
<arg>-r</arg>
<arg>-o<replaceable class="parameter">oid</replaceable> </arg> <arg>-o<replaceable class="parameter">oid</replaceable> </arg>
<arg>-x <replaceable class="parameter">xid</replaceable> </arg> <arg>-x <replaceable class="parameter">xid</replaceable> </arg>
<arg>-m <replaceable class="parameter">mxid</replaceable> </arg> <arg>-m <replaceable class="parameter">mxid</replaceable> </arg>
...@@ -57,22 +58,22 @@ PostgreSQL documentation ...@@ -57,22 +58,22 @@ PostgreSQL documentation
<para> <para>
If <command>pg_resetxlog</command> complains that it cannot determine If <command>pg_resetxlog</command> complains that it cannot determine
valid data for <filename>pg_control</>, you can force it to proceed anyway valid data for <filename>pg_control</>, you can force it to proceed
by specifying the <literal>-f</> (force) switch. In this case plausible anyway by specifying the <literal>-f</> (force) switch. In this case
values will be substituted for the missing data. Most of the fields can be plausible values will be substituted for the missing data.
expected to match, but manual assistance may be needed for the next OID, <command>pg_resetxlog</command>'s own environment is the source for
next transaction ID, next multitransaction ID and offset, its guess at the locale fields; take care that <envar>LANG</> and so
WAL starting address, and database locale fields. forth match the environment that <command>initdb</> was run in.
The first five of these can be set using the switches discussed below. <filename>/xlog</> files are used to determine other parameters, like
<command>pg_resetxlog</command>'s own environment is the source for its next OID, next transaction ID, next multi-transaction ID and offset,
guess at the locale fields; take care that <envar>LANG</> and so forth WAL starting address, and database locale fields. Because determined
match the environment that <command>initdb</> was run in. values might be wrong, the first five of these can be set using the
If you are not able to determine correct values for all these fields, switches discussed below. If you are not able to determine correct
<literal>-f</> can still be used, but values for all these fields, <literal>-f</> can still be used, but
the recovered database must be treated with even more suspicion than the recovered database must be treated with even more suspicion than
usual: an immediate dump and reload is imperative. <emphasis>Do not</> usual: an immediate dump and reload is imperative. <emphasis>Do
execute any data-modifying operations in the database before you dump; not</> execute any data-modifying operations in the database before
as any such action is likely to make the corruption worse. you dump; as any such action is likely to make the corruption worse.
</para> </para>
<para> <para>
...@@ -149,6 +150,11 @@ PostgreSQL documentation ...@@ -149,6 +150,11 @@ PostgreSQL documentation
</itemizedlist> </itemizedlist>
</para> </para>
<para>
The <literal>-r</> restores <filename>pg_control</> counters listed
above without resetting the write-ahead log.
</para>
<para> <para>
The <literal>-n</> (no operation) switch instructs The <literal>-n</> (no operation) switch instructs
<command>pg_resetxlog</command> to print the values reconstructed from <command>pg_resetxlog</command> to print the values reconstructed from
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册