|
1 | | -<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.142 2010/02/19 00:15:25 momjian Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.143 2010/02/22 11:47:30 heikki Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="backup"> |
4 | 4 | <title>Backup and Restore</title> |
@@ -955,7 +955,7 @@ SELECT pg_stop_backup(); |
955 | 955 | <listitem> |
956 | 956 | <para> |
957 | 957 | Create a recovery command file <filename>recovery.conf</> in the cluster |
958 | | - data directory (see <xref linkend="recovery-config-settings">). You might |
| 958 | + data directory (see <xref linkend="recovery-config">). You might |
959 | 959 | also want to temporarily modify <filename>pg_hba.conf</> to prevent |
960 | 960 | ordinary users from connecting until you are sure the recovery was successful. |
961 | 961 | </para> |
@@ -1076,162 +1076,6 @@ restore_command = 'cp /mnt/server/archivedir/%f %p' |
1076 | 1076 | WAL data need not be scanned again. |
1077 | 1077 | </para> |
1078 | 1078 |
|
1079 | | - |
1080 | | - <sect3 id="recovery-config-settings" xreflabel="Recovery Settings"> |
1081 | | - <title>Recovery Settings</title> |
1082 | | - |
1083 | | - <para> |
1084 | | - These settings can only be made in the <filename>recovery.conf</> |
1085 | | - file, and apply only for the duration of the recovery. (A sample file, |
1086 | | - <filename>share/recovery.conf.sample</>, exists in the installation's |
1087 | | - <filename>share/</> directory.) They must be |
1088 | | - reset for any subsequent recovery you wish to perform. They cannot be |
1089 | | - changed once recovery has begun. |
1090 | | - The parameters for streaming replication are described in <xref |
1091 | | - linkend="replication-config-settings">. |
1092 | | - </para> |
1093 | | - |
1094 | | - <variablelist> |
1095 | | - |
1096 | | - <varlistentry id="restore-command" xreflabel="restore_command"> |
1097 | | - <term><varname>restore_command</varname> (<type>string</type>)</term> |
1098 | | - <listitem> |
1099 | | - <para> |
1100 | | - The shell command to execute to retrieve an archived segment of |
1101 | | - the WAL file series. This parameter is required for archive recovery, |
1102 | | - but optional for streaming replication. |
1103 | | - Any <literal>%f</> in the string is |
1104 | | - replaced by the name of the file to retrieve from the archive, |
1105 | | - and any <literal>%p</> is replaced by the copy destination path name |
1106 | | - on the server. |
1107 | | - (The path name is relative to the current working directory, |
1108 | | - i.e., the cluster's data directory.) |
1109 | | - Any <literal>%r</> is replaced by the name of the file containing the |
1110 | | - last valid restart point. That is the earliest file that must be kept |
1111 | | - to allow a restore to be restartable, so this information can be used |
1112 | | - to truncate the archive to just the minimum required to support |
1113 | | - restarting from the current restore. <literal>%r</> is typically only |
1114 | | - used by warm-standby configurations |
1115 | | - (see <xref linkend="warm-standby">). |
1116 | | - Write <literal>%%</> to embed an actual <literal>%</> character. |
1117 | | - </para> |
1118 | | - |
1119 | | - <para> |
1120 | | - It is important for the command to return a zero exit status |
1121 | | - only if it succeeds. The command <emphasis>will</> be asked for file |
1122 | | - names that are not present in the archive; it must return nonzero |
1123 | | - when so asked. Examples: |
1124 | | -<programlisting> |
1125 | | -restore_command = 'cp /mnt/server/archivedir/%f "%p"' |
1126 | | -restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows |
1127 | | -</programlisting> |
1128 | | - </para> |
1129 | | - </listitem> |
1130 | | - </varlistentry> |
1131 | | - |
1132 | | - <varlistentry id="recovery-end-command" xreflabel="recovery_end_command"> |
1133 | | - <term><varname>recovery_end_command</varname> (<type>string</type>)</term> |
1134 | | - <listitem> |
1135 | | - <para> |
1136 | | - This parameter specifies a shell command that will be executed once only |
1137 | | - at the end of recovery. This parameter is optional. The purpose of the |
1138 | | - <varname>recovery_end_command</> is to provide a mechanism for cleanup |
1139 | | - following replication or recovery. |
1140 | | - Any <literal>%r</> is replaced by the name of the file |
1141 | | - containing the last valid restart point. That is the earliest file that |
1142 | | - must be kept to allow a restore to be restartable, so this information |
1143 | | - can be used to truncate the archive to just the minimum required to |
1144 | | - support restart from the current restore. <literal>%r</> would |
1145 | | - typically be used in a warm-standby configuration |
1146 | | - (see <xref linkend="warm-standby">). |
1147 | | - Write <literal>%%</> to embed an actual <literal>%</> character |
1148 | | - in the command. |
1149 | | - </para> |
1150 | | - <para> |
1151 | | - If the command returns a non-zero exit status then a WARNING log |
1152 | | - message will be written and the database will proceed to start up |
1153 | | - anyway. An exception is that if the command was terminated by a |
1154 | | - signal, the database will not proceed with startup. |
1155 | | - </para> |
1156 | | - </listitem> |
1157 | | - </varlistentry> |
1158 | | - |
1159 | | - <varlistentry id="recovery-target-time" xreflabel="recovery_target_time"> |
1160 | | - <term><varname>recovery_target_time</varname> |
1161 | | - (<type>timestamp</type>) |
1162 | | - </term> |
1163 | | - <listitem> |
1164 | | - <para> |
1165 | | - This parameter specifies the time stamp up to which recovery |
1166 | | - will proceed. |
1167 | | - At most one of <varname>recovery_target_time</> and |
1168 | | - <xref linkend="recovery-target-xid"> can be specified. |
1169 | | - The default is to recover to the end of the WAL log. |
1170 | | - The precise stopping point is also influenced by |
1171 | | - <xref linkend="recovery-target-inclusive">. |
1172 | | - </para> |
1173 | | - </listitem> |
1174 | | - </varlistentry> |
1175 | | - |
1176 | | - <varlistentry id="recovery-target-xid" xreflabel="recovery_target_xid"> |
1177 | | - <term><varname>recovery_target_xid</varname> (<type>string</type>)</term> |
1178 | | - <listitem> |
1179 | | - <para> |
1180 | | - This parameter specifies the transaction ID up to which recovery |
1181 | | - will proceed. Keep in mind |
1182 | | - that while transaction IDs are assigned sequentially at transaction |
1183 | | - start, transactions can complete in a different numeric order. |
1184 | | - The transactions that will be recovered are those that committed |
1185 | | - before (and optionally including) the specified one. |
1186 | | - At most one of <varname>recovery_target_xid</> and |
1187 | | - <xref linkend="recovery-target-time"> can be specified. |
1188 | | - The default is to recover to the end of the WAL log. |
1189 | | - The precise stopping point is also influenced by |
1190 | | - <xref linkend="recovery-target-inclusive">. |
1191 | | - </para> |
1192 | | - </listitem> |
1193 | | - </varlistentry> |
1194 | | - |
1195 | | - <varlistentry id="recovery-target-inclusive" |
1196 | | - xreflabel="recovery_target_inclusive"> |
1197 | | - <term><varname>recovery_target_inclusive</varname> |
1198 | | - (<type>boolean</type>) |
1199 | | - </term> |
1200 | | - <listitem> |
1201 | | - <para> |
1202 | | - Specifies whether we stop just after the specified recovery target |
1203 | | - (<literal>true</literal>), or just before the recovery target |
1204 | | - (<literal>false</literal>). |
1205 | | - Applies to both <xref linkend="recovery-target-time"> |
1206 | | - and <xref linkend="recovery-target-xid">, whichever one is |
1207 | | - specified for this recovery. This indicates whether transactions |
1208 | | - having exactly the target commit time or ID, respectively, will |
1209 | | - be included in the recovery. Default is <literal>true</>. |
1210 | | - </para> |
1211 | | - </listitem> |
1212 | | - </varlistentry> |
1213 | | - |
1214 | | - <varlistentry id="recovery-target-timeline" |
1215 | | - xreflabel="recovery_target_timeline"> |
1216 | | - <term><varname>recovery_target_timeline</varname> |
1217 | | - (<type>string</type>) |
1218 | | - </term> |
1219 | | - <listitem> |
1220 | | - <para> |
1221 | | - Specifies recovering into a particular timeline. The default is |
1222 | | - to recover along the same timeline that was current when the |
1223 | | - base backup was taken. You only need to set this parameter |
1224 | | - in complex re-recovery situations, where you need to return to |
1225 | | - a state that itself was reached after a point-in-time recovery. |
1226 | | - See <xref linkend="backup-timelines"> for discussion. |
1227 | | - </para> |
1228 | | - </listitem> |
1229 | | - </varlistentry> |
1230 | | - |
1231 | | - </variablelist> |
1232 | | - |
1233 | | - </sect3> |
1234 | | - |
1235 | 1079 | </sect2> |
1236 | 1080 |
|
1237 | 1081 | <sect2 id="backup-timelines"> |
|