1mysql‐zrm‐restore(1) mysql‐
2zrm‐restore(1)
3
4
5
6NNAAMMEE
7 mmyyssqqll‐‐zzrrmm‐‐rreessttoorree ‐ Recovery utility for ZRM for MySQL.
8
9SSYYNNOOPPSSIISS
10 mmyyssqqll‐‐zzrrmm‐‐rreessttoorree
11 [‐‐‐‐bbaacckkuupp‐‐sseett _n_a_m_e]
12 [‐‐‐‐ssoouurrccee‐‐ddiirreeccttoorryy _d_i_r_e_c_t_o_r_y _n_a_m_e]
13 [‐‐‐‐bbiinn‐‐llooggss _"_/_f_u_l_l_p_a_t_h_/_n_a_m_e_1
14_/_f_u_l_l_p_a_t_h_/_n_a_m_e_2 _._._._"]
15 [‐‐‐‐mmyyssqqll‐‐sshhuuttddoowwnn | ‐‐no‐mysql‐shutdown]
16 [‐‐‐‐rreettrryy‐‐ccoouunntt _c_o_u_n_t]
17 [‐‐‐‐rreettrryy‐‐ddeellaayy _s_e_c_o_n_d_s]
18 [‐‐‐‐rreepplliiccaattiioonn|‐‐noreplication]
19 [‐‐‐‐aallll‐‐ddaattaabbaasseess]
20 [‐‐‐‐ddaattaabbaasseess _"_n_a_m_e_1 _n_a_m_e_2 _._._._"]
21 [‐‐‐‐ssttaarrtt‐‐ppoossiittiioonn _#]
22 [‐‐‐‐ssttoopp‐‐ppoossiittiioonn _#]
23 [‐‐‐‐ooffffsseett _#]
24 [‐‐‐‐ssttaarrtt‐‐ddaatteettiimmee _n_a_m_e]
25 [‐‐‐‐ssttoopp‐‐ddaatteettiimmee _n_a_m_e]
26 [‐‐‐‐ccooppyy‐‐pplluuggiinn _p_l_u_g_i_n]
27 [‐‐‐‐sssshh‐‐uusseerr _u_s_e_r]
28 [‐‐‐‐ssoocckkeett‐‐rreemmoottee‐‐ppoorrtt _p_o_r_t]
29 [‐‐‐‐ppaassssffiillee _f_i_l_e_n_a_m_e]
30 [‐‐‐‐uusseerr _u_s_e_r]
31 [‐‐‐‐ppaasssswwoorrdd _p_a_s_s_w_o_r_d]
32 [‐‐‐‐hhoosstt _h_o_s_t_n_a_m_e]
33 [‐‐‐‐ppoorrtt _p_o_r_t_n_u_m_b_e_r]
34 [‐‐‐‐ssoocckkeett _n_a_m_e]
35 [‐‐‐‐ssssll‐‐ooppttiioonnss _"_M_y_S_Q_L _s_s_l _o_p_t_i_o_n_s_"]
36 [‐‐mysql‐binpath _l_o_c_a_t_i_o_n _o_f _M_y_S_Q_L
37_c_o_m_m_a_n_d_s]
38 [‐‐‐‐ttmmppddiirr _t_e_m_p___d_i_r_e_c_t_o_r_y]
39 [‐‐‐‐ooppttiioonnss‐‐ffiillee _f_i_l_e_n_a_m_e]
40 [‐‐‐‐qquuiieett|‐‐‐‐nnoo‐‐qquuiieett]
41 [‐‐‐‐vveerrbboossee]
42 [‐‐‐‐hheellpp]
43
44
45
46DDEESSCCRRIIPPTTIIOONN
47 Recovery of various MySQL databases can be
48done using the
49 fImysql‐zrm‐restore utility. Use it to fully/selectively
50restore the
51 database on the same system or another system.
52
53 Please take a look at ZRM for MySQL documentation
54(http://mysql‐
55 backup.zmanda.com/) for procedures on how to configure and
56use ZRM for
57 MySQL.
58
59 When restoring backed up databases, use either
60‐‐‐‐aallll‐‐ddaattaabbaasseess or
61 ‐‐‐‐ddaattaabbaasseess options.
62
63 When the backup contains only specific tables from a data‐
64base, you need
65 to specify mmyyssqqll‐‐zzrrmm action as restore and the database
66name to restore
67 the backed up tables. Tables not included in the backup
68but present in
69 the database will be left untouched.
70
71
72OOPPTTIIOONNSS
73 ‐‐‐‐bbaacckkuupp‐‐sseett _n_a_m_e
74 Specify backup‐set for the backup run. This is a
75Command line
76 option only and cannot be specified in the config‐
77uration file.
78 The default value is _B_a_c_k_u_p_S_e_t_1. If such a
79value is already
80 present, it will be used.
81
82 ‐‐‐‐ssoouurrccee‐‐ddiirreeccttoorryy _d_i_r_e_c_t_o_r_y _n_a_m_e
83 Choose the directory containing a backup. This op‐
84tion is ignored
85 when bbaacckkuupp action is specified. For rreessttoorree
86action, both
87 ssoouurrccee‐‐ddiirreeccttoorryy and bbiinn‐‐llooggss options should not
88be specified.
89 If both are present, the utility will return an er‐
90ror.
91
92 ‐‐‐‐bbiinn‐‐llooggss "_f_u_l_l_p_a_t_h_n_a_m_e_1 ffuullllppaatthhnnaammee22 ......"
93 List binary log files, along with their full
94paths to be used
95 for restore. For restore action, both
96ssoouurrccee‐‐ddiirreeccttoorryy and
97 bbiinn‐‐llooggss options should not be specified. The util‐
98ity will throw
99 an error if both are specified
100
101 ‐‐‐‐mmyyssqqll‐‐sshhuuttddoowwnn | ‐‐‐‐nnoo‐‐mmyyssqqll‐‐sshhuuttddoowwnn
102 This specifies whether the mysql server should be
103shutdown dur‐
104 ing the restore. If not specified, then the mysql
105server is shut
106 down only if restoring from a full raw backup. If
107the options
108 are not specified and the restore only contains
109logical full
110 backup data or incremental backup data, the mysql
111server is not
112 shut down. When restoring from a full raw backup
113it is recom‐
114 mended not to use the ‐‐no‐mysql‐shutdown option
115as it can
116 result in unexpected problems.
117
118 ‐‐retry‐count _c_o_u_n_t
119 This specifies the number of times ZRM should try
120to attempt the
121 restore of a raw backup in case the specified
122copy‐plugin
123 returns an error. This retry is specifically to
124ensure that we
125 do not fail the full restore in case the shutdown
126of the mysql
127 server takes more time than expected. Hence
128ZRM will only
129 attempt to retry for the restore of the very first
130file that is
131 attempted to be restored. The default value is 2.
132
133 ‐‐‐‐rreettrryy‐‐ddeellaayy _d_e_l_a_y _i_n _s_e_c_o_n_d_s
134 This specifies the time in seconds between 2
135retrys. The default
136 value is 5 seconds
137
138 ‐‐‐‐aallll‐‐ddaattaabbaasseess
139 Opt for all databases to be backed up or restored.
140This is the
141 default if _d_a_t_a_b_a_s_e or _d_a_t_a_b_a_s_e_s are not specified.
142
143 ‐‐‐‐ddaattaabbaasseess _"_n_a_m_e_1 _n_a_m_e_2 _._._._"
144 List the databases to backup or restore.
145
146 ‐‐‐‐rreepplliiccaattiioonn | ‐‐‐‐nnoorreepplliiccaattiioonn
147 Choose replication to restore replication files.
148They will be
149 restored only if the host is a replication slave.
150Default option
151 is ‐‐‐‐nnoorreepplliiccaattiioonn.
152
153 ‐‐‐‐ssttaarrtt‐‐ppoossiittiioonn _N
154 Fix the start position _N for selective restore
155of all events
156 after log position NN. Log position can be de‐
157termined using
158 ppaarrssee‐‐bbiinnllooggss action.
159
160 ‐‐‐‐ssttoopp‐‐ppoossiittiioonn _N
161 Stop selective restore of all events before log
162position _N. Log
163 positions can be determined using ppaarrssee‐‐bbiinnllooggss ac‐
164tion.
165
166 ‐‐‐‐ooffffsseett _N
167 Skip the first _N entries of the first binary
168log file in
169 bbiinn‐‐llooggss parameter.
170
171 ‐‐‐‐ssttaarrtt‐‐ddaatteettiimmee _d_a_t_e_t_i_m_e
172 Start selective restore from date and time spec‐
173ified in MySQL
174 DATETIME or TIMESTAMP format(hh:mm:ss). The utility
175will throw
176 an error if the parameter is not in the format.
177
178 ‐‐stop‐datetime _d_a_t_e_t_i_m_e
179 Selective restore till specified date and time
180specified in
181 MySQL DATETIME or TIMESTAMP format(hh:mm:ss). The
182utility will
183 return an error if the parameter is not in the for‐
184mat.
185
186 ‐‐‐‐ccooppyy‐‐pplluuggiinn _p_l_u_g_i_n
187 Specify plugin along with full pathname to be used
188for transfer‐
189 ring backup files to and from a remote MySQL
190server to the
191 machine running ZRM for MySQL. Use this option
192when
193 1. remote incremental backup is required
194 2. copying replication related files from a re‐
195mote machine
196 3. execute mmyyssqqllhhoottccooppyy (MySQL command) and
197copy the data
198 from the remote machine
199 4. restore data to a remote machine using
200mmyyssqqllhhoottccooppyy(MySQL
201 command). This parameter is optional.
202
203 ‐‐‐‐sssshh‐‐uusseerr _u_s_e_r
204 Specifies the user to be used for SSH. This pa‐
205rameter is only
206 used by the ssh‐copy.pl plugin. The user specified
207should either
208 be the user mysqld runs as or root. If not speci‐
209fied the default
210 value used is mysql. This parameter is optional.
211
212 ‐‐‐‐ssoocckkeett‐‐rreemmoottee‐‐ppoorrtt _p_o_r_t
213 Port that the socket‐plugin.pl should use to
214connect. This
215 parameter is only used by the socket‐copy.pl plug‐
216in. The default
217 value used is 25300. This parameter is optional
218
219 ‐‐‐‐ppaassssffiillee _f_i_l_e The file containing the passphrase
220for encryp‐
221 tion. This parameter is used only by the encrypt‐
222plugin.pl. If
223 not specified the value used is /etc/mysql‐
224zrm/.passphrase. This
225 parameter is optional.
226
227 ‐‐‐‐uusseerr _u_s_e_r
228 Specify MySQL backup/restore user
229
230 ‐‐‐‐ppaasssswwoorrdd _p_a_s_s_w_o_r_d
231 Specify password for the MySQL user
232
233 ‐‐‐‐hhoosstt _h_o_s_t_n_a_m_e
234 Specify MySQL server host name or IP name.
235
236 ‐‐‐‐ppoorrtt _p_o_r_t_n_u_m_b_e_r
237 Specify MySQL server port.
238
239 ‐‐‐‐ssoocckkeett _n_a_m_e
240 Specify socket file to use for communication with
241MySQL server.
242
243 ‐‐‐‐ssssll‐‐ooppttiioonnss _"_M_y_S_Q_L _s_s_l _o_p_t_i_o_n_s_"
244 Set any ‐‐ssl* options that MySQL supports. Refer
245to MySQL Docu‐
246 mentation for SSL options details.
247
248 ‐‐‐‐mmyyssqqll‐‐bbiinnppaatthh _m_y_s_q_l___b_i_n_a_r_i_e_s___d_i_r
249 Set the full path where MySQL binaries are in‐
250stalled. For exam‐
251 ple: //oopptt//llaammpppp//bbiinn
252
253 ‐‐options‐file _f_i_l_e_n_a_m_e
254 Set the file along with full pathname that contains
255MySQL com‐
256 mand options.
257
258 ‐‐‐‐ttmmppddiirr _t_e_m_p___d_i_r_e_c_t_o_r_y
259 Full path of the directory for storing tempo‐
260rary files and
261 directories on the backup host. The default is to
262use the sys‐
263 tem‐specified temporary directory on the backup
264host, e.g /tmp.
265
266 ‐‐‐‐qquuiieett|‐‐‐‐nnoo‐‐qquuiieett
267 Choose qquuiieett to suppress display of log messages
268on stdout.
269 Choose nnoo‐‐qquuiieett to display the log messages to
270standard output
271 (ssttddoouutt). The default is ‐‐‐‐nnoo‐‐qquuiieett.
272
273 ‐‐‐‐vveerrbboossee
274 Provide more detailed output in the log. Ver‐
275bose output is
276 turned off by default.
277
278 ‐‐‐‐hheellpp Displays the help message and exits. This com‐
279mand line only
280 parameter cannot be specified in the configuration
281file.
282
283EEXXAAMMPPLLEESS
284 For restoring backup image dated 18 Aug 2006 (backup
285image can be
286 either full or incremental backup):
287
288 mmyyssqqll‐‐zzrrmm ‐‐‐‐aaccttiioonn rreessttoorree ‐‐‐‐ssoouurrccee‐‐ddiirreeccttoorryy
289//vvaarr//lliibb//mmyyssqqll‐‐zzrrmm//bbaacckk‐‐
290 uuppsseett11//2200006600881188112211553322
291
292 The above command will restore all databases (full or
293incremental as
294 the case may be) that were backed up.
295
296 mmyyssqqll‐‐zzrrmm ‐‐‐‐aaccttiioonn rreessttoorree ‐‐‐‐ssoouurrccee‐‐ddiirreeccttoorryy
297//vvaarr//lliibb//mmyyssqqll‐‐zzrrmm//bbaacckk‐‐
298 uuppsseett11//2200006600881188112211553322 ‐‐‐‐ddaattaabbaasseess ddbb11 ddbb22 ddbb33
299
300 The above command does a selective restore of the speci‐
301fied databases.
302
303 mmyyssqqll‐‐zzrrmm ‐‐‐‐aaccttiioonn rreessttoorree ‐‐‐‐bbiinn‐‐llooggss
304//vvaarr//lliibb//mmyyssqqll‐‐zzrrmm//bbaacckk‐‐
305 uuppsseett11//2200006600881188112211553322//mmyyssqqll‐‐bbiinn..[[00‐‐99]]**
306//vvaarr//lliibb//mmyyssqqll‐‐zzrrmm//bbaacckk‐‐
307 uuppsseett11//2200006600881199112211553322//mmyyssqqll‐‐bbiinn..[[00‐‐99]]**
308
309 The above command does a selective restore of all speci‐
310fied binary log
311 files using a single MySQL server connection.
312
313
314
315FFIILLEESS
316 //vvaarr//lliibb//mmyyssqqll‐‐zzrrmm
317 Directory under which all backup data is stored.
318
319
320 //eettcc//mmyyssqqll‐‐zzrrmm//_b_a_c_k_u_p _s_e_t _n_a_m_e//mmyyssqqll‐‐zzrrmm..ccoonnff
321 Configuration file read by mmyyssqqll‐‐zzrrmm utility.
322
323
324RREETTUURRNN VVAALLUUEESS
325 On success, zero is returned. On error, non‐zero value is
326returned.
327
328
329SSEEEE AALLSSOO
330 mysql‐zrm(1), mysql‐zrm‐backup(1), mysql‐zrm‐man‐
331age‐backup(1),
332 mysql‐zrm‐check(1), mysql‐zrm‐list(1), mysql‐
333zrm‐getconf(1),
334 mysql‐zrm‐setconf(1), mysql‐zrm‐parse‐binlogs(1), mysql‐
335zrm‐purge(1),
336 mysql‐zrm‐extract‐backup(1), mysql‐zrm‐ver‐
337ify‐backup(1),
338 mysql‐zrm‐abort‐backup(1), mysql‐zrm‐
339scheduler(1),
340 mysql‐zrm‐reporter(1), mysql‐zrm.conf(5), mysqldump(1),
341mysqlbinlog(1),
342 mysql(1), lvm(8), Zmanda Recovery Manager for MySQL
343(http://mysql‐
344 backup.zmanda.com/)
345
346
347AAUUTTHHOORR
348 Zmanda Inc. (http://www.zmanda.com)
349
350
351
352Zmanda, Inc. ZRM for MySQL 2.1 mysql‐
353zrm‐restore(1)
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396