Merge lp:~daniel-nichter/percona-toolkit/fix-bug-856065 into lp:percona-toolkit/1.0
- fix-bug-856065
- Merge into 1.0
Proposed by
Daniel Nichter
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 112 | ||||
Proposed branch: | lp:~daniel-nichter/percona-toolkit/fix-bug-856065 | ||||
Merge into: | lp:percona-toolkit/1.0 | ||||
Diff against target: |
51316 lines (+25296/-25383) 108 files modified
.bzrignore (+1/-0) docs/user/Makefile (+130/-0) docs/user/authors.rst (+0/-9) docs/user/bugs.rst (+0/-21) docs/user/configuration_files.rst (+0/-115) docs/user/copyright_license_and_warranty.rst (+0/-22) docs/user/environment.rst (+0/-15) docs/user/index.rst (+0/-31) docs/user/make.bat (+170/-0) docs/user/pt-archiver.rst (+0/-1556) docs/user/pt-collect.rst (+0/-264) docs/user/pt-config-diff.rst (+0/-518) docs/user/pt-deadlock-logger.rst (+0/-760) docs/user/pt-diskstats.rst (+0/-390) docs/user/pt-duplicate-key-checker.rst (+0/-563) docs/user/pt-fifo-split.rst (+0/-305) docs/user/pt-find.rst (+0/-977) docs/user/pt-fk-error-logger.rst (+0/-493) docs/user/pt-heartbeat.rst (+0/-874) docs/user/pt-index-usage.rst (+0/-840) docs/user/pt-kill.rst (+0/-1053) docs/user/pt-log-player.rst (+0/-795) docs/user/pt-mext.rst (+0/-224) docs/user/pt-mysql-summary.rst (+0/-233) docs/user/pt-online-schema-change.rst (+0/-807) docs/user/pt-pmp.rst (+0/-244) docs/user/pt-query-advisor.rst (+0/-848) docs/user/pt-query-digest.rst (+0/-2561) docs/user/pt-show-grants.rst (+0/-534) docs/user/pt-sift.rst (+0/-273) docs/user/pt-slave-delay.rst (+0/-532) docs/user/pt-slave-find.rst (+0/-543) docs/user/pt-slave-restart.rst (+0/-755) docs/user/pt-stalk.rst (+0/-367) docs/user/pt-summary.rst (+0/-230) docs/user/pt-table-checksum.rst (+0/-2036) docs/user/pt-table-sync.rst (+0/-1627) docs/user/pt-tcp-model.rst (+0/-531) docs/user/pt-trend.rst (+0/-258) docs/user/pt-upgrade.rst (+0/-824) docs/user/pt-variable-advisor.rst (+0/-1100) docs/user/pt-visual-explain.rst (+0/-963) docs/user/release_notes.rst (+0/-41) docs/user/source/authors.rst (+9/-0) docs/user/source/bugs.rst (+22/-0) docs/user/source/conf.py (+253/-0) docs/user/source/configuration_files.rst (+115/-0) docs/user/source/copyright_license_and_warranty.rst (+22/-0) docs/user/source/environment.rst (+15/-0) docs/user/source/glossary.rst (+31/-0) docs/user/source/index.rst (+59/-0) docs/user/source/installation.rst (+25/-0) docs/user/source/percona-theme/layout.html (+473/-0) docs/user/source/percona-theme/searchbox.html (+22/-0) docs/user/source/percona-theme/static/default.css_t (+469/-0) docs/user/source/percona-theme/static/jquery.min.js (+154/-0) docs/user/source/percona-theme/static/percona.com.css (+1/-0) docs/user/source/percona-theme/static/percona.com.js (+242/-0) docs/user/source/percona-theme/static/sidebar.js (+151/-0) docs/user/source/percona-theme/theme.conf (+32/-0) docs/user/source/pt-archiver.rst (+1298/-0) docs/user/source/pt-collect.rst (+125/-0) docs/user/source/pt-config-diff.rst (+343/-0) docs/user/source/pt-deadlock-logger.rst (+535/-0) docs/user/source/pt-diskstats.rst (+230/-0) docs/user/source/pt-duplicate-key-checker.rst (+381/-0) docs/user/source/pt-fifo-split.rst (+171/-0) docs/user/source/pt-find.rst (+773/-0) docs/user/source/pt-fk-error-logger.rst (+377/-0) docs/user/source/pt-heartbeat.rst (+705/-0) docs/user/source/pt-index-usage.rst (+696/-0) docs/user/source/pt-kill.rst (+887/-0) docs/user/source/pt-log-player.rst (+697/-0) docs/user/source/pt-mext.rst (+130/-0) docs/user/source/pt-mysql-summary.rst (+140/-0) docs/user/source/pt-online-schema-change.rst (+708/-0) docs/user/source/pt-pmp.rst (+153/-0) docs/user/source/pt-query-advisor.rst (+751/-0) docs/user/source/pt-query-digest.rst (+2411/-0) docs/user/source/pt-show-grants.rst (+439/-0) docs/user/source/pt-sift.rst (+181/-0) docs/user/source/pt-slave-delay.rst (+431/-0) docs/user/source/pt-slave-find.rst (+448/-0) docs/user/source/pt-slave-restart.rst (+614/-0) docs/user/source/pt-stalk.rst (+270/-0) docs/user/source/pt-summary.rst (+136/-0) docs/user/source/pt-table-checksum.rst (+1849/-0) docs/user/source/pt-table-sync.rst (+1539/-0) docs/user/source/pt-tcp-model.rst (+439/-0) docs/user/source/pt-trend.rst (+168/-0) docs/user/source/pt-upgrade.rst (+731/-0) docs/user/source/pt-variable-advisor.rst (+1008/-0) docs/user/source/pt-visual-explain.rst (+847/-0) docs/user/source/release-notes.rst (+198/-0) docs/user/source/release_notes.rst (+41/-0) docs/user/source/system_requirements.rst (+25/-0) docs/user/source/tools.rst (+211/-0) docs/user/source/version.rst (+7/-0) docs/user/system_requirements.rst (+0/-25) docs/user/tools.rst (+0/-211) docs/user/version.rst (+0/-7) lib/NibbleIterator.pm (+444/-0) lib/RowChecksum.pm (+473/-0) lib/SchemaIterator.pm (+1/-1) lib/TableNibbler.pm (+5/-7) t/lib/NibbleIterator.t (+457/-0) t/lib/RowChecksum.t (+417/-0) t/lib/samples/NibbleIterator/a-z.sql (+10/-0) |
||||
To merge this branch: | bzr merge lp:~daniel-nichter/percona-toolkit/fix-bug-856065 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Nichter | Approve | ||
Review via email: mp+82182@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2011-07-15 23:50:16 +0000 |
3 | +++ .bzrignore 2011-11-14 16:37:00 +0000 |
4 | @@ -5,3 +5,4 @@ |
5 | docs/test-coverage/html |
6 | release |
7 | .DS_Store |
8 | +build |
9 | |
10 | === added file 'docs/user/Makefile' |
11 | --- docs/user/Makefile 1970-01-01 00:00:00 +0000 |
12 | +++ docs/user/Makefile 2011-11-14 16:37:00 +0000 |
13 | @@ -0,0 +1,130 @@ |
14 | +# Makefile for Sphinx documentation |
15 | +# |
16 | + |
17 | +# You can set these variables from the command line. |
18 | +SPHINXOPTS = |
19 | +SPHINXBUILD = sphinx-build |
20 | +PAPER = |
21 | +BUILDDIR = build |
22 | + |
23 | +# Internal variables. |
24 | +PAPEROPT_a4 = -D latex_paper_size=a4 |
25 | +PAPEROPT_letter = -D latex_paper_size=letter |
26 | +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source |
27 | + |
28 | +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest |
29 | + |
30 | +help: |
31 | + @echo "Please use \`make <target>' where <target> is one of" |
32 | + @echo " html to make standalone HTML files" |
33 | + @echo " dirhtml to make HTML files named index.html in directories" |
34 | + @echo " singlehtml to make a single large HTML file" |
35 | + @echo " pickle to make pickle files" |
36 | + @echo " json to make JSON files" |
37 | + @echo " htmlhelp to make HTML files and a HTML help project" |
38 | + @echo " qthelp to make HTML files and a qthelp project" |
39 | + @echo " devhelp to make HTML files and a Devhelp project" |
40 | + @echo " epub to make an epub" |
41 | + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" |
42 | + @echo " latexpdf to make LaTeX files and run them through pdflatex" |
43 | + @echo " text to make text files" |
44 | + @echo " man to make manual pages" |
45 | + @echo " changes to make an overview of all changed/added/deprecated items" |
46 | + @echo " linkcheck to check all external links for integrity" |
47 | + @echo " doctest to run all doctests embedded in the documentation (if enabled)" |
48 | + |
49 | +clean: |
50 | + -rm -rf $(BUILDDIR)/* |
51 | + |
52 | +html: |
53 | + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html |
54 | + @echo |
55 | + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." |
56 | + |
57 | +dirhtml: |
58 | + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml |
59 | + @echo |
60 | + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." |
61 | + |
62 | +singlehtml: |
63 | + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml |
64 | + @echo |
65 | + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." |
66 | + |
67 | +pickle: |
68 | + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle |
69 | + @echo |
70 | + @echo "Build finished; now you can process the pickle files." |
71 | + |
72 | +json: |
73 | + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json |
74 | + @echo |
75 | + @echo "Build finished; now you can process the JSON files." |
76 | + |
77 | +htmlhelp: |
78 | + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp |
79 | + @echo |
80 | + @echo "Build finished; now you can run HTML Help Workshop with the" \ |
81 | + ".hhp project file in $(BUILDDIR)/htmlhelp." |
82 | + |
83 | +qthelp: |
84 | + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp |
85 | + @echo |
86 | + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ |
87 | + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" |
88 | + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PerconaXtraBackup.qhcp" |
89 | + @echo "To view the help file:" |
90 | + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PerconaXtraBackup.qhc" |
91 | + |
92 | +devhelp: |
93 | + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp |
94 | + @echo |
95 | + @echo "Build finished." |
96 | + @echo "To view the help file:" |
97 | + @echo "# mkdir -p $$HOME/.local/share/devhelp/PerconaXtraBackup" |
98 | + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PerconaXtraBackup" |
99 | + @echo "# devhelp" |
100 | + |
101 | +epub: |
102 | + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub |
103 | + @echo |
104 | + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." |
105 | + |
106 | +latex: |
107 | + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
108 | + @echo |
109 | + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." |
110 | + @echo "Run \`make' in that directory to run these through (pdf)latex" \ |
111 | + "(use \`make latexpdf' here to do that automatically)." |
112 | + |
113 | +latexpdf: |
114 | + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
115 | + @echo "Running LaTeX files through pdflatex..." |
116 | + make -C $(BUILDDIR)/latex all-pdf |
117 | + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." |
118 | + |
119 | +text: |
120 | + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text |
121 | + @echo |
122 | + @echo "Build finished. The text files are in $(BUILDDIR)/text." |
123 | + |
124 | +man: |
125 | + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man |
126 | + @echo |
127 | + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." |
128 | + |
129 | +changes: |
130 | + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes |
131 | + @echo |
132 | + @echo "The overview file is in $(BUILDDIR)/changes." |
133 | + |
134 | +linkcheck: |
135 | + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck |
136 | + @echo |
137 | + @echo "Link check complete; look for any errors in the above output " \ |
138 | + "or in $(BUILDDIR)/linkcheck/output.txt." |
139 | + |
140 | +doctest: |
141 | + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest |
142 | + @echo "Testing of doctests in the sources finished, look at the " \ |
143 | + "results in $(BUILDDIR)/doctest/output.txt." |
144 | |
145 | === removed file 'docs/user/authors.rst' |
146 | --- docs/user/authors.rst 2011-08-31 15:44:31 +0000 |
147 | +++ docs/user/authors.rst 1970-01-01 00:00:00 +0000 |
148 | @@ -1,9 +0,0 @@ |
149 | - |
150 | -******* |
151 | -AUTHORS |
152 | -******* |
153 | - |
154 | -Percona Toolkit is primarily developed by Baron Schwartz and Daniel Nichter, |
155 | -both of whom are employed by Percona Inc. See each program's documenation |
156 | -for details. |
157 | - |
158 | |
159 | === removed file 'docs/user/bugs.rst' |
160 | --- docs/user/bugs.rst 2011-08-31 15:44:31 +0000 |
161 | +++ docs/user/bugs.rst 1970-01-01 00:00:00 +0000 |
162 | @@ -1,21 +0,0 @@ |
163 | - |
164 | -**** |
165 | -BUGS |
166 | -**** |
167 | - |
168 | -Please report bugs at `https://bugs.launchpad.net/percona-toolkit <https://bugs.launchpad.net/percona-toolkit>`_. |
169 | -Include the following information in your bug report: |
170 | - |
171 | -\* Complete command-line used to run the tool |
172 | - |
173 | -\* Tool \ ``--version``\ |
174 | - |
175 | -\* MySQL version of all servers involved |
176 | - |
177 | -\* Output from the tool including STDERR |
178 | - |
179 | -\* Input files (log/dump/config files, etc.) |
180 | - |
181 | -If possible, include debugging output by running the tool with \ ``PTDEBUG``\ ; |
182 | -see "ENVIRONMENT". |
183 | - |
184 | |
185 | === removed file 'docs/user/configuration_files.rst' |
186 | --- docs/user/configuration_files.rst 2011-08-31 15:44:31 +0000 |
187 | +++ docs/user/configuration_files.rst 1970-01-01 00:00:00 +0000 |
188 | @@ -1,115 +0,0 @@ |
189 | - |
190 | -******************* |
191 | -CONFIGURATION FILES |
192 | -******************* |
193 | - |
194 | -Percona Toolkit tools can read options from configuration files. The |
195 | -configuration file syntax is simple and direct, and bears some resemblances |
196 | -to the MySQL command-line client tools. The configuration files all follow |
197 | -the same conventions. |
198 | - |
199 | -Internally, what actually happens is that the lines are read from the file and |
200 | -then added as command-line options and arguments to the tool, so just |
201 | -think of the configuration files as a way to write your command lines. |
202 | - |
203 | -SYNTAX |
204 | -====== |
205 | - |
206 | -The syntax of the configuration files is as follows: |
207 | - |
208 | -\* |
209 | - |
210 | - Whitespace followed by a hash (#) sign signifies that the rest of the line is a |
211 | - comment. This is deleted. |
212 | - |
213 | - |
214 | -\* |
215 | - |
216 | - Whitespace is stripped from the beginning and end of all lines. |
217 | - |
218 | - |
219 | -\* |
220 | - |
221 | - Empty lines are ignored. |
222 | - |
223 | - |
224 | -\* |
225 | - |
226 | - Each line is permitted to be in either of the following formats: |
227 | - |
228 | - |
229 | - .. code-block:: perl |
230 | - |
231 | - option |
232 | - option=value |
233 | - |
234 | - |
235 | - Whitespace around the equals sign is deleted during processing. |
236 | - |
237 | - |
238 | -\* |
239 | - |
240 | - Only long options are recognized. |
241 | - |
242 | - |
243 | -\* |
244 | - |
245 | - A line containing only two hyphens signals the end of option parsing. Any |
246 | - further lines are interpreted as additional arguments (not options) to the |
247 | - program. |
248 | - |
249 | - |
250 | -READ ORDER |
251 | -========== |
252 | - |
253 | -The tools read several configuration files in order: |
254 | - |
255 | -1. |
256 | - |
257 | - The global Percona Toolkit configuration file, |
258 | - \ */etc/percona-toolkit/percona-toolkit.conf*\ . All tools read this file, |
259 | - so you should only add options to it that you want to apply to all tools. |
260 | - |
261 | - |
262 | -2. |
263 | - |
264 | - The global tool-specific configuration file, \ */etc/percona-toolkit/TOOL.conf*\ , |
265 | - where \ ``TOOL``\ is a tool name like \ ``pt-query-digest``\ . This file is named |
266 | - after the specific tool you're using, so you can add options that apply |
267 | - only to that tool. |
268 | - |
269 | - |
270 | -3. |
271 | - |
272 | - The user's own Percona Toolkit configuration file, |
273 | - \ *$HOME/.percona-toolkit.conf*\ . All tools read this file, so you should only |
274 | - add options to it that you want to apply to all tools. |
275 | - |
276 | - |
277 | -4. |
278 | - |
279 | - The user's tool-specific configuration file, \ *$HOME/.TOOL.conf*\ , |
280 | - where \ ``TOOL``\ is a tool name like \ ``pt-query-digest``\ . This file is named |
281 | - after the specific tool you're using, so you can add options that apply |
282 | - only to that tool. |
283 | - |
284 | - |
285 | -SPECIFYING |
286 | -========== |
287 | - |
288 | -There is a special \ ``--config``\ option, which lets you specify which |
289 | -configuration files Percona Toolkit should read. You specify a |
290 | -comma-separated list of files. However, its behavior is not like other |
291 | -command-line options. It must be given \ **first**\ on the command line, |
292 | -before any other options. If you try to specify it anywhere else, it will |
293 | -cause an error. Also, you cannot specify \ ``--config=/path/to/file``\ ; |
294 | -you must specify the option and the path to the file separated by whitespace |
295 | -\ *without an equal sign*\ between them, like: |
296 | - |
297 | -.. code-block:: perl |
298 | - |
299 | - --config /path/to/file |
300 | - |
301 | -If you don't want any configuration files at all, specify \ ``--config ''``\ to |
302 | -provide an empty list of files. |
303 | - |
304 | |
305 | === removed file 'docs/user/copyright_license_and_warranty.rst' |
306 | --- docs/user/copyright_license_and_warranty.rst 2011-08-31 15:44:31 +0000 |
307 | +++ docs/user/copyright_license_and_warranty.rst 1970-01-01 00:00:00 +0000 |
308 | @@ -1,22 +0,0 @@ |
309 | - |
310 | -******************************** |
311 | -COPYRIGHT, LICENSE, AND WARRANTY |
312 | -******************************** |
313 | - |
314 | -Percona Toolkit is copyright 2011 Percona Inc. and others. |
315 | -See each program's documentation for complete copyright notices. |
316 | - |
317 | -THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
318 | -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
319 | -MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
320 | - |
321 | -This program is free software; you can redistribute it and/or modify it under |
322 | -the terms of the GNU General Public License as published by the Free Software |
323 | -Foundation, version 2; OR the Perl Artistic License. On UNIX and similar |
324 | -systems, you can issue \`man perlgpl' or \`man perlartistic' to read these |
325 | -licenses. |
326 | - |
327 | -You should have received a copy of the GNU General Public License along with |
328 | -this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
329 | -Place, Suite 330, Boston, MA 02111-1307 USA. |
330 | - |
331 | |
332 | === removed file 'docs/user/environment.rst' |
333 | --- docs/user/environment.rst 2011-08-31 15:44:31 +0000 |
334 | +++ docs/user/environment.rst 1970-01-01 00:00:00 +0000 |
335 | @@ -1,15 +0,0 @@ |
336 | - |
337 | -*********** |
338 | -ENVIRONMENT |
339 | -*********** |
340 | - |
341 | -The environment variable \ ``PTDEBUG``\ enables verbose debugging output to STDERR. |
342 | -To enable debugging and capture all output to a file, run the tool like: |
343 | - |
344 | -.. code-block:: perl |
345 | - |
346 | - PTDEBUG=1 pt-table-checksum ... > FILE 2>&1 |
347 | - |
348 | -Be careful: debugging output is voluminous and can generate several megabytes |
349 | -of output. |
350 | - |
351 | |
352 | === removed file 'docs/user/index.rst' |
353 | --- docs/user/index.rst 2011-08-31 15:44:31 +0000 |
354 | +++ docs/user/index.rst 1970-01-01 00:00:00 +0000 |
355 | @@ -1,31 +0,0 @@ |
356 | - |
357 | -***************************** |
358 | -Percona Toolkit Documentation |
359 | -***************************** |
360 | - |
361 | -Percona Toolkit is a collection of advanced command-line tools used by |
362 | -Percona (`http://www.percona.com/ <http://www.percona.com/>`_) support staff to perform a variety of |
363 | -MySQL and system tasks that are too difficult or complex to perform manually. |
364 | - |
365 | -These tools are ideal alternatives to private or "one-off" scripts because |
366 | -they are professionally developed, formally tested, and fully documented. |
367 | -They are also fully self-contained, so installation is quick and easy and |
368 | -no libraries are installed. |
369 | - |
370 | -Percona Toolkit is derived from Maatkit and Aspersa, two of the best-known |
371 | -toolkits for MySQL server administration. It is developed and supported by |
372 | -Percona Inc. For more information and other free, open-source software |
373 | -developed by Percona, visit `http://www.percona.com/software/ <http://www.percona.com/software/>`_. |
374 | - |
375 | -.. toctree:: |
376 | - :maxdepth: 2 |
377 | - |
378 | - tools |
379 | - configuration_files |
380 | - environment |
381 | - system_requirements |
382 | - bugs |
383 | - authors |
384 | - copyright_license_and_warranty |
385 | - version |
386 | - release_notes |
387 | |
388 | === added file 'docs/user/make.bat' |
389 | --- docs/user/make.bat 1970-01-01 00:00:00 +0000 |
390 | +++ docs/user/make.bat 2011-11-14 16:37:00 +0000 |
391 | @@ -0,0 +1,170 @@ |
392 | +@ECHO OFF |
393 | + |
394 | +REM Command file for Sphinx documentation |
395 | + |
396 | +if "%SPHINXBUILD%" == "" ( |
397 | + set SPHINXBUILD=sphinx-build |
398 | +) |
399 | +set BUILDDIR=build |
400 | +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source |
401 | +if NOT "%PAPER%" == "" ( |
402 | + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% |
403 | +) |
404 | + |
405 | +if "%1" == "" goto help |
406 | + |
407 | +if "%1" == "help" ( |
408 | + :help |
409 | + echo.Please use `make ^<target^>` where ^<target^> is one of |
410 | + echo. html to make standalone HTML files |
411 | + echo. dirhtml to make HTML files named index.html in directories |
412 | + echo. singlehtml to make a single large HTML file |
413 | + echo. pickle to make pickle files |
414 | + echo. json to make JSON files |
415 | + echo. htmlhelp to make HTML files and a HTML help project |
416 | + echo. qthelp to make HTML files and a qthelp project |
417 | + echo. devhelp to make HTML files and a Devhelp project |
418 | + echo. epub to make an epub |
419 | + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter |
420 | + echo. text to make text files |
421 | + echo. man to make manual pages |
422 | + echo. changes to make an overview over all changed/added/deprecated items |
423 | + echo. linkcheck to check all external links for integrity |
424 | + echo. doctest to run all doctests embedded in the documentation if enabled |
425 | + goto end |
426 | +) |
427 | + |
428 | +if "%1" == "clean" ( |
429 | + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i |
430 | + del /q /s %BUILDDIR%\* |
431 | + goto end |
432 | +) |
433 | + |
434 | +if "%1" == "html" ( |
435 | + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html |
436 | + if errorlevel 1 exit /b 1 |
437 | + echo. |
438 | + echo.Build finished. The HTML pages are in %BUILDDIR%/html. |
439 | + goto end |
440 | +) |
441 | + |
442 | +if "%1" == "dirhtml" ( |
443 | + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml |
444 | + if errorlevel 1 exit /b 1 |
445 | + echo. |
446 | + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. |
447 | + goto end |
448 | +) |
449 | + |
450 | +if "%1" == "singlehtml" ( |
451 | + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml |
452 | + if errorlevel 1 exit /b 1 |
453 | + echo. |
454 | + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. |
455 | + goto end |
456 | +) |
457 | + |
458 | +if "%1" == "pickle" ( |
459 | + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle |
460 | + if errorlevel 1 exit /b 1 |
461 | + echo. |
462 | + echo.Build finished; now you can process the pickle files. |
463 | + goto end |
464 | +) |
465 | + |
466 | +if "%1" == "json" ( |
467 | + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json |
468 | + if errorlevel 1 exit /b 1 |
469 | + echo. |
470 | + echo.Build finished; now you can process the JSON files. |
471 | + goto end |
472 | +) |
473 | + |
474 | +if "%1" == "htmlhelp" ( |
475 | + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp |
476 | + if errorlevel 1 exit /b 1 |
477 | + echo. |
478 | + echo.Build finished; now you can run HTML Help Workshop with the ^ |
479 | +.hhp project file in %BUILDDIR%/htmlhelp. |
480 | + goto end |
481 | +) |
482 | + |
483 | +if "%1" == "qthelp" ( |
484 | + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp |
485 | + if errorlevel 1 exit /b 1 |
486 | + echo. |
487 | + echo.Build finished; now you can run "qcollectiongenerator" with the ^ |
488 | +.qhcp project file in %BUILDDIR%/qthelp, like this: |
489 | + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PerconaXtraBackup.qhcp |
490 | + echo.To view the help file: |
491 | + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PerconaXtraBackup.ghc |
492 | + goto end |
493 | +) |
494 | + |
495 | +if "%1" == "devhelp" ( |
496 | + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp |
497 | + if errorlevel 1 exit /b 1 |
498 | + echo. |
499 | + echo.Build finished. |
500 | + goto end |
501 | +) |
502 | + |
503 | +if "%1" == "epub" ( |
504 | + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub |
505 | + if errorlevel 1 exit /b 1 |
506 | + echo. |
507 | + echo.Build finished. The epub file is in %BUILDDIR%/epub. |
508 | + goto end |
509 | +) |
510 | + |
511 | +if "%1" == "latex" ( |
512 | + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex |
513 | + if errorlevel 1 exit /b 1 |
514 | + echo. |
515 | + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. |
516 | + goto end |
517 | +) |
518 | + |
519 | +if "%1" == "text" ( |
520 | + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text |
521 | + if errorlevel 1 exit /b 1 |
522 | + echo. |
523 | + echo.Build finished. The text files are in %BUILDDIR%/text. |
524 | + goto end |
525 | +) |
526 | + |
527 | +if "%1" == "man" ( |
528 | + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man |
529 | + if errorlevel 1 exit /b 1 |
530 | + echo. |
531 | + echo.Build finished. The manual pages are in %BUILDDIR%/man. |
532 | + goto end |
533 | +) |
534 | + |
535 | +if "%1" == "changes" ( |
536 | + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes |
537 | + if errorlevel 1 exit /b 1 |
538 | + echo. |
539 | + echo.The overview file is in %BUILDDIR%/changes. |
540 | + goto end |
541 | +) |
542 | + |
543 | +if "%1" == "linkcheck" ( |
544 | + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck |
545 | + if errorlevel 1 exit /b 1 |
546 | + echo. |
547 | + echo.Link check complete; look for any errors in the above output ^ |
548 | +or in %BUILDDIR%/linkcheck/output.txt. |
549 | + goto end |
550 | +) |
551 | + |
552 | +if "%1" == "doctest" ( |
553 | + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest |
554 | + if errorlevel 1 exit /b 1 |
555 | + echo. |
556 | + echo.Testing of doctests in the sources finished, look at the ^ |
557 | +results in %BUILDDIR%/doctest/output.txt. |
558 | + goto end |
559 | +) |
560 | + |
561 | +:end |
562 | |
563 | === removed file 'docs/user/pt-archiver.rst' |
564 | --- docs/user/pt-archiver.rst 2011-09-01 16:00:38 +0000 |
565 | +++ docs/user/pt-archiver.rst 1970-01-01 00:00:00 +0000 |
566 | @@ -1,1556 +0,0 @@ |
567 | - |
568 | -########### |
569 | -pt-archiver |
570 | -########### |
571 | - |
572 | -.. highlight:: perl |
573 | - |
574 | - |
575 | -**** |
576 | -NAME |
577 | -**** |
578 | - |
579 | - |
580 | -pt-archiver - Archive rows from a MySQL table into another table or a file. |
581 | - |
582 | - |
583 | -******** |
584 | -SYNOPSIS |
585 | -******** |
586 | - |
587 | - |
588 | -Usage: pt-archiver [OPTION...] --source DSN --where WHERE |
589 | - |
590 | -pt-archiver nibbles records from a MySQL table. The --source and --dest |
591 | -arguments use DSN syntax; if COPY is yes, --dest defaults to the key's value |
592 | -from --source. |
593 | - |
594 | -Examples: |
595 | - |
596 | -Archive all rows from oltp_server to olap_server and to a file: |
597 | - |
598 | - |
599 | -.. code-block:: perl |
600 | - |
601 | - pt-archiver --source h=oltp_server,D=test,t=tbl --dest h=olap_server \ |
602 | - --file '/var/log/archive/%Y-%m-%d-%D.%t' \ |
603 | - --where "1=1" --limit 1000 --commit-each |
604 | - |
605 | - |
606 | -Purge (delete) orphan rows from child table: |
607 | - |
608 | - |
609 | -.. code-block:: perl |
610 | - |
611 | - pt-archiver --source h=host,D=db,t=child --purge \ |
612 | - --where 'NOT EXISTS(SELECT * FROM parent WHERE col=child.col)' |
613 | - |
614 | - |
615 | - |
616 | -***** |
617 | -RISKS |
618 | -***** |
619 | - |
620 | - |
621 | -The following section is included to inform users about the potential risks, |
622 | -whether known or unknown, of using this tool. The two main categories of risks |
623 | -are those created by the nature of the tool (e.g. read-only tools vs. read-write |
624 | -tools) and those created by bugs. |
625 | - |
626 | -pt-achiver is a read-write tool. It deletes data from the source by default, so |
627 | -you should test your archiving jobs with the "--dry-run" option if you're not |
628 | -sure about them. It is designed to have as little impact on production systems |
629 | -as possible, but tuning with "--limit", "--txn-size" and similar options |
630 | -might be a good idea too. |
631 | - |
632 | -If you write or use "--plugin" modules, you should ensure they are good |
633 | -quality and well-tested. |
634 | - |
635 | -At the time of this release there is an unverified bug with |
636 | -"--bulk-insert" that may cause data loss. |
637 | - |
638 | -The authoritative source for updated information is always the online issue |
639 | -tracking system. Issues that affect this tool will be marked as such. You can |
640 | -see a list of such issues at the following URL: |
641 | -`http://www.percona.com/bugs/pt-archiver <http://www.percona.com/bugs/pt-archiver>`_. |
642 | - |
643 | -See also "BUGS" for more information on filing bugs and getting help. |
644 | - |
645 | - |
646 | -*********** |
647 | -DESCRIPTION |
648 | -*********** |
649 | - |
650 | - |
651 | -pt-archiver is the tool I use to archive tables as described in |
652 | -`http://tinyurl.com/mysql-archiving <http://tinyurl.com/mysql-archiving>`_. The goal is a low-impact, forward-only |
653 | -job to nibble old data out of the table without impacting OLTP queries much. |
654 | -You can insert the data into another table, which need not be on the same |
655 | -server. You can also write it to a file in a format suitable for LOAD DATA |
656 | -INFILE. Or you can do neither, in which case it's just an incremental DELETE. |
657 | - |
658 | -pt-archiver is extensible via a plugin mechanism. You can inject your own |
659 | -code to add advanced archiving logic that could be useful for archiving |
660 | -dependent data, applying complex business rules, or building a data warehouse |
661 | -during the archiving process. |
662 | - |
663 | -You need to choose values carefully for some options. The most important are |
664 | -"--limit", "--retries", and "--txn-size". |
665 | - |
666 | -The strategy is to find the first row(s), then scan some index forward-only to |
667 | -find more rows efficiently. Each subsequent query should not scan the entire |
668 | -table; it should seek into the index, then scan until it finds more archivable |
669 | -rows. Specifying the index with the 'i' part of the "--source" argument can |
670 | -be crucial for this; use "--dry-run" to examine the generated queries and be |
671 | -sure to EXPLAIN them to see if they are efficient (most of the time you probably |
672 | -want to scan the PRIMARY key, which is the default). Even better, profile |
673 | -pt-archiver with pt-query-profiler and make sure it is not scanning the whole |
674 | -table every query. |
675 | - |
676 | -You can disable the seek-then-scan optimizations partially or wholly with |
677 | -"--no-ascend" and "--ascend-first". Sometimes this may be more efficient |
678 | -for multi-column keys. Be aware that pt-archiver is built to start at the |
679 | -beginning of the index it chooses and scan it forward-only. This might result |
680 | -in long table scans if you're trying to nibble from the end of the table by an |
681 | -index other than the one it prefers. See "--source" and read the |
682 | -documentation on the \ ``i``\ part if this applies to you. |
683 | - |
684 | - |
685 | -****** |
686 | -OUTPUT |
687 | -****** |
688 | - |
689 | - |
690 | -If you specify "--progress", the output is a header row, plus status output |
691 | -at intervals. Each row in the status output lists the current date and time, |
692 | -how many seconds pt-archiver has been running, and how many rows it has |
693 | -archived. |
694 | - |
695 | -If you specify "--statistics", \ ``pt-archiver``\ outputs timing and other |
696 | -information to help you identify which part of your archiving process takes the |
697 | -most time. |
698 | - |
699 | - |
700 | -************** |
701 | -ERROR-HANDLING |
702 | -************** |
703 | - |
704 | - |
705 | -pt-archiver tries to catch signals and exit gracefully; for example, if you |
706 | -send it SIGTERM (Ctrl-C on UNIX-ish systems), it will catch the signal, print a |
707 | -message about the signal, and exit fairly normally. It will not execute |
708 | -"--analyze" or "--optimize", because these may take a long time to finish. |
709 | -It will run all other code normally, including calling after_finish() on any |
710 | -plugins (see "EXTENDING"). |
711 | - |
712 | -In other words, a signal, if caught, will break out of the main archiving |
713 | -loop and skip optimize/analyze. |
714 | - |
715 | - |
716 | -******* |
717 | -OPTIONS |
718 | -******* |
719 | - |
720 | - |
721 | -Specify at least one of "--dest", "--file", or "--purge". |
722 | - |
723 | -"--ignore" and "--replace" are mutually exclusive. |
724 | - |
725 | -"--txn-size" and "--commit-each" are mutually exclusive. |
726 | - |
727 | -"--low-priority-insert" and "--delayed-insert" are mutually exclusive. |
728 | - |
729 | -"--share-lock" and "--for-update" are mutually exclusive. |
730 | - |
731 | -"--analyze" and "--optimize" are mutually exclusive. |
732 | - |
733 | -"--no-ascend" and "--no-delete" are mutually exclusive. |
734 | - |
735 | -DSN values in "--dest" default to values from "--source" if COPY is yes. |
736 | - |
737 | - |
738 | ---analyze |
739 | - |
740 | - type: string |
741 | - |
742 | - Run ANALYZE TABLE afterwards on "--source" and/or "--dest". |
743 | - |
744 | - Runs ANALYZE TABLE after finishing. The argument is an arbitrary string. If it |
745 | - contains the letter 's', the source will be analyzed. If it contains 'd', the |
746 | - destination will be analyzed. You can specify either or both. For example, the |
747 | - following will analyze both: |
748 | - |
749 | - |
750 | - .. code-block:: perl |
751 | - |
752 | - --analyze=ds |
753 | - |
754 | - |
755 | - See `http://dev.mysql.com/doc/en/analyze-table.html <http://dev.mysql.com/doc/en/analyze-table.html>`_ for details on ANALYZE |
756 | - TABLE. |
757 | - |
758 | - |
759 | - |
760 | ---ascend-first |
761 | - |
762 | - Ascend only first column of index. |
763 | - |
764 | - If you do want to use the ascending index optimization (see "--no-ascend"), |
765 | - but do not want to incur the overhead of ascending a large multi-column index, |
766 | - you can use this option to tell pt-archiver to ascend only the leftmost column |
767 | - of the index. This can provide a significant performance boost over not |
768 | - ascending the index at all, while avoiding the cost of ascending the whole |
769 | - index. |
770 | - |
771 | - See "EXTENDING" for a discussion of how this interacts with plugins. |
772 | - |
773 | - |
774 | - |
775 | ---ask-pass |
776 | - |
777 | - Prompt for a password when connecting to MySQL. |
778 | - |
779 | - |
780 | - |
781 | ---buffer |
782 | - |
783 | - Buffer output to "--file" and flush at commit. |
784 | - |
785 | - Disables autoflushing to "--file" and flushes "--file" to disk only when a |
786 | - transaction commits. This typically means the file is block-flushed by the |
787 | - operating system, so there may be some implicit flushes to disk between |
788 | - commits as well. The default is to flush "--file" to disk after every row. |
789 | - |
790 | - The danger is that a crash might cause lost data. |
791 | - |
792 | - The performance increase I have seen from using "--buffer" is around 5 to 15 |
793 | - percent. Your mileage may vary. |
794 | - |
795 | - |
796 | - |
797 | ---bulk-delete |
798 | - |
799 | - Delete each chunk with a single statement (implies "--commit-each"). |
800 | - |
801 | - Delete each chunk of rows in bulk with a single \ ``DELETE``\ statement. The |
802 | - statement deletes every row between the first and last row of the chunk, |
803 | - inclusive. It implies "--commit-each", since it would be a bad idea to |
804 | - \ ``INSERT``\ rows one at a time and commit them before the bulk \ ``DELETE``\ . |
805 | - |
806 | - The normal method is to delete every row by its primary key. Bulk deletes might |
807 | - be a lot faster. \ **They also might not be faster**\ if you have a complex |
808 | - \ ``WHERE``\ clause. |
809 | - |
810 | - This option completely defers all \ ``DELETE``\ processing until the chunk of rows |
811 | - is finished. If you have a plugin on the source, its \ ``before_delete``\ method |
812 | - will not be called. Instead, its \ ``before_bulk_delete``\ method is called later. |
813 | - |
814 | - \ **WARNING**\ : if you have a plugin on the source that sometimes doesn't return |
815 | - true from \ ``is_archivable()``\ , you should use this option only if you understand |
816 | - what it does. If the plugin instructs \ ``pt-archiver``\ not to archive a row, |
817 | - it will still be deleted by the bulk delete! |
818 | - |
819 | - |
820 | - |
821 | ---[no]bulk-delete-limit |
822 | - |
823 | - default: yes |
824 | - |
825 | - Add "--limit" to "--bulk-delete" statement. |
826 | - |
827 | - This is an advanced option and you should not disable it unless you know what |
828 | - you are doing and why! By default, "--bulk-delete" appends a "--limit" |
829 | - clause to the bulk delete SQL statement. In certain cases, this clause can be |
830 | - omitted by specifying \ ``--no-bulk-delete-limit``\ . "--limit" must still be |
831 | - specified. |
832 | - |
833 | - |
834 | - |
835 | ---bulk-insert |
836 | - |
837 | - Insert each chunk with LOAD DATA INFILE (implies "--bulk-delete" "--commit-each"). |
838 | - |
839 | - Insert each chunk of rows with \ ``LOAD DATA LOCAL INFILE``\ . This may be much |
840 | - faster than inserting a row at a time with \ ``INSERT``\ statements. It is |
841 | - implemented by creating a temporary file for each chunk of rows, and writing the |
842 | - rows to this file instead of inserting them. When the chunk is finished, it |
843 | - uploads the rows. |
844 | - |
845 | - To protect the safety of your data, this option forces bulk deletes to be used. |
846 | - It would be unsafe to delete each row as it is found, before inserting the rows |
847 | - into the destination first. Forcing bulk deletes guarantees that the deletion |
848 | - waits until the insertion is successful. |
849 | - |
850 | - The "--low-priority-insert", "--replace", and "--ignore" options work |
851 | - with this option, but "--delayed-insert" does not. |
852 | - |
853 | - |
854 | - |
855 | ---charset |
856 | - |
857 | - short form: -A; type: string |
858 | - |
859 | - Default character set. If the value is utf8, sets Perl's binmode on |
860 | - STDOUT to utf8, passes the mysql_enable_utf8 option to DBD::mysql, and runs SET |
861 | - NAMES UTF8 after connecting to MySQL. Any other value sets binmode on STDOUT |
862 | - without the utf8 layer, and runs SET NAMES after connecting to MySQL. |
863 | - |
864 | - See also "--[no]check-charset". |
865 | - |
866 | - |
867 | - |
868 | ---[no]check-charset |
869 | - |
870 | - default: yes |
871 | - |
872 | - Ensure connection and table character sets are the same. Disabling this check |
873 | - may cause text to be erroneously converted from one character set to another |
874 | - (usually from utf8 to latin1) which may cause data loss or mojibake. Disabling |
875 | - this check may be useful or necessary when character set conversions are |
876 | - intended. |
877 | - |
878 | - |
879 | - |
880 | ---[no]check-columns |
881 | - |
882 | - default: yes |
883 | - |
884 | - Ensure "--source" and "--dest" have same columns. |
885 | - |
886 | - Enabled by default; causes pt-archiver to check that the source and destination |
887 | - tables have the same columns. It does not check column order, data type, etc. |
888 | - It just checks that all columns in the source exist in the destination and |
889 | - vice versa. If there are any differences, pt-archiver will exit with an |
890 | - error. |
891 | - |
892 | - To disable this check, specify --no-check-columns. |
893 | - |
894 | - |
895 | - |
896 | ---check-interval |
897 | - |
898 | - type: time; default: 1s |
899 | - |
900 | - How often to check for slave lag if "--check-slave-lag" is given. |
901 | - |
902 | - |
903 | - |
904 | ---check-slave-lag |
905 | - |
906 | - type: string |
907 | - |
908 | - Pause archiving until the specified DSN's slave lag is less than "--max-lag". |
909 | - |
910 | - |
911 | - |
912 | ---columns |
913 | - |
914 | - short form: -c; type: array |
915 | - |
916 | - Comma-separated list of columns to archive. |
917 | - |
918 | - Specify a comma-separated list of columns to fetch, write to the file, and |
919 | - insert into the destination table. If specified, pt-archiver ignores other |
920 | - columns unless it needs to add them to the \ ``SELECT``\ statement for ascending an |
921 | - index or deleting rows. It fetches and uses these extra columns internally, but |
922 | - does not write them to the file or to the destination table. It \ *does*\ pass |
923 | - them to plugins. |
924 | - |
925 | - See also "--primary-key-only". |
926 | - |
927 | - |
928 | - |
929 | ---commit-each |
930 | - |
931 | - Commit each set of fetched and archived rows (disables "--txn-size"). |
932 | - |
933 | - Commits transactions and flushes "--file" after each set of rows has been |
934 | - archived, before fetching the next set of rows, and before sleeping if |
935 | - "--sleep" is specified. Disables "--txn-size"; use "--limit" to |
936 | - control the transaction size with "--commit-each". |
937 | - |
938 | - This option is useful as a shortcut to make "--limit" and "--txn-size" the |
939 | - same value, but more importantly it avoids transactions being held open while |
940 | - searching for more rows. For example, imagine you are archiving old rows from |
941 | - the beginning of a very large table, with "--limit" 1000 and "--txn-size" |
942 | - 1000. After some period of finding and archiving 1000 rows at a time, |
943 | - pt-archiver finds the last 999 rows and archives them, then executes the next |
944 | - SELECT to find more rows. This scans the rest of the table, but never finds any |
945 | - more rows. It has held open a transaction for a very long time, only to |
946 | - determine it is finished anyway. You can use "--commit-each" to avoid this. |
947 | - |
948 | - |
949 | - |
950 | ---config |
951 | - |
952 | - type: Array |
953 | - |
954 | - Read this comma-separated list of config files; if specified, this must be the |
955 | - first option on the command line. |
956 | - |
957 | - |
958 | - |
959 | ---delayed-insert |
960 | - |
961 | - Add the DELAYED modifier to INSERT statements. |
962 | - |
963 | - Adds the DELAYED modifier to INSERT or REPLACE statements. See |
964 | - `http://dev.mysql.com/doc/en/insert.html <http://dev.mysql.com/doc/en/insert.html>`_ for details. |
965 | - |
966 | - |
967 | - |
968 | ---dest |
969 | - |
970 | - type: DSN |
971 | - |
972 | - DSN specifying the table to archive to. |
973 | - |
974 | - This item specifies a table into which pt-archiver will insert rows |
975 | - archived from "--source". It uses the same key=val argument format as |
976 | - "--source". Most missing values default to the same values as |
977 | - "--source", so you don't have to repeat options that are the same in |
978 | - "--source" and "--dest". Use the "--help" option to see which values |
979 | - are copied from "--source". |
980 | - |
981 | - \ **WARNING**\ : Using a default options file (F) DSN option that defines a |
982 | - socket for "--source" causes pt-archiver to connect to "--dest" using |
983 | - that socket unless another socket for "--dest" is specified. This |
984 | - means that pt-archiver may incorrectly connect to "--source" when it |
985 | - connects to "--dest". For example: |
986 | - |
987 | - |
988 | - .. code-block:: perl |
989 | - |
990 | - --source F=host1.cnf,D=db,t=tbl --dest h=host2 |
991 | - |
992 | - |
993 | - When pt-archiver connects to "--dest", host2, it will connect via the |
994 | - "--source", host1, socket defined in host1.cnf. |
995 | - |
996 | - |
997 | - |
998 | ---dry-run |
999 | - |
1000 | - Print queries and exit without doing anything. |
1001 | - |
1002 | - Causes pt-archiver to exit after printing the filename and SQL statements |
1003 | - it will use. |
1004 | - |
1005 | - |
1006 | - |
1007 | ---file |
1008 | - |
1009 | - type: string |
1010 | - |
1011 | - File to archive to, with DATE_FORMAT()-like formatting. |
1012 | - |
1013 | - Filename to write archived rows to. A subset of MySQL's DATE_FORMAT() |
1014 | - formatting codes are allowed in the filename, as follows: |
1015 | - |
1016 | - |
1017 | - .. code-block:: perl |
1018 | - |
1019 | - %d Day of the month, numeric (01..31) |
1020 | - %H Hour (00..23) |
1021 | - %i Minutes, numeric (00..59) |
1022 | - %m Month, numeric (01..12) |
1023 | - %s Seconds (00..59) |
1024 | - %Y Year, numeric, four digits |
1025 | - |
1026 | - |
1027 | - You can use the following extra format codes too: |
1028 | - |
1029 | - |
1030 | - .. code-block:: perl |
1031 | - |
1032 | - %D Database name |
1033 | - %t Table name |
1034 | - |
1035 | - |
1036 | - Example: |
1037 | - |
1038 | - |
1039 | - .. code-block:: perl |
1040 | - |
1041 | - --file '/var/log/archive/%Y-%m-%d-%D.%t' |
1042 | - |
1043 | - |
1044 | - The file's contents are in the same format used by SELECT INTO OUTFILE, as |
1045 | - documented in the MySQL manual: rows terminated by newlines, columns |
1046 | - terminated by tabs, NULL characters are represented by \N, and special |
1047 | - characters are escaped by \. This lets you reload a file with LOAD DATA |
1048 | - INFILE's default settings. |
1049 | - |
1050 | - If you want a column header at the top of the file, see "--header". The file |
1051 | - is auto-flushed by default; see "--buffer". |
1052 | - |
1053 | - |
1054 | - |
1055 | ---for-update |
1056 | - |
1057 | - Adds the FOR UPDATE modifier to SELECT statements. |
1058 | - |
1059 | - For details, see `http://dev.mysql.com/doc/en/innodb-locking-reads.html <http://dev.mysql.com/doc/en/innodb-locking-reads.html>`_. |
1060 | - |
1061 | - |
1062 | - |
1063 | ---header |
1064 | - |
1065 | - Print column header at top of "--file". |
1066 | - |
1067 | - Writes column names as the first line in the file given by "--file". If the |
1068 | - file exists, does not write headers; this keeps the file loadable with LOAD |
1069 | - DATA INFILE in case you append more output to it. |
1070 | - |
1071 | - |
1072 | - |
1073 | ---help |
1074 | - |
1075 | - Show help and exit. |
1076 | - |
1077 | - |
1078 | - |
1079 | ---high-priority-select |
1080 | - |
1081 | - Adds the HIGH_PRIORITY modifier to SELECT statements. |
1082 | - |
1083 | - See `http://dev.mysql.com/doc/en/select.html <http://dev.mysql.com/doc/en/select.html>`_ for details. |
1084 | - |
1085 | - |
1086 | - |
1087 | ---host |
1088 | - |
1089 | - short form: -h; type: string |
1090 | - |
1091 | - Connect to host. |
1092 | - |
1093 | - |
1094 | - |
1095 | ---ignore |
1096 | - |
1097 | - Use IGNORE for INSERT statements. |
1098 | - |
1099 | - Causes INSERTs into "--dest" to be INSERT IGNORE. |
1100 | - |
1101 | - |
1102 | - |
1103 | ---limit |
1104 | - |
1105 | - type: int; default: 1 |
1106 | - |
1107 | - Number of rows to fetch and archive per statement. |
1108 | - |
1109 | - Limits the number of rows returned by the SELECT statements that retrieve rows |
1110 | - to archive. Default is one row. It may be more efficient to increase the |
1111 | - limit, but be careful if you are archiving sparsely, skipping over many rows; |
1112 | - this can potentially cause more contention with other queries, depending on the |
1113 | - storage engine, transaction isolation level, and options such as |
1114 | - "--for-update". |
1115 | - |
1116 | - |
1117 | - |
1118 | ---local |
1119 | - |
1120 | - Do not write OPTIMIZE or ANALYZE queries to binlog. |
1121 | - |
1122 | - Adds the NO_WRITE_TO_BINLOG modifier to ANALYZE and OPTIMIZE queries. See |
1123 | - "--analyze" for details. |
1124 | - |
1125 | - |
1126 | - |
1127 | ---low-priority-delete |
1128 | - |
1129 | - Adds the LOW_PRIORITY modifier to DELETE statements. |
1130 | - |
1131 | - See `http://dev.mysql.com/doc/en/delete.html <http://dev.mysql.com/doc/en/delete.html>`_ for details. |
1132 | - |
1133 | - |
1134 | - |
1135 | ---low-priority-insert |
1136 | - |
1137 | - Adds the LOW_PRIORITY modifier to INSERT or REPLACE statements. |
1138 | - |
1139 | - See `http://dev.mysql.com/doc/en/insert.html <http://dev.mysql.com/doc/en/insert.html>`_ for details. |
1140 | - |
1141 | - |
1142 | - |
1143 | ---max-lag |
1144 | - |
1145 | - type: time; default: 1s |
1146 | - |
1147 | - Pause archiving if the slave given by "--check-slave-lag" lags. |
1148 | - |
1149 | - This option causes pt-archiver to look at the slave every time it's about |
1150 | - to fetch another row. If the slave's lag is greater than the option's value, |
1151 | - or if the slave isn't running (so its lag is NULL), pt-table-checksum sleeps |
1152 | - for "--check-interval" seconds and then looks at the lag again. It repeats |
1153 | - until the slave is caught up, then proceeds to fetch and archive the row. |
1154 | - |
1155 | - This option may eliminate the need for "--sleep" or "--sleep-coef". |
1156 | - |
1157 | - |
1158 | - |
1159 | ---no-ascend |
1160 | - |
1161 | - Do not use ascending index optimization. |
1162 | - |
1163 | - The default ascending-index optimization causes \ ``pt-archiver``\ to optimize |
1164 | - repeated \ ``SELECT``\ queries so they seek into the index where the previous query |
1165 | - ended, then scan along it, rather than scanning from the beginning of the table |
1166 | - every time. This is enabled by default because it is generally a good strategy |
1167 | - for repeated accesses. |
1168 | - |
1169 | - Large, multiple-column indexes may cause the WHERE clause to be complex enough |
1170 | - that this could actually be less efficient. Consider for example a four-column |
1171 | - PRIMARY KEY on (a, b, c, d). The WHERE clause to start where the last query |
1172 | - ended is as follows: |
1173 | - |
1174 | - |
1175 | - .. code-block:: perl |
1176 | - |
1177 | - WHERE (a > ?) |
1178 | - OR (a = ? AND b > ?) |
1179 | - OR (a = ? AND b = ? AND c > ?) |
1180 | - OR (a = ? AND b = ? AND c = ? AND d >= ?) |
1181 | - |
1182 | - |
1183 | - Populating the placeholders with values uses memory and CPU, adds network |
1184 | - traffic and parsing overhead, and may make the query harder for MySQL to |
1185 | - optimize. A four-column key isn't a big deal, but a ten-column key in which |
1186 | - every column allows \ ``NULL``\ might be. |
1187 | - |
1188 | - Ascending the index might not be necessary if you know you are simply removing |
1189 | - rows from the beginning of the table in chunks, but not leaving any holes, so |
1190 | - starting at the beginning of the table is actually the most efficient thing to |
1191 | - do. |
1192 | - |
1193 | - See also "--ascend-first". See "EXTENDING" for a discussion of how this |
1194 | - interacts with plugins. |
1195 | - |
1196 | - |
1197 | - |
1198 | ---no-delete |
1199 | - |
1200 | - Do not delete archived rows. |
1201 | - |
1202 | - Causes \ ``pt-archiver``\ not to delete rows after processing them. This disallows |
1203 | - "--no-ascend", because enabling them both would cause an infinite loop. |
1204 | - |
1205 | - If there is a plugin on the source DSN, its \ ``before_delete``\ method is called |
1206 | - anyway, even though \ ``pt-archiver``\ will not execute the delete. See |
1207 | - "EXTENDING" for more on plugins. |
1208 | - |
1209 | - |
1210 | - |
1211 | ---optimize |
1212 | - |
1213 | - type: string |
1214 | - |
1215 | - Run OPTIMIZE TABLE afterwards on "--source" and/or "--dest". |
1216 | - |
1217 | - Runs OPTIMIZE TABLE after finishing. See "--analyze" for the option syntax |
1218 | - and `http://dev.mysql.com/doc/en/optimize-table.html <http://dev.mysql.com/doc/en/optimize-table.html>`_ for details on OPTIMIZE |
1219 | - TABLE. |
1220 | - |
1221 | - |
1222 | - |
1223 | ---password |
1224 | - |
1225 | - short form: -p; type: string |
1226 | - |
1227 | - Password to use when connecting. |
1228 | - |
1229 | - |
1230 | - |
1231 | ---pid |
1232 | - |
1233 | - type: string |
1234 | - |
1235 | - Create the given PID file when daemonized. The file contains the process ID of |
1236 | - the daemonized instance. The PID file is removed when the daemonized instance |
1237 | - exits. The program checks for the existence of the PID file when starting; if |
1238 | - it exists and the process with the matching PID exists, the program exits. |
1239 | - |
1240 | - |
1241 | - |
1242 | ---plugin |
1243 | - |
1244 | - type: string |
1245 | - |
1246 | - Perl module name to use as a generic plugin. |
1247 | - |
1248 | - Specify the Perl module name of a general-purpose plugin. It is currently used |
1249 | - only for statistics (see "--statistics") and must have \ ``new()``\ and a |
1250 | - \ ``statistics()``\ method. |
1251 | - |
1252 | - The \ ``new( src =``\ $src, dst => $dst, opts => $o )> method gets the source |
1253 | - and destination DSNs, and their database connections, just like the |
1254 | - connection-specific plugins do. It also gets an OptionParser object (\ ``$o``\ ) for |
1255 | - accessing command-line options (example: \ ``$o-``\ get('purge');>). |
1256 | - |
1257 | - The \ ``statistics(\%stats, $time)``\ method gets a hashref of the statistics |
1258 | - collected by the archiving job, and the time the whole job started. |
1259 | - |
1260 | - |
1261 | - |
1262 | ---port |
1263 | - |
1264 | - short form: -P; type: int |
1265 | - |
1266 | - Port number to use for connection. |
1267 | - |
1268 | - |
1269 | - |
1270 | ---primary-key-only |
1271 | - |
1272 | - Primary key columns only. |
1273 | - |
1274 | - A shortcut for specifying "--columns" with the primary key columns. This is |
1275 | - an efficiency if you just want to purge rows; it avoids fetching the entire row, |
1276 | - when only the primary key columns are needed for \ ``DELETE``\ statements. See also |
1277 | - "--purge". |
1278 | - |
1279 | - |
1280 | - |
1281 | ---progress |
1282 | - |
1283 | - type: int |
1284 | - |
1285 | - Print progress information every X rows. |
1286 | - |
1287 | - Prints current time, elapsed time, and rows archived every X rows. |
1288 | - |
1289 | - |
1290 | - |
1291 | ---purge |
1292 | - |
1293 | - Purge instead of archiving; allows omitting "--file" and "--dest". |
1294 | - |
1295 | - Allows archiving without a "--file" or "--dest" argument, which is |
1296 | - effectively a purge since the rows are just deleted. |
1297 | - |
1298 | - If you just want to purge rows, consider specifying the table's primary key |
1299 | - columns with "--primary-key-only". This will prevent fetching all columns |
1300 | - from the server for no reason. |
1301 | - |
1302 | - |
1303 | - |
1304 | ---quick-delete |
1305 | - |
1306 | - Adds the QUICK modifier to DELETE statements. |
1307 | - |
1308 | - See `http://dev.mysql.com/doc/en/delete.html <http://dev.mysql.com/doc/en/delete.html>`_ for details. As stated in the |
1309 | - documentation, in some cases it may be faster to use DELETE QUICK followed by |
1310 | - OPTIMIZE TABLE. You can use "--optimize" for this. |
1311 | - |
1312 | - |
1313 | - |
1314 | ---quiet |
1315 | - |
1316 | - short form: -q |
1317 | - |
1318 | - Do not print any output, such as for "--statistics". |
1319 | - |
1320 | - Suppresses normal output, including the output of "--statistics", but doesn't |
1321 | - suppress the output from "--why-quit". |
1322 | - |
1323 | - |
1324 | - |
1325 | ---replace |
1326 | - |
1327 | - Causes INSERTs into "--dest" to be written as REPLACE. |
1328 | - |
1329 | - |
1330 | - |
1331 | ---retries |
1332 | - |
1333 | - type: int; default: 1 |
1334 | - |
1335 | - Number of retries per timeout or deadlock. |
1336 | - |
1337 | - Specifies the number of times pt-archiver should retry when there is an |
1338 | - InnoDB lock wait timeout or deadlock. When retries are exhausted, |
1339 | - pt-archiver will exit with an error. |
1340 | - |
1341 | - Consider carefully what you want to happen when you are archiving between a |
1342 | - mixture of transactional and non-transactional storage engines. The INSERT to |
1343 | - "--dest" and DELETE from "--source" are on separate connections, so they |
1344 | - do not actually participate in the same transaction even if they're on the same |
1345 | - server. However, pt-archiver implements simple distributed transactions in |
1346 | - code, so commits and rollbacks should happen as desired across the two |
1347 | - connections. |
1348 | - |
1349 | - At this time I have not written any code to handle errors with transactional |
1350 | - storage engines other than InnoDB. Request that feature if you need it. |
1351 | - |
1352 | - |
1353 | - |
1354 | ---run-time |
1355 | - |
1356 | - type: time |
1357 | - |
1358 | - Time to run before exiting. |
1359 | - |
1360 | - Optional suffix s=seconds, m=minutes, h=hours, d=days; if no suffix, s is used. |
1361 | - |
1362 | - |
1363 | - |
1364 | ---[no]safe-auto-increment |
1365 | - |
1366 | - default: yes |
1367 | - |
1368 | - Do not archive row with max AUTO_INCREMENT. |
1369 | - |
1370 | - Adds an extra WHERE clause to prevent pt-archiver from removing the newest |
1371 | - row when ascending a single-column AUTO_INCREMENT key. This guards against |
1372 | - re-using AUTO_INCREMENT values if the server restarts, and is enabled by |
1373 | - default. |
1374 | - |
1375 | - The extra WHERE clause contains the maximum value of the auto-increment column |
1376 | - as of the beginning of the archive or purge job. If new rows are inserted while |
1377 | - pt-archiver is running, it will not see them. |
1378 | - |
1379 | - |
1380 | - |
1381 | ---sentinel |
1382 | - |
1383 | - type: string; default: /tmp/pt-archiver-sentinel |
1384 | - |
1385 | - Exit if this file exists. |
1386 | - |
1387 | - The presence of the file specified by "--sentinel" will cause pt-archiver to |
1388 | - stop archiving and exit. The default is /tmp/pt-archiver-sentinel. You |
1389 | - might find this handy to stop cron jobs gracefully if necessary. See also |
1390 | - "--stop". |
1391 | - |
1392 | - |
1393 | - |
1394 | ---set-vars |
1395 | - |
1396 | - type: string; default: wait_timeout=10000 |
1397 | - |
1398 | - Set these MySQL variables. |
1399 | - |
1400 | - Specify any variables you want to be set immediately after connecting to MySQL. |
1401 | - These will be included in a \ ``SET``\ command. |
1402 | - |
1403 | - |
1404 | - |
1405 | ---share-lock |
1406 | - |
1407 | - Adds the LOCK IN SHARE MODE modifier to SELECT statements. |
1408 | - |
1409 | - See `http://dev.mysql.com/doc/en/innodb-locking-reads.html <http://dev.mysql.com/doc/en/innodb-locking-reads.html>`_. |
1410 | - |
1411 | - |
1412 | - |
1413 | ---skip-foreign-key-checks |
1414 | - |
1415 | - Disables foreign key checks with SET FOREIGN_KEY_CHECKS=0. |
1416 | - |
1417 | - |
1418 | - |
1419 | ---sleep |
1420 | - |
1421 | - type: int |
1422 | - |
1423 | - Sleep time between fetches. |
1424 | - |
1425 | - Specifies how long to sleep between SELECT statements. Default is not to |
1426 | - sleep at all. Transactions are NOT committed, and the "--file" file is NOT |
1427 | - flushed, before sleeping. See "--txn-size" to control that. |
1428 | - |
1429 | - If "--commit-each" is specified, committing and flushing happens before |
1430 | - sleeping. |
1431 | - |
1432 | - |
1433 | - |
1434 | ---sleep-coef |
1435 | - |
1436 | - type: float |
1437 | - |
1438 | - Calculate "--sleep" as a multiple of the last SELECT time. |
1439 | - |
1440 | - If this option is specified, pt-archiver will sleep for the query time of the |
1441 | - last SELECT multiplied by the specified coefficient. |
1442 | - |
1443 | - This is a slightly more sophisticated way to throttle the SELECTs: sleep a |
1444 | - varying amount of time between each SELECT, depending on how long the SELECTs |
1445 | - are taking. |
1446 | - |
1447 | - |
1448 | - |
1449 | ---socket |
1450 | - |
1451 | - short form: -S; type: string |
1452 | - |
1453 | - Socket file to use for connection. |
1454 | - |
1455 | - |
1456 | - |
1457 | ---source |
1458 | - |
1459 | - type: DSN |
1460 | - |
1461 | - DSN specifying the table to archive from (required). This argument is a DSN. |
1462 | - See DSN OPTIONS for the syntax. Most options control how pt-archiver |
1463 | - connects to MySQL, but there are some extended DSN options in this tool's |
1464 | - syntax. The D, t, and i options select a table to archive: |
1465 | - |
1466 | - |
1467 | - .. code-block:: perl |
1468 | - |
1469 | - --source h=my_server,D=my_database,t=my_tbl |
1470 | - |
1471 | - |
1472 | - The a option specifies the database to set as the connection's default with USE. |
1473 | - If the b option is true, it disables binary logging with SQL_LOG_BIN. The m |
1474 | - option specifies pluggable actions, which an external Perl module can provide. |
1475 | - The only required part is the table; other parts may be read from various |
1476 | - places in the environment (such as options files). |
1477 | - |
1478 | - The 'i' part deserves special mention. This tells pt-archiver which index |
1479 | - it should scan to archive. This appears in a FORCE INDEX or USE INDEX hint in |
1480 | - the SELECT statements used to fetch archivable rows. If you don't specify |
1481 | - anything, pt-archiver will auto-discover a good index, preferring a \ ``PRIMARY |
1482 | - KEY``\ if one exists. In my experience this usually works well, so most of the |
1483 | - time you can probably just omit the 'i' part. |
1484 | - |
1485 | - The index is used to optimize repeated accesses to the table; pt-archiver |
1486 | - remembers the last row it retrieves from each SELECT statement, and uses it to |
1487 | - construct a WHERE clause, using the columns in the specified index, that should |
1488 | - allow MySQL to start the next SELECT where the last one ended, rather than |
1489 | - potentially scanning from the beginning of the table with each successive |
1490 | - SELECT. If you are using external plugins, please see "EXTENDING" for a |
1491 | - discussion of how they interact with ascending indexes. |
1492 | - |
1493 | - The 'a' and 'b' options allow you to control how statements flow through the |
1494 | - binary log. If you specify the 'b' option, binary logging will be disabled on |
1495 | - the specified connection. If you specify the 'a' option, the connection will |
1496 | - \ ``USE``\ the specified database, which you can use to prevent slaves from |
1497 | - executing the binary log events with \ ``--replicate-ignore-db``\ options. These |
1498 | - two options can be used as different methods to achieve the same goal: archive |
1499 | - data off the master, but leave it on the slave. For example, you can run a |
1500 | - purge job on the master and prevent it from happening on the slave using your |
1501 | - method of choice. |
1502 | - |
1503 | - \ **WARNING**\ : Using a default options file (F) DSN option that defines a |
1504 | - socket for "--source" causes pt-archiver to connect to "--dest" using |
1505 | - that socket unless another socket for "--dest" is specified. This |
1506 | - means that pt-archiver may incorrectly connect to "--source" when it |
1507 | - is meant to connect to "--dest". For example: |
1508 | - |
1509 | - |
1510 | - .. code-block:: perl |
1511 | - |
1512 | - --source F=host1.cnf,D=db,t=tbl --dest h=host2 |
1513 | - |
1514 | - |
1515 | - When pt-archiver connects to "--dest", host2, it will connect via the |
1516 | - "--source", host1, socket defined in host1.cnf. |
1517 | - |
1518 | - |
1519 | - |
1520 | ---statistics |
1521 | - |
1522 | - Collect and print timing statistics. |
1523 | - |
1524 | - Causes pt-archiver to collect timing statistics about what it does. These |
1525 | - statistics are available to the plugin specified by "--plugin" |
1526 | - |
1527 | - Unless you specify "--quiet", \ ``pt-archiver``\ prints the statistics when it |
1528 | - exits. The statistics look like this: |
1529 | - |
1530 | - |
1531 | - .. code-block:: perl |
1532 | - |
1533 | - Started at 2008-07-18T07:18:53, ended at 2008-07-18T07:18:53 |
1534 | - Source: D=db,t=table |
1535 | - SELECT 4 |
1536 | - INSERT 4 |
1537 | - DELETE 4 |
1538 | - Action Count Time Pct |
1539 | - commit 10 0.1079 88.27 |
1540 | - select 5 0.0047 3.87 |
1541 | - deleting 4 0.0028 2.29 |
1542 | - inserting 4 0.0028 2.28 |
1543 | - other 0 0.0040 3.29 |
1544 | - |
1545 | - |
1546 | - The first two (or three) lines show times and the source and destination tables. |
1547 | - The next three lines show how many rows were fetched, inserted, and deleted. |
1548 | - |
1549 | - The remaining lines show counts and timing. The columns are the action, the |
1550 | - total number of times that action was timed, the total time it took, and the |
1551 | - percent of the program's total runtime. The rows are sorted in order of |
1552 | - descending total time. The last row is the rest of the time not explicitly |
1553 | - attributed to anything. Actions will vary depending on command-line options. |
1554 | - |
1555 | - If "--why-quit" is given, its behavior is changed slightly. This option |
1556 | - causes it to print the reason for exiting even when it's just because there are |
1557 | - no more rows. |
1558 | - |
1559 | - This option requires the standard Time::HiRes module, which is part of core Perl |
1560 | - on reasonably new Perl releases. |
1561 | - |
1562 | - |
1563 | - |
1564 | ---stop |
1565 | - |
1566 | - Stop running instances by creating the sentinel file. |
1567 | - |
1568 | - Causes pt-archiver to create the sentinel file specified by "--sentinel" and |
1569 | - exit. This should have the effect of stopping all running instances which are |
1570 | - watching the same sentinel file. |
1571 | - |
1572 | - |
1573 | - |
1574 | ---txn-size |
1575 | - |
1576 | - type: int; default: 1 |
1577 | - |
1578 | - Number of rows per transaction. |
1579 | - |
1580 | - Specifies the size, in number of rows, of each transaction. Zero disables |
1581 | - transactions altogether. After pt-archiver processes this many rows, it |
1582 | - commits both the "--source" and the "--dest" if given, and flushes the |
1583 | - file given by "--file". |
1584 | - |
1585 | - This parameter is critical to performance. If you are archiving from a live |
1586 | - server, which for example is doing heavy OLTP work, you need to choose a good |
1587 | - balance between transaction size and commit overhead. Larger transactions |
1588 | - create the possibility of more lock contention and deadlocks, but smaller |
1589 | - transactions cause more frequent commit overhead, which can be significant. To |
1590 | - give an idea, on a small test set I worked with while writing pt-archiver, a |
1591 | - value of 500 caused archiving to take about 2 seconds per 1000 rows on an |
1592 | - otherwise quiet MySQL instance on my desktop machine, archiving to disk and to |
1593 | - another table. Disabling transactions with a value of zero, which turns on |
1594 | - autocommit, dropped performance to 38 seconds per thousand rows. |
1595 | - |
1596 | - If you are not archiving from or to a transactional storage engine, you may |
1597 | - want to disable transactions so pt-archiver doesn't try to commit. |
1598 | - |
1599 | - |
1600 | - |
1601 | ---user |
1602 | - |
1603 | - short form: -u; type: string |
1604 | - |
1605 | - User for login if not current user. |
1606 | - |
1607 | - |
1608 | - |
1609 | ---version |
1610 | - |
1611 | - Show version and exit. |
1612 | - |
1613 | - |
1614 | - |
1615 | ---where |
1616 | - |
1617 | - type: string |
1618 | - |
1619 | - WHERE clause to limit which rows to archive (required). |
1620 | - |
1621 | - Specifies a WHERE clause to limit which rows are archived. Do not include the |
1622 | - word WHERE. You may need to quote the argument to prevent your shell from |
1623 | - interpreting it. For example: |
1624 | - |
1625 | - |
1626 | - .. code-block:: perl |
1627 | - |
1628 | - --where 'ts < current_date - interval 90 day' |
1629 | - |
1630 | - |
1631 | - For safety, "--where" is required. If you do not require a WHERE clause, use |
1632 | - "--where" 1=1. |
1633 | - |
1634 | - |
1635 | - |
1636 | ---why-quit |
1637 | - |
1638 | - Print reason for exiting unless rows exhausted. |
1639 | - |
1640 | - Causes pt-archiver to print a message if it exits for any reason other than |
1641 | - running out of rows to archive. This can be useful if you have a cron job with |
1642 | - "--run-time" specified, for example, and you want to be sure pt-archiver is |
1643 | - finishing before running out of time. |
1644 | - |
1645 | - If "--statistics" is given, the behavior is changed slightly. It will print |
1646 | - the reason for exiting even when it's just because there are no more rows. |
1647 | - |
1648 | - This output prints even if "--quiet" is given. That's so you can put |
1649 | - \ ``pt-archiver``\ in a \ ``cron``\ job and get an email if there's an abnormal exit. |
1650 | - |
1651 | - |
1652 | - |
1653 | - |
1654 | -*********** |
1655 | -DSN OPTIONS |
1656 | -*********** |
1657 | - |
1658 | - |
1659 | -These DSN options are used to create a DSN. Each option is given like |
1660 | -\ ``option=value``\ . The options are case-sensitive, so P and p are not the |
1661 | -same option. There cannot be whitespace before or after the \ ``=``\ and |
1662 | -if the value contains whitespace it must be quoted. DSN options are |
1663 | -comma-separated. See the percona-toolkit manpage for full details. |
1664 | - |
1665 | - |
1666 | -\* a |
1667 | - |
1668 | - copy: no |
1669 | - |
1670 | - Database to USE when executing queries. |
1671 | - |
1672 | - |
1673 | - |
1674 | -\* A |
1675 | - |
1676 | - dsn: charset; copy: yes |
1677 | - |
1678 | - Default character set. |
1679 | - |
1680 | - |
1681 | - |
1682 | -\* b |
1683 | - |
1684 | - copy: no |
1685 | - |
1686 | - If true, disable binlog with SQL_LOG_BIN. |
1687 | - |
1688 | - |
1689 | - |
1690 | -\* D |
1691 | - |
1692 | - dsn: database; copy: yes |
1693 | - |
1694 | - Database that contains the table. |
1695 | - |
1696 | - |
1697 | - |
1698 | -\* F |
1699 | - |
1700 | - dsn: mysql_read_default_file; copy: yes |
1701 | - |
1702 | - Only read default options from the given file |
1703 | - |
1704 | - |
1705 | - |
1706 | -\* h |
1707 | - |
1708 | - dsn: host; copy: yes |
1709 | - |
1710 | - Connect to host. |
1711 | - |
1712 | - |
1713 | - |
1714 | -\* i |
1715 | - |
1716 | - copy: yes |
1717 | - |
1718 | - Index to use. |
1719 | - |
1720 | - |
1721 | - |
1722 | -\* m |
1723 | - |
1724 | - copy: no |
1725 | - |
1726 | - Plugin module name. |
1727 | - |
1728 | - |
1729 | - |
1730 | -\* p |
1731 | - |
1732 | - dsn: password; copy: yes |
1733 | - |
1734 | - Password to use when connecting. |
1735 | - |
1736 | - |
1737 | - |
1738 | -\* P |
1739 | - |
1740 | - dsn: port; copy: yes |
1741 | - |
1742 | - Port number to use for connection. |
1743 | - |
1744 | - |
1745 | - |
1746 | -\* S |
1747 | - |
1748 | - dsn: mysql_socket; copy: yes |
1749 | - |
1750 | - Socket file to use for connection. |
1751 | - |
1752 | - |
1753 | - |
1754 | -\* t |
1755 | - |
1756 | - copy: yes |
1757 | - |
1758 | - Table to archive from/to. |
1759 | - |
1760 | - |
1761 | - |
1762 | -\* u |
1763 | - |
1764 | - dsn: user; copy: yes |
1765 | - |
1766 | - User for login if not current user. |
1767 | - |
1768 | - |
1769 | - |
1770 | - |
1771 | -********* |
1772 | -EXTENDING |
1773 | -********* |
1774 | - |
1775 | - |
1776 | -pt-archiver is extensible by plugging in external Perl modules to handle some |
1777 | -logic and/or actions. You can specify a module for both the "--source" and |
1778 | -the "--dest", with the 'm' part of the specification. For example: |
1779 | - |
1780 | - |
1781 | -.. code-block:: perl |
1782 | - |
1783 | - --source D=test,t=test1,m=My::Module1 --dest m=My::Module2,t=test2 |
1784 | - |
1785 | - |
1786 | -This will cause pt-archiver to load the My::Module1 and My::Module2 packages, |
1787 | -create instances of them, and then make calls to them during the archiving |
1788 | -process. |
1789 | - |
1790 | -You can also specify a plugin with "--plugin". |
1791 | - |
1792 | -The module must provide this interface: |
1793 | - |
1794 | - |
1795 | -new(dbh => $dbh, db => $db_name, tbl => $tbl_name) |
1796 | - |
1797 | - The plugin's constructor is passed a reference to the database handle, the |
1798 | - database name, and table name. The plugin is created just after pt-archiver |
1799 | - opens the connection, and before it examines the table given in the arguments. |
1800 | - This gives the plugin a chance to create and populate temporary tables, or do |
1801 | - other setup work. |
1802 | - |
1803 | - |
1804 | - |
1805 | -before_begin(cols => \@cols, allcols => \@allcols) |
1806 | - |
1807 | - This method is called just before pt-archiver begins iterating through rows |
1808 | - and archiving them, but after it does all other setup work (examining table |
1809 | - structures, designing SQL queries, and so on). This is the only time |
1810 | - pt-archiver tells the plugin column names for the rows it will pass the |
1811 | - plugin while archiving. |
1812 | - |
1813 | - The \ ``cols``\ argument is the column names the user requested to be archived, |
1814 | - either by default or by the "--columns" option. The \ ``allcols``\ argument is |
1815 | - the list of column names for every row pt-archiver will fetch from the source |
1816 | - table. It may fetch more columns than the user requested, because it needs some |
1817 | - columns for its own use. When subsequent plugin functions receive a row, it is |
1818 | - the full row containing all the extra columns, if any, added to the end. |
1819 | - |
1820 | - |
1821 | - |
1822 | -is_archivable(row => \@row) |
1823 | - |
1824 | - This method is called for each row to determine whether it is archivable. This |
1825 | - applies only to "--source". The argument is the row itself, as an arrayref. |
1826 | - If the method returns true, the row will be archived; otherwise it will be |
1827 | - skipped. |
1828 | - |
1829 | - Skipping a row adds complications for non-unique indexes. Normally |
1830 | - pt-archiver uses a WHERE clause designed to target the last processed row as |
1831 | - the place to start the scan for the next SELECT statement. If you have skipped |
1832 | - the row by returning false from is_archivable(), pt-archiver could get into |
1833 | - an infinite loop because the row still exists. Therefore, when you specify a |
1834 | - plugin for the "--source" argument, pt-archiver will change its WHERE clause |
1835 | - slightly. Instead of starting at "greater than or equal to" the last processed |
1836 | - row, it will start "strictly greater than." This will work fine on unique |
1837 | - indexes such as primary keys, but it may skip rows (leave holes) on non-unique |
1838 | - indexes or when ascending only the first column of an index. |
1839 | - |
1840 | - \ ``pt-archiver``\ will change the clause in the same way if you specify |
1841 | - "--no-delete", because again an infinite loop is possible. |
1842 | - |
1843 | - If you specify the "--bulk-delete" option and return false from this method, |
1844 | - \ ``pt-archiver``\ may not do what you want. The row won't be archived, but it will |
1845 | - be deleted, since bulk deletes operate on ranges of rows and don't know which |
1846 | - rows the plugin selected to keep. |
1847 | - |
1848 | - If you specify the "--bulk-insert" option, this method's return value will |
1849 | - influence whether the row is written to the temporary file for the bulk insert, |
1850 | - so bulk inserts will work as expected. However, bulk inserts require bulk |
1851 | - deletes. |
1852 | - |
1853 | - |
1854 | - |
1855 | -before_delete(row => \@row) |
1856 | - |
1857 | - This method is called for each row just before it is deleted. This applies only |
1858 | - to "--source". This is a good place for you to handle dependencies, such as |
1859 | - deleting things that are foreign-keyed to the row you are about to delete. You |
1860 | - could also use this to recursively archive all dependent tables. |
1861 | - |
1862 | - This plugin method is called even if "--no-delete" is given, but not if |
1863 | - "--bulk-delete" is given. |
1864 | - |
1865 | - |
1866 | - |
1867 | -before_bulk_delete(first_row => \@row, last_row => \@row) |
1868 | - |
1869 | - This method is called just before a bulk delete is executed. It is similar to |
1870 | - the \ ``before_delete``\ method, except its arguments are the first and last row of |
1871 | - the range to be deleted. It is called even if "--no-delete" is given. |
1872 | - |
1873 | - |
1874 | - |
1875 | -before_insert(row => \@row) |
1876 | - |
1877 | - This method is called for each row just before it is inserted. This applies |
1878 | - only to "--dest". You could use this to insert the row into multiple tables, |
1879 | - perhaps with an ON DUPLICATE KEY UPDATE clause to build summary tables in a data |
1880 | - warehouse. |
1881 | - |
1882 | - This method is not called if "--bulk-insert" is given. |
1883 | - |
1884 | - |
1885 | - |
1886 | -before_bulk_insert(first_row => \@row, last_row => \@row, filename => bulk_insert_filename) |
1887 | - |
1888 | - This method is called just before a bulk insert is executed. It is similar to |
1889 | - the \ ``before_insert``\ method, except its arguments are the first and last row of |
1890 | - the range to be deleted. |
1891 | - |
1892 | - |
1893 | - |
1894 | -custom_sth(row => \@row, sql => $sql) |
1895 | - |
1896 | - This method is called just before inserting the row, but after |
1897 | - "before_insert()". It allows the plugin to specify different \ ``INSERT``\ |
1898 | - statement if desired. The return value (if any) should be a DBI statement |
1899 | - handle. The \ ``sql``\ parameter is the SQL text used to prepare the default |
1900 | - \ ``INSERT``\ statement. This method is not called if you specify |
1901 | - "--bulk-insert". |
1902 | - |
1903 | - If no value is returned, the default \ ``INSERT``\ statement handle is used. |
1904 | - |
1905 | - This method applies only to the plugin specified for "--dest", so if your |
1906 | - plugin isn't doing what you expect, check that you've specified it for the |
1907 | - destination and not the source. |
1908 | - |
1909 | - |
1910 | - |
1911 | -custom_sth_bulk(first_row => \@row, last_row => \@row, sql => $sql, filename => $bulk_insert_filename) |
1912 | - |
1913 | - If you've specified "--bulk-insert", this method is called just before the |
1914 | - bulk insert, but after "before_bulk_insert()", and the arguments are |
1915 | - different. |
1916 | - |
1917 | - This method's return value etc is similar to the "custom_sth()" method. |
1918 | - |
1919 | - |
1920 | - |
1921 | -after_finish() |
1922 | - |
1923 | - This method is called after pt-archiver exits the archiving loop, commits all |
1924 | - database handles, closes "--file", and prints the final statistics, but |
1925 | - before pt-archiver runs ANALYZE or OPTIMIZE (see "--analyze" and |
1926 | - "--optimize"). |
1927 | - |
1928 | - |
1929 | - |
1930 | -If you specify a plugin for both "--source" and "--dest", pt-archiver |
1931 | -constructs, calls before_begin(), and calls after_finish() on the two plugins in |
1932 | -the order "--source", "--dest". |
1933 | - |
1934 | -pt-archiver assumes it controls transactions, and that the plugin will NOT |
1935 | -commit or roll back the database handle. The database handle passed to the |
1936 | -plugin's constructor is the same handle pt-archiver uses itself. Remember |
1937 | -that "--source" and "--dest" are separate handles. |
1938 | - |
1939 | -A sample module might look like this: |
1940 | - |
1941 | - |
1942 | -.. code-block:: perl |
1943 | - |
1944 | - package My::Module; |
1945 | - |
1946 | - sub new { |
1947 | - my ( $class, %args ) = @_; |
1948 | - return bless(\%args, $class); |
1949 | - } |
1950 | - |
1951 | - sub before_begin { |
1952 | - my ( $self, %args ) = @_; |
1953 | - # Save column names for later |
1954 | - $self->{cols} = $args{cols}; |
1955 | - } |
1956 | - |
1957 | - sub is_archivable { |
1958 | - my ( $self, %args ) = @_; |
1959 | - # Do some advanced logic with $args{row} |
1960 | - return 1; |
1961 | - } |
1962 | - |
1963 | - sub before_delete {} # Take no action |
1964 | - sub before_insert {} # Take no action |
1965 | - sub custom_sth {} # Take no action |
1966 | - sub after_finish {} # Take no action |
1967 | - |
1968 | - 1; |
1969 | - |
1970 | - |
1971 | - |
1972 | -*********** |
1973 | -ENVIRONMENT |
1974 | -*********** |
1975 | - |
1976 | - |
1977 | -The environment variable \ ``PTDEBUG``\ enables verbose debugging output to STDERR. |
1978 | -To enable debugging and capture all output to a file, run the tool like: |
1979 | - |
1980 | - |
1981 | -.. code-block:: perl |
1982 | - |
1983 | - PTDEBUG=1 pt-archiver ... > FILE 2>&1 |
1984 | - |
1985 | - |
1986 | -Be careful: debugging output is voluminous and can generate several megabytes |
1987 | -of output. |
1988 | - |
1989 | - |
1990 | -******************* |
1991 | -SYSTEM REQUIREMENTS |
1992 | -******************* |
1993 | - |
1994 | - |
1995 | -You need Perl, DBI, DBD::mysql, and some core packages that ought to be |
1996 | -installed in any reasonably new version of Perl. |
1997 | - |
1998 | - |
1999 | -**** |
2000 | -BUGS |
2001 | -**** |
2002 | - |
2003 | - |
2004 | -For a list of known bugs, see `http://www.percona.com/bugs/pt-archiver <http://www.percona.com/bugs/pt-archiver>`_. |
2005 | - |
2006 | -Please report bugs at `https://bugs.launchpad.net/percona-toolkit <https://bugs.launchpad.net/percona-toolkit>`_. |
2007 | -Include the following information in your bug report: |
2008 | - |
2009 | - |
2010 | -\* Complete command-line used to run the tool |
2011 | - |
2012 | - |
2013 | - |
2014 | -\* Tool "--version" |
2015 | - |
2016 | - |
2017 | - |
2018 | -\* MySQL version of all servers involved |
2019 | - |
2020 | - |
2021 | - |
2022 | -\* Output from the tool including STDERR |
2023 | - |
2024 | - |
2025 | - |
2026 | -\* Input files (log/dump/config files, etc.) |
2027 | - |
2028 | - |
2029 | - |
2030 | -If possible, include debugging output by running the tool with \ ``PTDEBUG``\ ; |
2031 | -see "ENVIRONMENT". |
2032 | - |
2033 | - |
2034 | -*********** |
2035 | -DOWNLOADING |
2036 | -*********** |
2037 | - |
2038 | - |
2039 | -Visit `http://www.percona.com/software/percona-toolkit/ <http://www.percona.com/software/percona-toolkit/>`_ to download the |
2040 | -latest release of Percona Toolkit. Or, get the latest release from the |
2041 | -command line: |
2042 | - |
2043 | - |
2044 | -.. code-block:: perl |
2045 | - |
2046 | - wget percona.com/get/percona-toolkit.tar.gz |
2047 | - |
2048 | - wget percona.com/get/percona-toolkit.rpm |
2049 | - |
2050 | - wget percona.com/get/percona-toolkit.deb |
2051 | - |
2052 | - |
2053 | -You can also get individual tools from the latest release: |
2054 | - |
2055 | - |
2056 | -.. code-block:: perl |
2057 | - |
2058 | - wget percona.com/get/TOOL |
2059 | - |
2060 | - |
2061 | -Replace \ ``TOOL``\ with the name of any tool. |
2062 | - |
2063 | - |
2064 | -******* |
2065 | -AUTHORS |
2066 | -******* |
2067 | - |
2068 | - |
2069 | -Baron Schwartz |
2070 | - |
2071 | - |
2072 | -*************** |
2073 | -ACKNOWLEDGMENTS |
2074 | -*************** |
2075 | - |
2076 | - |
2077 | -Andrew O'Brien |
2078 | - |
2079 | - |
2080 | -********************* |
2081 | -ABOUT PERCONA TOOLKIT |
2082 | -********************* |
2083 | - |
2084 | - |
2085 | -This tool is part of Percona Toolkit, a collection of advanced command-line |
2086 | -tools developed by Percona for MySQL support and consulting. Percona Toolkit |
2087 | -was forked from two projects in June, 2011: Maatkit and Aspersa. Those |
2088 | -projects were created by Baron Schwartz and developed primarily by him and |
2089 | -Daniel Nichter, both of whom are employed by Percona. Visit |
2090 | -`http://www.percona.com/software/ <http://www.percona.com/software/>`_ for more software developed by Percona. |
2091 | - |
2092 | - |
2093 | -******************************** |
2094 | -COPYRIGHT, LICENSE, AND WARRANTY |
2095 | -******************************** |
2096 | - |
2097 | - |
2098 | -This program is copyright 2007-2011 Baron Schwartz, 2011 Percona Inc. |
2099 | -Feedback and improvements are welcome. |
2100 | - |
2101 | -THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
2102 | -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
2103 | -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
2104 | - |
2105 | -This program is free software; you can redistribute it and/or modify it under |
2106 | -the terms of the GNU General Public License as published by the Free Software |
2107 | -Foundation, version 2; OR the Perl Artistic License. On UNIX and similar |
2108 | -systems, you can issue \`man perlgpl' or \`man perlartistic' to read these |
2109 | -licenses. |
2110 | - |
2111 | -You should have received a copy of the GNU General Public License along with |
2112 | -this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
2113 | -Place, Suite 330, Boston, MA 02111-1307 USA. |
2114 | - |
2115 | - |
2116 | -******* |
2117 | -VERSION |
2118 | -******* |
2119 | - |
2120 | - |
2121 | -pt-archiver 1.0.1 |
2122 | - |
2123 | |
2124 | === removed file 'docs/user/pt-collect.rst' |
2125 | --- docs/user/pt-collect.rst 2011-09-01 16:00:38 +0000 |
2126 | +++ docs/user/pt-collect.rst 1970-01-01 00:00:00 +0000 |
2127 | @@ -1,264 +0,0 @@ |
2128 | - |
2129 | -########## |
2130 | -pt-collect |
2131 | -########## |
2132 | - |
2133 | -.. highlight:: perl |
2134 | - |
2135 | - |
2136 | -**** |
2137 | -NAME |
2138 | -**** |
2139 | - |
2140 | - |
2141 | -pt-collect - Collect information from a server for some period of time. |
2142 | - |
2143 | - |
2144 | -******** |
2145 | -SYNOPSIS |
2146 | -******** |
2147 | - |
2148 | - |
2149 | -Usage: pt-collect -d -g -i -o -s [OPTIONS] [-- MYSQL-OPTIONS] |
2150 | - |
2151 | -pt-collect tool gathers a variety of information about a system for a period |
2152 | -of time. It is typically executed when the stalk tool detects a condition |
2153 | -and wants to collect information to assist in diagnosis. Four options |
2154 | -must be specified on the command line: -dgios. |
2155 | - |
2156 | - |
2157 | -***** |
2158 | -RISKS |
2159 | -***** |
2160 | - |
2161 | - |
2162 | -The following section is included to inform users about the potential risks, |
2163 | -whether known or unknown, of using this tool. The two main categories of risks |
2164 | -are those created by the nature of the tool (e.g. read-only tools vs. read-write |
2165 | -tools) and those created by bugs. |
2166 | - |
2167 | -pt-collect is a read-only tool. It should be very low-risk. |
2168 | - |
2169 | -At the time of this release, we know of no bugs that could cause serious harm |
2170 | -to users. |
2171 | - |
2172 | -The authoritative source for updated information is always the online issue |
2173 | -tracking system. Issues that affect this tool will be marked as such. You can |
2174 | -see a list of such issues at the following URL: |
2175 | -`http://www.percona.com/bugs/pt-collect <http://www.percona.com/bugs/pt-collect>`_. |
2176 | - |
2177 | -See also "BUGS" for more information on filing bugs and getting help. |
2178 | - |
2179 | - |
2180 | -*********** |
2181 | -DESCRIPTION |
2182 | -*********** |
2183 | - |
2184 | - |
2185 | -pt-collect creates a lock to ensure that only one instance runs at a time, |
2186 | -and then saves a variety of performance and status data into files in the |
2187 | -configured directory. Files are named with a timestamp so they can be |
2188 | -grouped together. The tool is MySQL-centric by default, and gathers quite |
2189 | -a bit of diagnostic data that's useful for understanding the behavior of |
2190 | -a MySQL database server. |
2191 | - |
2192 | -Options after \ ``--``\ are passed to \ ``mysql``\ and \ ``mysqladmin``\ . |
2193 | - |
2194 | - |
2195 | -******* |
2196 | -OPTIONS |
2197 | -******* |
2198 | - |
2199 | - |
2200 | - |
2201 | --d (required) |
2202 | - |
2203 | - DESTINATION Where to store the resulting data; must already exist. |
2204 | - |
2205 | - |
2206 | - |
2207 | --g <yes/no> (required) |
2208 | - |
2209 | - Collect GDB stack traces. |
2210 | - |
2211 | - |
2212 | - |
2213 | --i INTERVAL (required) |
2214 | - |
2215 | - How many seconds to collect data. |
2216 | - |
2217 | - |
2218 | - |
2219 | --o <yes/no> (required) |
2220 | - |
2221 | - Collect oprofile data; disables -s. |
2222 | - |
2223 | - |
2224 | - |
2225 | --s <yes/no> (required) |
2226 | - |
2227 | - Collect strace data. |
2228 | - |
2229 | - |
2230 | - |
2231 | --f PERCENT |
2232 | - |
2233 | - Exit if the disk is more than this percent full (default 100). |
2234 | - |
2235 | - |
2236 | - |
2237 | --m MEGABYTES |
2238 | - |
2239 | - Exit if there are less than this many megabytes free disk space (default 0). |
2240 | - |
2241 | - |
2242 | - |
2243 | --p PREFIX |
2244 | - |
2245 | - Store the data into files with this prefix (optional). |
2246 | - |
2247 | - |
2248 | - |
2249 | --t <yes/no> |
2250 | - |
2251 | - Collect tcpdump data. |
2252 | - |
2253 | - |
2254 | - |
2255 | - |
2256 | -*********** |
2257 | -ENVIRONMENT |
2258 | -*********** |
2259 | - |
2260 | - |
2261 | -This tool does not use any environment variables. |
2262 | - |
2263 | - |
2264 | -******************* |
2265 | -SYSTEM REQUIREMENTS |
2266 | -******************* |
2267 | - |
2268 | - |
2269 | -This tool requires Bash v3 or newer and assumes that these programs |
2270 | -are installed, in the PATH, and executable: sysctl, top, vmstat, iostat, |
2271 | -mpstat, lsof, mysql, mysqladmin, df, netstat, pidof, flock, and others |
2272 | -depending on what command-line options are specified. If some of those |
2273 | -programs are not available, the tool will still run but may print warnings. |
2274 | - |
2275 | - |
2276 | -**** |
2277 | -BUGS |
2278 | -**** |
2279 | - |
2280 | - |
2281 | -For a list of known bugs, see `http://www.percona.com/bugs/pt-collect <http://www.percona.com/bugs/pt-collect>`_. |
2282 | - |
2283 | -Please report bugs at `https://bugs.launchpad.net/percona-toolkit <https://bugs.launchpad.net/percona-toolkit>`_. |
2284 | -Include the following information in your bug report: |
2285 | - |
2286 | - |
2287 | -\* Complete command-line used to run the tool |
2288 | - |
2289 | - |
2290 | - |
2291 | -\* Tool "--version" |
2292 | - |
2293 | - |
2294 | - |
2295 | -\* MySQL version of all servers involved |
2296 | - |
2297 | - |
2298 | - |
2299 | -\* Output from the tool including STDERR |
2300 | - |
2301 | - |
2302 | - |
2303 | -\* Input files (log/dump/config files, etc.) |
2304 | - |
2305 | - |
2306 | - |
2307 | -If possible, include debugging output by running the tool with \ ``PTDEBUG``\ ; |
2308 | -see "ENVIRONMENT". |
2309 | - |
2310 | - |
2311 | -*********** |
2312 | -DOWNLOADING |
2313 | -*********** |
2314 | - |
2315 | - |
2316 | -Visit `http://www.percona.com/software/percona-toolkit/ <http://www.percona.com/software/percona-toolkit/>`_ to download the |
2317 | -latest release of Percona Toolkit. Or, get the latest release from the |
2318 | -command line: |
2319 | - |
2320 | - |
2321 | -.. code-block:: perl |
2322 | - |
2323 | - wget percona.com/get/percona-toolkit.tar.gz |
2324 | - |
2325 | - wget percona.com/get/percona-toolkit.rpm |
2326 | - |
2327 | - wget percona.com/get/percona-toolkit.deb |
2328 | - |
2329 | - |
2330 | -You can also get individual tools from the latest release: |
2331 | - |
2332 | - |
2333 | -.. code-block:: perl |
2334 | - |
2335 | - wget percona.com/get/TOOL |
2336 | - |
2337 | - |
2338 | -Replace \ ``TOOL``\ with the name of any tool. |
2339 | - |
2340 | - |
2341 | -******* |
2342 | -AUTHORS |
2343 | -******* |
2344 | - |
2345 | - |
2346 | -Baron Schwartz |
2347 | - |
2348 | - |
2349 | -********************* |
2350 | -ABOUT PERCONA TOOLKIT |
2351 | -********************* |
2352 | - |
2353 | - |
2354 | -This tool is part of Percona Toolkit, a collection of advanced command-line |
2355 | -tools developed by Percona for MySQL support and consulting. Percona Toolkit |
2356 | -was forked from two projects in June, 2011: Maatkit and Aspersa. Those |
2357 | -projects were created by Baron Schwartz and developed primarily by him and |
2358 | -Daniel Nichter, both of whom are employed by Percona. Visit |
2359 | -`http://www.percona.com/software/ <http://www.percona.com/software/>`_ for more software developed by Percona. |
2360 | - |
2361 | - |
2362 | -******************************** |
2363 | -COPYRIGHT, LICENSE, AND WARRANTY |
2364 | -******************************** |
2365 | - |
2366 | - |
2367 | -This program is copyright 2010-2011 Baron Schwartz, 2011 Percona Inc. |
2368 | -Feedback and improvements are welcome. |
2369 | - |
2370 | -THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
2371 | -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
2372 | -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
2373 | - |
2374 | -This program is free software; you can redistribute it and/or modify it under |
2375 | -the terms of the GNU General Public License as published by the Free Software |
2376 | -Foundation, version 2; OR the Perl Artistic License. On UNIX and similar |
2377 | -systems, you can issue \`man perlgpl' or \`man perlartistic' to read these |
2378 | -licenses. |
2379 | - |
2380 | -You should have received a copy of the GNU General Public License along with |
2381 | -this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
2382 | -Place, Suite 330, Boston, MA 02111-1307 USA. |
2383 | - |
2384 | - |
2385 | -******* |
2386 | -VERSION |
2387 | -******* |
2388 | - |
2389 | - |
2390 | -pt-collect 1.0.1 |
2391 | - |
2392 | |
2393 | === removed file 'docs/user/pt-config-diff.rst' |
2394 | --- docs/user/pt-config-diff.rst 2011-09-01 16:00:38 +0000 |
2395 | +++ docs/user/pt-config-diff.rst 1970-01-01 00:00:00 +0000 |
2396 | @@ -1,518 +0,0 @@ |
2397 | - |
2398 | -############## |
2399 | -pt-config-diff |
2400 | -############## |
2401 | - |
2402 | -.. highlight:: perl |
2403 | - |
2404 | - |
2405 | -**** |
2406 | -NAME |
2407 | -**** |
2408 | - |
2409 | - |
2410 | -pt-config-diff - Diff MySQL configuration files and server variables. |
2411 | - |
2412 | - |
2413 | -******** |
2414 | -SYNOPSIS |
2415 | -******** |
2416 | - |
2417 | - |
2418 | -Usage: pt-config-diff [OPTION...] CONFIG CONFIG [CONFIG...] |
2419 | - |
2420 | -pt-config-diff diffs MySQL configuration files and server variables. |
2421 | -CONFIG can be a filename or a DSN. At least two CONFIG sources must be given. |
2422 | -Like standard Unix diff, there is no output if there are no differences. |
2423 | - |
2424 | -Diff host1 config from SHOW VARIABLES against host2: |
2425 | - |
2426 | - |
2427 | -.. code-block:: perl |
2428 | - |
2429 | - pt-config-diff h=host1 h=host2 |
2430 | - |
2431 | - |
2432 | -Diff config from [mysqld] section in my.cnf against host1 config: |
2433 | - |
2434 | - |
2435 | -.. code-block:: perl |
2436 | - |
2437 | - pt-config-diff /etc/my.cnf h=host1 |
2438 | - |
2439 | - |
2440 | -Diff the [mysqld] section of two option files: |
2441 | - |
2442 | - |
2443 | -.. code-block:: perl |
2444 | - |
2445 | - pt-config-diff /etc/my-small.cnf /etc/my-large.cnf |
2446 | - |
2447 | - |
2448 | - |
2449 | -***** |
2450 | -RISKS |
2451 | -***** |
2452 | - |
2453 | - |
2454 | -The following section is included to inform users about the potential risks, |
2455 | -whether known or unknown, of using this tool. The two main categories of risks |
2456 | -are those created by the nature of the tool (e.g. read-only tools vs. read-write |
2457 | -tools) and those created by bugs. |
2458 | - |
2459 | -pt-config-diff reads MySQL's configuration and examines it and is thus very |
2460 | -low risk. |
2461 | - |
2462 | -At the time of this release there are no known bugs that pose a serious risk. |
2463 | - |
2464 | -The authoritative source for updated information is always the online issue |
2465 | -tracking system. Issues that affect this tool will be marked as such. You can |
2466 | -see a list of such issues at the following URL: |
2467 | -`http://www.percona.com/bugs/pt-config-diff <http://www.percona.com/bugs/pt-config-diff>`_. |
2468 | - |
2469 | -See also "BUGS" for more information on filing bugs and getting help. |
2470 | - |
2471 | - |
2472 | -*********** |
2473 | -DESCRIPTION |
2474 | -*********** |
2475 | - |
2476 | - |
2477 | -pt-config-diff diffs MySQL configurations by examining the values of server |
2478 | -system variables from two or more CONFIG sources specified on the command |
2479 | -line. A CONFIG source can be a DSN or a filename containing the output of |
2480 | -\ ``mysqld --help --verbose``\ , \ ``my_print_defaults``\ , \ ``SHOW VARIABLES``\ , or |
2481 | -an option file (e.g. my.cnf). |
2482 | - |
2483 | -For each DSN CONFIG, pt-config-diff connects to MySQL and gets variables |
2484 | -and values by executing \ ``SHOW /\*!40103 GLOBAL\*/ VARIABLES``\ . This is |
2485 | -an "active config" because it shows what server values MySQL is |
2486 | -actively (currently) running with. |
2487 | - |
2488 | -Only variables that all CONFIG sources have are compared because if a |
2489 | -variable is not present then we cannot know or safely guess its value. |
2490 | -For example, if you compare an option file (e.g. my.cnf) to an active config |
2491 | -(i.e. SHOW VARIABLES from a DSN CONFIG), the option file will probably |
2492 | -only have a few variables, whereas the active config has every variable. |
2493 | -Only values of the variables present in both configs are compared. |
2494 | - |
2495 | -Option file and DSN configs provide the best results. |
2496 | - |
2497 | - |
2498 | -****** |
2499 | -OUTPUT |
2500 | -****** |
2501 | - |
2502 | - |
2503 | -There is no output when there are no differences. When there are differences, |
2504 | -pt-config-diff prints a report to STDOUT that looks similar to the following: |
2505 | - |
2506 | - |
2507 | -.. code-block:: perl |
2508 | - |
2509 | - 2 config differences |
2510 | - Variable my.master.cnf my.slave.cnf |
2511 | - ========================= =============== =============== |
2512 | - datadir /tmp/12345/data /tmp/12346/data |
2513 | - port 12345 12346 |
2514 | - |
2515 | - |
2516 | -Comparing MySQL variables is difficult because there are many variations and |
2517 | -subtleties across the many versions and distributions of MySQL. When a |
2518 | -comparison fails, the tool prints a warning to STDERR, such as the following: |
2519 | - |
2520 | - |
2521 | -.. code-block:: perl |
2522 | - |
2523 | - Comparing log_error values (mysqld.log, /tmp/12345/data/mysqld.log) |
2524 | - caused an error: Argument "/tmp/12345/data/mysqld.log" isn't numeric |
2525 | - in numeric eq (==) at ./pt-config-diff line 2311. |
2526 | - |
2527 | - |
2528 | -Please report these warnings so the comparison functions can be improved. |
2529 | - |
2530 | - |
2531 | -*********** |
2532 | -EXIT STATUS |
2533 | -*********** |
2534 | - |
2535 | - |
2536 | -pt-config-diff exits with a zero exit status when there are no differences, and |
2537 | -1 if there are. |
2538 | - |
2539 | - |
2540 | -******* |
2541 | -OPTIONS |
2542 | -******* |
2543 | - |
2544 | - |
2545 | -This tool accepts additional command-line arguments. Refer to the |
2546 | -"SYNOPSIS" and usage information for details. |
2547 | - |
2548 | - |
2549 | ---ask-pass |
2550 | - |
2551 | - Prompt for a password when connecting to MySQL. |
2552 | - |
2553 | - |
2554 | - |
2555 | ---charset |
2556 | - |
2557 | - short form: -A; type: string |
2558 | - |
2559 | - Default character set. If the value is utf8, sets Perl's binmode on |
2560 | - STDOUT to utf8, passes the mysql_enable_utf8 option to DBD::mysql, and |
2561 | - runs SET NAMES UTF8 after connecting to MySQL. Any other value sets |
2562 | - binmode on STDOUT without the utf8 layer, and runs SET NAMES after |
2563 | - connecting to MySQL. |
2564 | - |
2565 | - |
2566 | - |
2567 | ---config |
2568 | - |
2569 | - type: Array |
2570 | - |
2571 | - Read this comma-separated list of config files; if specified, this must be the |
2572 | - first option on the command line. (This option does not specify a CONFIG; |
2573 | - it's equivalent to \ ``--defaults-file``\ .) |
2574 | - |
2575 | - |
2576 | - |
2577 | ---daemonize |
2578 | - |
2579 | - Fork to the background and detach from the shell. POSIX |
2580 | - operating systems only. |
2581 | - |
2582 | - |
2583 | - |
2584 | ---defaults-file |
2585 | - |
2586 | - short form: -F; type: string |
2587 | - |
2588 | - Only read mysql options from the given file. You must give an absolute |
2589 | - pathname. |
2590 | - |
2591 | - |
2592 | - |
2593 | ---help |
2594 | - |
2595 | - Show help and exit. |
2596 | - |
2597 | - |
2598 | - |
2599 | ---host |
2600 | - |
2601 | - short form: -h; type: string |
2602 | - |
2603 | - Connect to host. |
2604 | - |
2605 | - |
2606 | - |
2607 | ---ignore-variables |
2608 | - |
2609 | - type: array |
2610 | - |
2611 | - Ignore, do not compare, these variables. |
2612 | - |
2613 | - |
2614 | - |
2615 | ---password |
2616 | - |
2617 | - short form: -p; type: string |
2618 | - |
2619 | - Password to use for connection. |
2620 | - |
2621 | - |
2622 | - |
2623 | ---pid |
2624 | - |
2625 | - type: string |
2626 | - |
2627 | - Create the given PID file when daemonized. The file contains the process |
2628 | - ID of the daemonized instance. The PID file is removed when the |
2629 | - daemonized instance exits. The program checks for the existence of the |
2630 | - PID file when starting; if it exists and the process with the matching PID |
2631 | - exists, the program exits. |
2632 | - |
2633 | - |
2634 | - |
2635 | ---port |
2636 | - |
2637 | - short form: -P; type: int |
2638 | - |
2639 | - Port number to use for connection. |
2640 | - |
2641 | - |
2642 | - |
2643 | ---[no]report |
2644 | - |
2645 | - default: yes |
2646 | - |
2647 | - Print the MySQL config diff report to STDOUT. If you just want to check |
2648 | - if the given configs are different or not by examining the tool's exit |
2649 | - status, then specify \ ``--no-report``\ to suppress the report. |
2650 | - |
2651 | - |
2652 | - |
2653 | ---report-width |
2654 | - |
2655 | - type: int; default: 78 |
2656 | - |
2657 | - Truncate report lines to this many characters. Since some variable values can |
2658 | - be long, or when comparing multiple configs, it may help to increase the |
2659 | - report width so values are not truncated beyond readability. |
2660 | - |
2661 | - |
2662 | - |
2663 | ---set-vars |
2664 | - |
2665 | - type: string; default: wait_timeout=10000 |
2666 | - |
2667 | - Set these MySQL variables. Immediately after connecting to MySQL, this string |
2668 | - will be appended to SET and executed. |
2669 | - |
2670 | - |
2671 | - |
2672 | ---socket |
2673 | - |
2674 | - short form: -S; type: string |
2675 | - |
2676 | - Socket file to use for connection. |
2677 | - |
2678 | - |
2679 | - |
2680 | ---user |
2681 | - |
2682 | - short form: -u; type: string |
2683 | - |
2684 | - MySQL user if not current user. |
2685 | - |
2686 | - |
2687 | - |
2688 | ---version |
2689 | - |
2690 | - Show version and exit. |
2691 | - |
2692 | - |
2693 | - |
2694 | - |
2695 | -*********** |
2696 | -DSN OPTIONS |
2697 | -*********** |
2698 | - |
2699 | - |
2700 | -These DSN options are used to create a DSN. Each option is given like |
2701 | -\ ``option=value``\ . The options are case-sensitive, so P and p are not the |
2702 | -same option. There cannot be whitespace before or after the \ ``=``\ and |
2703 | -if the value contains whitespace it must be quoted. DSN options are |
2704 | -comma-separated. See the percona-toolkit manpage for full details. |
2705 | - |
2706 | - |
2707 | -\* A |
2708 | - |
2709 | - dsn: charset; copy: yes |
2710 | - |
2711 | - Default character set. |
2712 | - |
2713 | - |
2714 | - |
2715 | -\* D |
2716 | - |
2717 | - dsn: database; copy: yes |
2718 | - |
2719 | - Default database. |
2720 | - |
2721 | - |
2722 | - |
2723 | -\* F |
2724 | - |
2725 | - dsn: mysql_read_default_file; copy: yes |
2726 | - |
2727 | - Only read default options from the given file |
2728 | - |
2729 | - |
2730 | - |
2731 | -\* h |
2732 | - |
2733 | - dsn: host; copy: yes |
2734 | - |
2735 | - Connect to host. |
2736 | - |
2737 | - |
2738 | - |
2739 | -\* p |
2740 | - |
2741 | - dsn: password; copy: yes |
2742 | - |
2743 | - Password to use when connecting. |
2744 | - |
2745 | - |
2746 | - |
2747 | -\* P |
2748 | - |
2749 | - dsn: port; copy: yes |
2750 | - |
2751 | - Port number to use for connection. |
2752 | - |
2753 | - |
2754 | - |
2755 | -\* S |
2756 | - |
2757 | - dsn: mysql_socket; copy: yes |
2758 | - |
2759 | - Socket file to use for connection. |
2760 | - |
2761 | - |
2762 | - |
2763 | -\* u |
2764 | - |
2765 | - dsn: user; copy: yes |
2766 | - |
2767 | - User for login if not current user. |
2768 | - |
2769 | - |
2770 | - |
2771 | - |
2772 | -*********** |
2773 | -ENVIRONMENT |
2774 | -*********** |
2775 | - |
2776 | - |
2777 | -The environment variable \ ``PTDEBUG``\ enables verbose debugging output to STDERR. |
2778 | -To enable debugging and capture all output to a file, run the tool like: |
2779 | - |
2780 | - |
2781 | -.. code-block:: perl |
2782 | - |
2783 | - PTDEBUG=1 pt-config-diff ... > FILE 2>&1 |
2784 | - |
2785 | - |
2786 | -Be careful: debugging output is voluminous and can generate several megabytes |
2787 | -of output. |
2788 | - |
2789 | - |
2790 | -******************* |
2791 | -SYSTEM REQUIREMENTS |
2792 | -******************* |
2793 | - |
2794 | - |
2795 | -You need Perl, DBI, DBD::mysql, and some core packages that ought to be |
2796 | -installed in any reasonably new version of Perl. |
2797 | - |
2798 | - |
2799 | -**** |
2800 | -BUGS |
2801 | -**** |
2802 | - |
2803 | - |
2804 | -For a list of known bugs, see `http://www.percona.com/bugs/pt-config-diff <http://www.percona.com/bugs/pt-config-diff>`_. |
2805 | - |
2806 | -Please report bugs at `https://bugs.launchpad.net/percona-toolkit <https://bugs.launchpad.net/percona-toolkit>`_. |
2807 | -Include the following information in your bug report: |
2808 | - |
2809 | - |
2810 | -\* Complete command-line used to run the tool |
2811 | - |
2812 | - |
2813 | - |
2814 | -\* Tool "--version" |
2815 | - |
2816 | - |
2817 | - |
2818 | -\* MySQL version of all servers involved |
2819 | - |
2820 | - |
2821 | - |
2822 | -\* Output from the tool including STDERR |
2823 | - |
2824 | - |
2825 | - |
2826 | -\* Input files (log/dump/config files, etc.) |
2827 | - |
2828 | - |
2829 | - |
2830 | -If possible, include debugging output by running the tool with \ ``PTDEBUG``\ ; |
2831 | -see "ENVIRONMENT". |
2832 | - |
2833 | - |
2834 | -*********** |
2835 | -DOWNLOADING |
2836 | -*********** |
2837 | - |
2838 | - |
2839 | -Visit `http://www.percona.com/software/percona-toolkit/ <http://www.percona.com/software/percona-toolkit/>`_ to download the |
2840 | -latest release of Percona Toolkit. Or, get the latest release from the |
2841 | -command line: |
2842 | - |
2843 | - |
2844 | -.. code-block:: perl |
2845 | - |
2846 | - wget percona.com/get/percona-toolkit.tar.gz |
2847 | - |
2848 | - wget percona.com/get/percona-toolkit.rpm |
2849 | - |
2850 | - wget percona.com/get/percona-toolkit.deb |
2851 | - |
2852 | - |
2853 | -You can also get individual tools from the latest release: |
2854 | - |
2855 | - |
2856 | -.. code-block:: perl |
2857 | - |
2858 | - wget percona.com/get/TOOL |
2859 | - |
2860 | - |
2861 | -Replace \ ``TOOL``\ with the name of any tool. |
2862 | - |
2863 | - |
2864 | -******* |
2865 | -AUTHORS |
2866 | -******* |
2867 | - |
2868 | - |
2869 | -Baron Schwartz and Daniel Nichter |
2870 | - |
2871 | - |
2872 | -********************* |
2873 | -ABOUT PERCONA TOOLKIT |
2874 | -********************* |
2875 | - |
2876 | - |
2877 | -This tool is part of Percona Toolkit, a collection of advanced command-line |
2878 | -tools developed by Percona for MySQL support and consulting. Percona Toolkit |
2879 | -was forked from two projects in June, 2011: Maatkit and Aspersa. Those |
2880 | -projects were created by Baron Schwartz and developed primarily by him and |
2881 | -Daniel Nichter, both of whom are employed by Percona. Visit |
2882 | -`http://www.percona.com/software/ <http://www.percona.com/software/>`_ for more software developed by Percona. |
2883 | - |
2884 | - |
2885 | -******************************** |
2886 | -COPYRIGHT, LICENSE, AND WARRANTY |
2887 | -******************************** |
2888 | - |
2889 | - |
2890 | -This program is copyright 2011 Percona Inc. |
2891 | -Feedback and improvements are welcome. |
2892 | - |
2893 | -THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
2894 | -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
2895 | -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
2896 | - |
2897 | -This program is free software; you can redistribute it and/or modify it under |
2898 | -the terms of the GNU General Public License as published by the Free Software |
2899 | -Foundation, version 2; OR the Perl Artistic License. On UNIX and similar |
2900 | -systems, you can issue \`man perlgpl' or \`man perlartistic' to read these |
2901 | -licenses. |
2902 | - |
2903 | -You should have received a copy of the GNU General Public License along with |
2904 | -this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
2905 | -Place, Suite 330, Boston, MA 02111-1307 USA. |
2906 | - |
2907 | - |
2908 | -******* |
2909 | -VERSION |
2910 | -******* |
2911 | - |
2912 | - |
2913 | -pt-config-diff 1.0.1 |
2914 | - |
2915 | |
2916 | === removed file 'docs/user/pt-deadlock-logger.rst' |
2917 | --- docs/user/pt-deadlock-logger.rst 2011-09-01 16:00:38 +0000 |
2918 | +++ docs/user/pt-deadlock-logger.rst 1970-01-01 00:00:00 +0000 |
2919 | @@ -1,760 +0,0 @@ |
2920 | - |
2921 | -################## |
2922 | -pt-deadlock-logger |
2923 | -################## |
2924 | - |
2925 | -.. highlight:: perl |
2926 | - |
2927 | - |
2928 | -**** |
2929 | -NAME |
2930 | -**** |
2931 | - |
2932 | - |
2933 | -pt-deadlock-logger - Extract and log MySQL deadlock information. |
2934 | - |
2935 | - |
2936 | -******** |
2937 | -SYNOPSIS |
2938 | -******** |
2939 | - |
2940 | - |
2941 | -Usage: pt-deadlock-logger [OPTION...] SOURCE_DSN |
2942 | - |
2943 | -pt-deadlock-logger extracts and saves information about the most recent deadlock |
2944 | -in a MySQL server. |
2945 | - |
2946 | -Print deadlocks on SOURCE_DSN: |
2947 | - |
2948 | - |
2949 | -.. code-block:: perl |
2950 | - |
2951 | - pt-deadlock-logger SOURCE_DSN |
2952 | - |
2953 | - |
2954 | -Store deadlock information from SOURCE_DSN in test.deadlocks table on SOURCE_DSN |
2955 | -(source and destination are the same host): |
2956 | - |
2957 | - |
2958 | -.. code-block:: perl |
2959 | - |
2960 | - pt-deadlock-logger SOURCE_DSN --dest D=test,t=deadlocks |
2961 | - |
2962 | - |
2963 | -Store deadlock information from SOURCE_DSN in test.deadlocks table on DEST_DSN |
2964 | -(source and destination are different hosts): |
2965 | - |
2966 | - |
2967 | -.. code-block:: perl |
2968 | - |
2969 | - pt-deadlock-logger SOURCE_DSN --dest DEST_DSN,D=test,t=deadlocks |
2970 | - |
2971 | - |
2972 | -Daemonize and check for deadlocks on SOURCE_DSN every 30 seconds for 4 hours: |
2973 | - |
2974 | - |
2975 | -.. code-block:: perl |
2976 | - |
2977 | - pt-deadlock-logger SOURCE_DSN --dest D=test,t=deadlocks --daemonize --run-time 4h --interval 30s |
2978 | - |
2979 | - |
2980 | - |
2981 | -***** |
2982 | -RISKS |
2983 | -***** |
2984 | - |
2985 | - |
2986 | -The following section is included to inform users about the potential risks, |
2987 | -whether known or unknown, of using this tool. The two main categories of risks |
2988 | -are those created by the nature of the tool (e.g. read-only tools vs. read-write |
2989 | -tools) and those created by bugs. |
2990 | - |
2991 | -pt-deadlock-logger is a read-only tool unless you specify a "--dest" table. |
2992 | -In some cases polling SHOW INNODB STATUS too rapidly can cause extra load on the |
2993 | -server. If you're using it on a production server under very heavy load, you |
2994 | -might want to set "--interval" to 30 seconds or more. |
2995 | - |
2996 | -At the time of this release, we know of no bugs that could cause serious harm to |
2997 | -users. |
2998 | - |
2999 | -The authoritative source for updated information is always the online issue |
3000 | -tracking system. Issues that affect this tool will be marked as such. You can |
3001 | -see a list of such issues at the following URL: |
3002 | -`http://www.percona.com/bugs/pt-deadlock-logger <http://www.percona.com/bugs/pt-deadlock-logger>`_. |
3003 | - |
3004 | -See also "BUGS" for more information on filing bugs and getting help. |
3005 | - |
3006 | - |
3007 | -*********** |
3008 | -DESCRIPTION |
3009 | -*********** |
3010 | - |
3011 | - |
3012 | -pt-deadlock-logger extracts deadlock data from a MySQL server. Currently only |
3013 | -InnoDB deadlock information is available. You can print the information to |
3014 | -standard output, store it in a database table, or both. If neither |
3015 | -"--print" nor "--dest" are given, then the deadlock information is |
3016 | -printed by default. If only "--dest" is given, then the deadlock |
3017 | -information is only stored. If both options are given, then the deadlock |
3018 | -information is printed and stored. |
3019 | - |
3020 | -The source host can be specified using one of two methods. The first method is |
3021 | -to use at least one of the standard connection-related command line options: |
3022 | -"--defaults-file", "--password", "--host", "--port", "--socket" |
3023 | -or "--user". These options only apply to the source host; they cannot be |
3024 | -used to specify the destination host. |
3025 | - |
3026 | -The second method to specify the source host, or the optional destination host |
3027 | -using "--dest", is a DSN. A DSN is a special syntax that can be either just |
3028 | -a hostname (like \ ``server.domain.com``\ or \ ``1.2.3.4``\ ), or a |
3029 | -\ ``key=value,key=value``\ string. Keys are a single letter: |
3030 | - |
3031 | - |
3032 | -.. code-block:: perl |
3033 | - |
3034 | - KEY MEANING |
3035 | - === ======= |
3036 | - h Connect to host |
3037 | - P Port number to use for connection |
3038 | - S Socket file to use for connection |
3039 | - u User for login if not current user |
3040 | - p Password to use when connecting |
3041 | - F Only read default options from the given file |
3042 | - |
3043 | - |
3044 | -If you omit any values from the destination host DSN, they are filled in with |
3045 | -values from the source host, so you don't need to specify them in both places. |
3046 | -\ ``pt-deadlock-logger``\ reads all normal MySQL option files, such as ~/.my.cnf, so |
3047 | -you may not need to specify username, password and other common options at all. |
3048 | - |
3049 | - |
3050 | -****** |
3051 | -OUTPUT |
3052 | -****** |
3053 | - |
3054 | - |
3055 | -You can choose which columns are output and/or saved to "--dest" with the |
3056 | -"--columns" argument. The default columns are as follows: |
3057 | - |
3058 | - |
3059 | -server |
3060 | - |
3061 | - The (source) server on which the deadlock occurred. This might be useful if |
3062 | - you're tracking deadlocks on many servers. |
3063 | - |
3064 | - |
3065 | - |
3066 | -ts |
3067 | - |
3068 | - The date and time of the last detected deadlock. |
3069 | - |
3070 | - |
3071 | - |
3072 | -thread |
3073 | - |
3074 | - The MySQL thread number, which is the same as the connection ID in SHOW FULL |
3075 | - PROCESSLIST. |
3076 | - |
3077 | - |
3078 | - |
3079 | -txn_id |
3080 | - |
3081 | - The InnoDB transaction ID, which InnoDB expresses as two unsigned integers. I |
3082 | - have multiplied them out to be one number. |
3083 | - |
3084 | - |
3085 | - |
3086 | -txn_time |
3087 | - |
3088 | - How long the transaction was active when the deadlock happened. |
3089 | - |
3090 | - |
3091 | - |
3092 | -user |
3093 | - |
3094 | - The connection's database username. |
3095 | - |
3096 | - |
3097 | - |
3098 | -hostname |
3099 | - |
3100 | - The connection's host. |
3101 | - |
3102 | - |
3103 | - |
3104 | -ip |
3105 | - |
3106 | - The connection's IP address. If you specify "--numeric-ip", this is |
3107 | - converted to an unsigned integer. |
3108 | - |
3109 | - |
3110 | - |
3111 | -db |
3112 | - |
3113 | - The database in which the deadlock occurred. |
3114 | - |
3115 | - |
3116 | - |
3117 | -tbl |
3118 | - |
3119 | - The table on which the deadlock occurred. |
3120 | - |
3121 | - |
3122 | - |
3123 | -idx |
3124 | - |
3125 | - The index on which the deadlock occurred. |
3126 | - |
3127 | - |
3128 | - |
3129 | -lock_type |
3130 | - |
3131 | - The lock type the transaction held on the lock that caused the deadlock. |
3132 | - |
3133 | - |
3134 | - |
3135 | -lock_mode |
3136 | - |
3137 | - The lock mode of the lock that caused the deadlock. |
3138 | - |
3139 | - |
3140 | - |
3141 | -wait_hold |
3142 | - |
3143 | - Whether the transaction was waiting for the lock or holding the lock. Usually |
3144 | - you will see the two waited-for locks. |
3145 | - |
3146 | - |
3147 | - |
3148 | -victim |
3149 | - |
3150 | - Whether the transaction was selected as the deadlock victim and rolled back. |
3151 | - |
3152 | - |
3153 | - |
3154 | -query |
3155 | - |
3156 | - The query that caused the deadlock. |
3157 | - |
3158 | - |
3159 | - |
3160 | - |
3161 | -************************** |
3162 | -INNODB CAVEATS AND DETAILS |
3163 | -************************** |
3164 | - |
3165 | - |
3166 | -InnoDB's output is hard to parse and sometimes there's no way to do it right. |
3167 | - |
3168 | -Sometimes not all information (for example, username or IP address) is included |
3169 | -in the deadlock information. In this case there's nothing for the script to put |
3170 | -in those columns. It may also be the case that the deadlock output is so long |
3171 | -(because there were a lot of locks) that the whole thing is truncated. |
3172 | - |
3173 | -Though there are usually two transactions involved in a deadlock, there are more |
3174 | -locks than that; at a minimum, one more lock than transactions is necessary to |
3175 | -create a cycle in the waits-for graph. pt-deadlock-logger prints the |
3176 | -transactions (always two in the InnoDB output, even when there are more |
3177 | -transactions in the waits-for graph than that) and fills in locks. It prefers |
3178 | -waited-for over held when choosing lock information to output, but you can |
3179 | -figure out the rest with a moment's thought. If you see one wait-for and one |
3180 | -held lock, you're looking at the same lock, so of course you'd prefer to see |
3181 | -both wait-for locks and get more information. If the two waited-for locks are |
3182 | -not on the same table, more than two transactions were involved in the deadlock. |
3183 | - |
3184 | - |
3185 | -******* |
3186 | -OPTIONS |
3187 | -******* |
3188 | - |
3189 | - |
3190 | -This tool accepts additional command-line arguments. Refer to the |
3191 | -"SYNOPSIS" and usage information for details. |
3192 | - |
3193 | - |
3194 | ---ask-pass |
3195 | - |
3196 | - Prompt for a password when connecting to MySQL. |
3197 | - |
3198 | - |
3199 | - |
3200 | ---charset |
3201 | - |
3202 | - short form: -A; type: string |
3203 | - |
3204 | - Default character set. If the value is utf8, sets Perl's binmode on |
3205 | - STDOUT to utf8, passes the mysql_enable_utf8 option to DBD::mysql, and runs SET |
3206 | - NAMES UTF8 after connecting to MySQL. Any other value sets binmode on STDOUT |
3207 | - without the utf8 layer, and runs SET NAMES after connecting to MySQL. |
3208 | - |
3209 | - |
3210 | - |
3211 | ---clear-deadlocks |
3212 | - |
3213 | - type: string |
3214 | - |
3215 | - Use this table to create a small deadlock. This usually has the effect of |
3216 | - clearing out a huge deadlock, which otherwise consumes the entire output of |
3217 | - \ ``SHOW INNODB STATUS``\ . The table must not exist. pt-deadlock-logger will |
3218 | - create it with the following MAGIC_clear_deadlocks structure: |
3219 | - |
3220 | - |
3221 | - .. code-block:: perl |
3222 | - |
3223 | - CREATE TABLE test.deadlock_maker(a INT PRIMARY KEY) ENGINE=InnoDB; |
3224 | - |
3225 | - |
3226 | - After creating the table and causing a small deadlock, the tool will drop the |
3227 | - table again. |
3228 | - |
3229 | - |
3230 | - |
3231 | ---[no]collapse |
3232 | - |
3233 | - Collapse whitespace in queries to a single space. This might make it easier to |
3234 | - inspect on the command line or in a query. By default, whitespace is collapsed |
3235 | - when printing with "--print", but not modified when storing to "--dest". |
3236 | - (That is, the default is different for each action). |
3237 | - |
3238 | - |
3239 | - |
3240 | ---columns |
3241 | - |
3242 | - type: hash |
3243 | - |
3244 | - Output only this comma-separated list of columns. See "OUTPUT" for more |
3245 | - details on columns. |
3246 | - |
3247 | - |
3248 | - |
3249 | ---config |
3250 | - |
3251 | - type: Array |
3252 | - |
3253 | - Read this comma-separated list of config files; if specified, this must be the |
3254 | - first option on the command line. |
3255 | - |
3256 | - |
3257 | - |
3258 | ---create-dest-table |
3259 | - |
3260 | - Create the table specified by "--dest". |
3261 | - |
3262 | - Normally the "--dest" table is expected to exist already. This option |
3263 | - causes pt-deadlock-logger to create the table automatically using the suggested |
3264 | - table structure. |
3265 | - |
3266 | - |
3267 | - |
3268 | ---daemonize |
3269 | - |
3270 | - Fork to the background and detach from the shell. POSIX operating systems only. |
3271 | - |
3272 | - |
3273 | - |
3274 | ---defaults-file |
3275 | - |
3276 | - short form: -F; type: string |
3277 | - |
3278 | - Only read mysql options from the given file. You must give an absolute |
3279 | - pathname. |
3280 | - |
3281 | - |
3282 | - |
3283 | ---dest |
3284 | - |
3285 | - type: DSN |
3286 | - |
3287 | - DSN for where to store deadlocks; specify at least a database (D) and table (t). |
3288 | - |
3289 | - Missing values are filled in with the same values from the source host, so you |
3290 | - can usually omit most parts of this argument if you're storing deadlocks on the |
3291 | - same server on which they happen. |
3292 | - |
3293 | - By default, whitespace in the query column is left intact; |
3294 | - use "--[no]collapse" if you want whitespace collapsed. |
3295 | - |
3296 | - The following MAGIC_dest_table is suggested if you want to store all the |
3297 | - information pt-deadlock-logger can extract about deadlocks: |
3298 | - |
3299 | - |
3300 | - .. code-block:: perl |
3301 | - |
3302 | - CREATE TABLE deadlocks ( |
3303 | - server char(20) NOT NULL, |
3304 | - ts datetime NOT NULL, |
3305 | - thread int unsigned NOT NULL, |
3306 | - txn_id bigint unsigned NOT NULL, |
3307 | - txn_time smallint unsigned NOT NULL, |
3308 | - user char(16) NOT NULL, |
3309 | - hostname char(20) NOT NULL, |
3310 | - ip char(15) NOT NULL, -- alternatively, ip int unsigned NOT NULL |
3311 | - db char(64) NOT NULL, |
3312 | - tbl char(64) NOT NULL, |
3313 | - idx char(64) NOT NULL, |
3314 | - lock_type char(16) NOT NULL, |
3315 | - lock_mode char(1) NOT NULL, |
3316 | - wait_hold char(1) NOT NULL, |
3317 | - victim tinyint unsigned NOT NULL, |
3318 | - query text NOT NULL, |
3319 | - PRIMARY KEY (server,ts,thread) |
3320 | - ) ENGINE=InnoDB |
3321 | - |
3322 | - |
3323 | - If you use "--columns", you can omit whichever columns you don't want to |
3324 | - store. |
3325 | - |
3326 | - |
3327 | - |
3328 | ---help |
3329 | - |
3330 | - Show help and exit. |
3331 | - |
3332 | - |
3333 | - |
3334 | ---host |
3335 | - |
3336 | - short form: -h; type: string |
3337 | - |
3338 | - Connect to host. |
3339 | - |
3340 | - |
3341 | - |
3342 | ---interval |
3343 | - |
3344 | - type: time |
3345 | - |
3346 | - How often to check for deadlocks. If no "--run-time" is specified, |
3347 | - pt-deadlock-logger runs forever, checking for deadlocks at every interval. |
3348 | - See also "--run-time". |
3349 | - |
3350 | - |
3351 | - |
3352 | ---log |
3353 | - |
3354 | - type: string |
3355 | - |
3356 | - Print all output to this file when daemonized. |
3357 | - |
3358 | - |
3359 | - |
3360 | ---numeric-ip |
3361 | - |
3362 | - Express IP addresses as integers. |
3363 | - |
3364 | - |
3365 | - |
3366 | ---password |
3367 | - |
3368 | - short form: -p; type: string |
3369 | - |
3370 | - Password to use when connecting. |
3371 | - |
3372 | - |
3373 | - |
3374 | ---pid |
3375 | - |
3376 | - type: string |
3377 | - |
3378 | - Create the given PID file when daemonized. The file contains the process ID of |
3379 | - the daemonized instance. The PID file is removed when the daemonized instance |
3380 | - exits. The program checks for the existence of the PID file when starting; if |
3381 | - it exists and the process with the matching PID exists, the program exits. |
3382 | - |
3383 | - |
3384 | - |
3385 | ---port |
3386 | - |
3387 | - short form: -P; type: int |
3388 | - |
3389 | - Port number to use for connection. |
3390 | - |
3391 | - |
3392 | - |
3393 | |
3394 | - |
3395 | - Print results on standard output. See "OUTPUT" for more. By default, |
3396 | - enables "--[no]collapse" unless you explicitly disable it. |
3397 | - |
3398 | - If "--interval" or "--run-time" is specified, only new deadlocks are |
3399 | - printed at each interval. A fingerprint for each deadlock is created using |
3400 | - "--columns" server, ts and thread (even if those columns were not specified |
3401 | - by "--columns") and if the current deadlock's fingerprint is different from |
3402 | - the last deadlock's fingerprint, then it is printed. |
3403 | - |
3404 | - |
3405 | - |
3406 | ---run-time |
3407 | - |
3408 | - type: time |
3409 | - |
3410 | - How long to run before exiting. By default pt-deadlock-logger runs once, |
3411 | - checks for deadlocks, and exits. If "--run-time" is specified but |
3412 | - no "--interval" is specified, a default 1 second interval will be used. |
3413 | - |
3414 | - |
3415 | - |
3416 | ---set-vars |
3417 | - |
3418 | - type: string; default: wait_timeout=10000 |
3419 | - |
3420 | - Set these MySQL variables. Immediately after connecting to MySQL, this string |
3421 | - will be appended to SET and executed. |
3422 | - |
3423 | - |
3424 | - |
3425 | ---socket |
3426 | - |
3427 | - short form: -S; type: string |
3428 | - |
3429 | - Socket file to use for connection. |
3430 | - |
3431 | - |
3432 | - |
3433 | ---tab |
3434 | - |
3435 | - Print tab-separated columns, instead of aligned. |
3436 | - |
3437 | - |
3438 | - |
3439 | ---user |
3440 | - |
3441 | - short form: -u; type: string |
3442 | - |
3443 | - User for login if not current user. |
3444 | - |
3445 | - |
3446 | - |
3447 | ---version |
3448 | - |
3449 | - Show version and exit. |
3450 | - |
3451 | - |
3452 | - |
3453 | - |
3454 | -*********** |
3455 | -DSN OPTIONS |
3456 | -*********** |
3457 | - |
3458 | - |
3459 | -These DSN options are used to create a DSN. Each option is given like |
3460 | -\ ``option=value``\ . The options are case-sensitive, so P and p are not the |
3461 | -same option. There cannot be whitespace before or after the \ ``=``\ and |
3462 | -if the value contains whitespace it must be quoted. DSN options are |
3463 | -comma-separated. See the percona-toolkit manpage for full details. |
3464 | - |
3465 | - |
3466 | -\* A |
3467 | - |
3468 | - dsn: charset; copy: yes |
3469 | - |
3470 | - Default character set. |
3471 | - |
3472 | - |
3473 | - |
3474 | -\* D |
3475 | - |
3476 | - dsn: database; copy: yes |
3477 | - |
3478 | - Default database. |
3479 | - |
3480 | - |
3481 | - |
3482 | -\* F |
3483 | - |
3484 | - dsn: mysql_read_default_file; copy: yes |
3485 | - |
3486 | - Only read default options from the given file |
3487 | - |
3488 | - |
3489 | - |
3490 | -\* h |
3491 | - |
3492 | - dsn: host; copy: yes |
3493 | - |
3494 | - Connect to host. |
3495 | - |
3496 | - |
3497 | - |
3498 | -\* p |
3499 | - |
3500 | - dsn: password; copy: yes |
3501 | - |
3502 | - Password to use when connecting. |
3503 | - |
3504 | - |
3505 | - |
3506 | -\* P |
3507 | - |
3508 | - dsn: port; copy: yes |
3509 | - |
3510 | - Port number to use for connection. |
3511 | - |
3512 | - |
3513 | - |
3514 | -\* S |
3515 | - |
3516 | - dsn: mysql_socket; copy: yes |
3517 | - |
3518 | - Socket file to use for connection. |
3519 | - |
3520 | - |
3521 | - |
3522 | -\* t |
3523 | - |
3524 | - Table in which to store deadlock information. |
3525 | - |
3526 | - |
3527 | - |
3528 | -\* u |
3529 | - |
3530 | - dsn: user; copy: yes |
3531 | - |
3532 | - User for login if not current user. |
3533 | - |
3534 | - |
3535 | - |
3536 | - |
3537 | -*********** |
3538 | -ENVIRONMENT |
3539 | -*********** |
3540 | - |
3541 | - |
3542 | -The environment variable \ ``PTDEBUG``\ enables verbose debugging output to STDERR. |
3543 | -To enable debugging and capture all output to a file, run the tool like: |
3544 | - |
3545 | - |
3546 | -.. code-block:: perl |
3547 | - |
3548 | - PTDEBUG=1 pt-deadlock-logger ... > FILE 2>&1 |
3549 | - |
3550 | - |
3551 | -Be careful: debugging output is voluminous and can generate several megabytes |
3552 | -of output. |
3553 | - |
3554 | - |
3555 | -******************* |
3556 | -SYSTEM REQUIREMENTS |
3557 | -******************* |
3558 | - |
3559 | - |
3560 | -You need Perl, DBI, DBD::mysql, and some core packages that ought to be |
3561 | -installed in any reasonably new version of Perl. |
3562 | - |
3563 | - |
3564 | -**** |
3565 | -BUGS |
3566 | -**** |
3567 | - |
3568 | - |
3569 | -For a list of known bugs, see `http://www.percona.com/bugs/pt-deadlock-logger <http://www.percona.com/bugs/pt-deadlock-logger>`_. |
3570 | - |
3571 | -Please report bugs at `https://bugs.launchpad.net/percona-toolkit <https://bugs.launchpad.net/percona-toolkit>`_. |
3572 | -Include the following information in your bug report: |
3573 | - |
3574 | - |
3575 | -\* Complete command-line used to run the tool |
3576 | - |
3577 | - |
3578 | - |
3579 | -\* Tool "--version" |
3580 | - |
3581 | - |
3582 | - |
3583 | -\* MySQL version of all servers involved |
3584 | - |
3585 | - |
3586 | - |
3587 | -\* Output from the tool including STDERR |
3588 | - |
3589 | - |
3590 | - |
3591 | -\* Input files (log/dump/config files, etc.) |
3592 | - |
3593 | - |
3594 | - |
3595 | -If possible, include debugging output by running the tool with \ ``PTDEBUG``\ ; |
3596 | -see "ENVIRONMENT". |
3597 | - |
3598 | - |
3599 | -*********** |
3600 | -DOWNLOADING |
3601 | -*********** |
3602 | - |
3603 | - |
3604 | -Visit `http://www.percona.com/software/percona-toolkit/ <http://www.percona.com/software/percona-toolkit/>`_ to download the |
3605 | -latest release of Percona Toolkit. Or, get the latest release from the |
3606 | -command line: |
3607 | - |
3608 | - |
3609 | -.. code-block:: perl |
3610 | - |
3611 | - wget percona.com/get/percona-toolkit.tar.gz |
3612 | - |
3613 | - wget percona.com/get/percona-toolkit.rpm |
3614 | - |
3615 | - wget percona.com/get/percona-toolkit.deb |
3616 | - |
3617 | - |
3618 | -You can also get individual tools from the latest release: |
3619 | - |
3620 | - |
3621 | -.. code-block:: perl |
3622 | - |
3623 | - wget percona.com/get/TOOL |
3624 | - |
3625 | - |
3626 | -Replace \ ``TOOL``\ with the name of any tool. |
3627 | - |
3628 | - |
3629 | -******* |
3630 | -AUTHORS |
3631 | -******* |
3632 | - |
3633 | - |
3634 | -Baron Schwartz |
3635 | - |
3636 | - |
3637 | -********************* |
3638 | -ABOUT PERCONA TOOLKIT |
3639 | -********************* |
3640 | - |
3641 | - |
3642 | -This tool is part of Percona Toolkit, a collection of advanced command-line |
3643 | -tools developed by Percona for MySQL support and consulting. Percona Toolkit |
3644 | -was forked from two projects in June, 2011: Maatkit and Aspersa. Those |
3645 | -projects were created by Baron Schwartz and developed primarily by him and |
3646 | -Daniel Nichter, both of whom are employed by Percona. Visit |
3647 | -`http://www.percona.com/software/ <http://www.percona.com/software/>`_ for more software developed by Percona. |
3648 | - |
3649 | - |
3650 | -******************************** |
3651 | -COPYRIGHT, LICENSE, AND WARRANTY |
3652 | -******************************** |
3653 | - |
3654 | - |
3655 | -This program is copyright 2007-2011 Baron Schwartz, 2011 Percona Inc. |
3656 | -Feedback and improvements are welcome. |
3657 | - |
3658 | -THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
3659 | -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
3660 | -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
3661 | - |
3662 | -This program is free software; you can redistribute it and/or modify it under |
3663 | -the terms of the GNU General Public License as published by the Free Software |
3664 | -Foundation, version 2; OR the Perl Artistic License. On UNIX and similar |
3665 | -systems, you can issue \`man perlgpl' or \`man perlartistic' to read these |
3666 | -licenses. |
3667 | - |
3668 | -You should have received a copy of the GNU General Public License along with |
3669 | -this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
3670 | -Place, Suite 330, Boston, MA 02111-1307 USA. |
3671 | - |
3672 | - |
3673 | -******* |
3674 | -VERSION |
3675 | -******* |
3676 | - |
3677 | - |
3678 | -pt-deadlock-logger 1.0.1 |
3679 | - |
3680 | |
3681 | === removed file 'docs/user/pt-diskstats.rst' |
3682 | --- docs/user/pt-diskstats.rst 2011-09-01 16:00:38 +0000 |
3683 | +++ docs/user/pt-diskstats.rst 1970-01-01 00:00:00 +0000 |
3684 | @@ -1,390 +0,0 @@ |
3685 | - |
3686 | -############ |
3687 | -pt-diskstats |
3688 | -############ |
3689 | - |
3690 | -.. highlight:: perl |
3691 | - |
3692 | - |
3693 | -**** |
3694 | -NAME |
3695 | -**** |
3696 | - |
3697 | - |
3698 | -pt-diskstats - Aggregate and summarize \ */proc/diskstats*\ . |
3699 | - |
3700 | - |
3701 | -******** |
3702 | -SYNOPSIS |
3703 | -******** |
3704 | - |
3705 | - |
3706 | -Usage: pt-diskstats [OPTIONS] [FILES] |
3707 | - |
3708 | -pt-diskstats reads \ */proc/diskstats*\ periodically, or files with the |
3709 | -contents of \ */proc/diskstats*\ , aggregates the data, and prints it nicely. |
3710 | - |
3711 | - |
3712 | -***** |
3713 | -RISKS |
3714 | -***** |
3715 | - |
3716 | - |
3717 | -The following section is included to inform users about the potential risks, |
3718 | -whether known or unknown, of using this tool. The two main categories of risks |
3719 | -are those created by the nature of the tool (e.g. read-only tools vs. read-write |
3720 | -tools) and those created by bugs. |
3721 | - |
3722 | -pt-diskstats is a read-only tool. It should be very low-risk. |
3723 | - |
3724 | -At the time of this release, we know of no bugs that could cause serious harm |
3725 | -to users. |
3726 | - |
3727 | -The authoritative source for updated information is always the online issue |
3728 | -tracking system. Issues that affect this tool will be marked as such. You can |
3729 | -see a list of such issues at the following URL: |
3730 | -`http://www.percona.com/bugs/pt-diskstats <http://www.percona.com/bugs/pt-diskstats>`_. |
3731 | - |
3732 | -See also "BUGS" for more information on filing bugs and getting help. |
3733 | - |
3734 | - |
3735 | -*********** |
3736 | -DESCRIPTION |
3737 | -*********** |
3738 | - |
3739 | - |
3740 | -pt-diskstats tool is similar to iostat, but has some advantages. It separates |
3741 | -reads and writes, for example, and computes some things that iostat does in |
3742 | -either incorrect or confusing ways. It is also menu-driven and interactive |
3743 | -with several different ways to aggregate the data, and integrates well with |
3744 | -the pt-collect tool. These properties make it very convenient for quickly |
3745 | -drilling down into I/O performance at the desired level of granularity. |
3746 | - |
3747 | -This program works in two main modes. One way is to process a file with saved |
3748 | -disk statistics, which you specify on the command line. The other way is to |
3749 | -start a background process gathering samples at intervals and saving them into |
3750 | -a file, and process this file in the foreground. In both cases, the tool is |
3751 | -interactively controlled by keystrokes, so you can redisplay and slice the |
3752 | -data flexibly and easily. If the tool is not attached to a terminal, it |
3753 | -doesn't run interactively; it just processes and prints its output, then exits. |
3754 | -Otherwise it loops until you exit with the 'q' key. |
3755 | - |
3756 | -If you press the '?' key, you will bring up the interactive help menu that |
3757 | -shows which keys control the program. |
3758 | - |
3759 | -Files should have this format: |
3760 | - |
3761 | - |
3762 | -.. code-block:: perl |
3763 | - |
3764 | - <contents of /proc/diskstats> |
3765 | - TS <timestamp> |
3766 | - <contents of /proc/diskstats> |
3767 | - ... et cetera |
3768 | - TS <timestamp> <-- must end with a TS line. |
3769 | - |
3770 | - |
3771 | -See `http://aspersa.googlecode.com/svn/html/diskstats.html <http://aspersa.googlecode.com/svn/html/diskstats.html>`_ for a detailed |
3772 | -example of using the tool. |
3773 | - |
3774 | - |
3775 | -****** |
3776 | -OUTPUT |
3777 | -****** |
3778 | - |
3779 | - |
3780 | -The columns are as follows: |
3781 | - |
3782 | - |
3783 | -#ts |
3784 | - |
3785 | - The number of seconds of samples in the line. If there is only one, then |
3786 | - the timestamp itself is shown, without the {curly braces}. |
3787 | - |
3788 | - |
3789 | - |
3790 | -device |
3791 | - |
3792 | - The device name. If there is more than one device, then instead the number |
3793 | - of devices aggregated into the line is shown, in {curly braces}. |
3794 | - |
3795 | - |
3796 | - |
3797 | -rd_mb_s |
3798 | - |
3799 | - The number of megabytes read per second, average, during the sampled interval. |
3800 | - |
3801 | - |
3802 | - |
3803 | -rd_cnc |
3804 | - |
3805 | - The average concurrency of the read operations, as computed by Little's Law |
3806 | - (a.k.a. queueing theory). |
3807 | - |
3808 | - |
3809 | - |
3810 | -rd_rt |
3811 | - |
3812 | - The average response time of the read operations, in milliseconds. |
3813 | - |
3814 | - |
3815 | - |
3816 | -wr_mb_s |
3817 | - |
3818 | - Megabytes written per second, average. |
3819 | - |
3820 | - |
3821 | - |
3822 | -wr_cnc |
3823 | - |
3824 | - Write concurrency, similar to read concurrency. |
3825 | - |
3826 | - |
3827 | - |
3828 | -wr_rt |
3829 | - |
3830 | - Write response time, similar to read response time. |
3831 | - |
3832 | - |
3833 | - |
3834 | -busy |
3835 | - |
3836 | - The fraction of time that the device had at least one request in progress; |
3837 | - this is what iostat calls %util (which is a misleading name). |
3838 | - |
3839 | - |
3840 | - |
3841 | -in_prg |
3842 | - |
3843 | - The number of requests that were in progress. Unlike the read and write |
3844 | - concurrencies, which are averages that are generated from reliable numbers, |
3845 | - this number is an instantaneous sample, and you can see that it might |
3846 | - represent a spike of requests, rather than the true long-term average. |
3847 | - |
3848 | - |
3849 | - |
3850 | -In addition to the above columns, there are a few columns that are hidden by |
3851 | -default. If you press the 'c' key, and then press Enter, you will blank out |
3852 | -the regular expression pattern that selects columns to display, and you will |
3853 | -then see the extra columns: |
3854 | - |
3855 | - |
3856 | -rd_s |
3857 | - |
3858 | - The number of reads per second. |
3859 | - |
3860 | - |
3861 | - |
3862 | -rd_avkb |
3863 | - |
3864 | - The average size of the reads, in kilobytes. |
3865 | - |
3866 | - |
3867 | - |
3868 | -rd_mrg |
3869 | - |
3870 | - The percentage of read requests that were merged together in the disk |
3871 | - scheduler before reaching the device. |
3872 | - |
3873 | - |
3874 | - |
3875 | -wr_s, wr_avgkb, and wr_mrg |
3876 | - |
3877 | - These are analogous to their \ ``rd_\*``\ cousins. |
3878 | - |
3879 | - |
3880 | - |
3881 | - |
3882 | -******* |
3883 | -OPTIONS |
3884 | -******* |
3885 | - |
3886 | - |
3887 | -Options must precede files on the command line. |
3888 | - |
3889 | - |
3890 | --c COLS |
3891 | - |
3892 | - Awk regex of which columns to include (default cnc|rt|mb|busy|prg). |
3893 | - |
3894 | - |
3895 | - |
3896 | --d DEVICES |
3897 | - |
3898 | - Awk regex of which devices to include. |
3899 | - |
3900 | - |
3901 | - |
3902 | --g GROUPBY |
3903 | - |
3904 | - Group-by mode (default disk); specify one of the following: |
3905 | - |
3906 | - |
3907 | - .. code-block:: perl |
3908 | - |
3909 | - disk - Each line of output shows one disk device. |
3910 | - sample - Each line of output shows one sample of statistics. |
3911 | - all - Each line of output shows one sample and one disk device. |
3912 | - |
3913 | - |
3914 | - |
3915 | - |
3916 | --i INTERVAL |
3917 | - |
3918 | - In -g sample mode, include INTERVAL seconds per sample. |
3919 | - |
3920 | - |
3921 | - |
3922 | --k KEEPFILE |
3923 | - |
3924 | - File to save diskstats samples in (default /tmp/diskstats-samples). |
3925 | - If a non-default filename is used, it will be saved for later analysis. |
3926 | - |
3927 | - |
3928 | - |
3929 | --n SAMPLES |
3930 | - |
3931 | - When in interactive mode, stop after N samples. |
3932 | - |
3933 | - |
3934 | - |
3935 | --s INTERVAL |
3936 | - |
3937 | - Sample /proc/diskstats every N seconds (default 1). |
3938 | - |
3939 | - |
3940 | - |
3941 | - |
3942 | -*********** |
3943 | -ENVIRONMENT |
3944 | -*********** |
3945 | - |
3946 | - |
3947 | -This tool does not use any environment variables. |
3948 | - |
3949 | - |
3950 | -******************* |
3951 | -SYSTEM REQUIREMENTS |
3952 | -******************* |
3953 | - |
3954 | - |
3955 | -This tool requires Bash v3 or newer and the \ */proc*\ filesystem unless |
3956 | -reading from files. |
3957 | - |
3958 | - |
3959 | -**** |
3960 | -BUGS |
3961 | -**** |
3962 | - |
3963 | - |
3964 | -For a list of known bugs, see `http://www.percona.com/bugs/pt-diskstats <http://www.percona.com/bugs/pt-diskstats>`_. |
3965 | - |
3966 | -Please report bugs at `https://bugs.launchpad.net/percona-toolkit <https://bugs.launchpad.net/percona-toolkit>`_. |
3967 | -Include the following information in your bug report: |
3968 | - |
3969 | - |
3970 | -\* Complete command-line used to run the tool |
3971 | - |
3972 | - |
3973 | - |
3974 | -\* Tool "--version" |
3975 | - |
3976 | - |
3977 | - |
3978 | -\* MySQL version of all servers involved |
3979 | - |
3980 | - |
3981 | - |
3982 | -\* Output from the tool including STDERR |
3983 | - |
3984 | - |
3985 | - |
3986 | -\* Input files (log/dump/config files, etc.) |
3987 | - |
3988 | - |
3989 | - |
3990 | -If possible, include debugging output by running the tool with \ ``PTDEBUG``\ ; |
3991 | -see "ENVIRONMENT". |
3992 | - |
3993 | - |
3994 | -*********** |
3995 | -DOWNLOADING |
3996 | -*********** |
3997 | - |
3998 | - |
3999 | -Visit `http://www.percona.com/software/percona-toolkit/ <http://www.percona.com/software/percona-toolkit/>`_ to download the |
4000 | -latest release of Percona Toolkit. Or, get the latest release from the |
4001 | -command line: |
4002 | - |
4003 | - |
4004 | -.. code-block:: perl |
4005 | - |
4006 | - wget percona.com/get/percona-toolkit.tar.gz |
4007 | - |
4008 | - wget percona.com/get/percona-toolkit.rpm |
4009 | - |
4010 | - wget percona.com/get/percona-toolkit.deb |
4011 | - |
4012 | - |
4013 | -You can also get individual tools from the latest release: |
4014 | - |
4015 | - |
4016 | -.. code-block:: perl |
4017 | - |
4018 | - wget percona.com/get/TOOL |
4019 | - |
4020 | - |
4021 | -Replace \ ``TOOL``\ with the name of any tool. |
4022 | - |
4023 | - |
4024 | -******* |
4025 | -AUTHORS |
4026 | -******* |
4027 | - |
4028 | - |
4029 | -Baron Schwartz |
4030 | - |
4031 | - |
4032 | -********************* |
4033 | -ABOUT PERCONA TOOLKIT |
4034 | -********************* |
4035 | - |
4036 | - |
4037 | -This tool is part of Percona Toolkit, a collection of advanced command-line |
4038 | -tools developed by Percona for MySQL support and consulting. Percona Toolkit |
4039 | -was forked from two projects in June, 2011: Maatkit and Aspersa. Those |
4040 | -projects were created by Baron Schwartz and developed primarily by him and |
4041 | -Daniel Nichter, both of whom are employed by Percona. Visit |
4042 | -`http://www.percona.com/software/ <http://www.percona.com/software/>`_ for more software developed by Percona. |
4043 | - |
4044 | - |
4045 | -******************************** |
4046 | -COPYRIGHT, LICENSE, AND WARRANTY |
4047 | -******************************** |
4048 | - |
4049 | - |
4050 | -This program is copyright 2010-2011 Baron Schwartz, 2011 Percona Inc. |
4051 | -Feedback and improvements are welcome. |
4052 | - |
4053 | -THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
4054 | -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
4055 | -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
4056 | - |
4057 | -This program is free software; you can redistribute it and/or modify it under |
4058 | -the terms of the GNU General Public License as published by the Free Software |
4059 | -Foundation, version 2; OR the Perl Artistic License. On UNIX and similar |
4060 | -systems, you can issue \`man perlgpl' or \`man perlartistic' to read these |
4061 | -licenses. |
4062 | - |
4063 | -You should have received a copy of the GNU General Public License along with |
4064 | -this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
4065 | -Place, Suite 330, Boston, MA 02111-1307 USA. |
4066 | - |
4067 | - |
4068 | -******* |
4069 | -VERSION |
4070 | -******* |
4071 | - |
4072 | - |
4073 | -pt-diskstats 1.0.1 |
4074 | - |
4075 | |
4076 | === removed file 'docs/user/pt-duplicate-key-checker.rst' |
4077 | --- docs/user/pt-duplicate-key-checker.rst 2011-09-01 16:00:38 +0000 |
4078 | +++ docs/user/pt-duplicate-key-checker.rst 1970-01-01 00:00:00 +0000 |
4079 | @@ -1,563 +0,0 @@ |
4080 | - |
4081 | -######################## |
4082 | -pt-duplicate-key-checker |
4083 | -######################## |
4084 | - |
4085 | -.. highlight:: perl |
4086 | - |
4087 | - |
4088 | -**** |
4089 | -NAME |
4090 | -**** |
4091 | - |
4092 | - |
4093 | -pt-duplicate-key-checker - Find duplicate indexes and foreign keys on MySQL tables. |
4094 | - |
4095 | - |
4096 | -******** |
4097 | -SYNOPSIS |
4098 | -******** |
4099 | - |
4100 | - |
4101 | -Usage: pt-duplicate-key-checker [OPTION...] [DSN] |
4102 | - |
4103 | -pt-duplicate-key-checker examines MySQL tables for duplicate or redundant |
4104 | -indexes and foreign keys. Connection options are read from MySQL option files. |
4105 | - |
4106 | - |
4107 | -.. code-block:: perl |
4108 | - |
4109 | - pt-duplicate-key-checker --host host1 |
4110 | - |
4111 | - |
4112 | - |
4113 | -***** |
4114 | -RISKS |
4115 | -***** |
4116 | - |
4117 | - |
4118 | -The following section is included to inform users about the potential risks, |
4119 | -whether known or unknown, of using this tool. The two main categories of risks |
4120 | -are those created by the nature of the tool (e.g. read-only tools vs. read-write |
4121 | -tools) and those created by bugs. |
4122 | - |
4123 | -pt-duplicate-key-checker is a read-only tool that executes SHOW CREATE TABLE and |
4124 | -related queries to inspect table structures, and thus is very low-risk. |
4125 | - |
4126 | -At the time of this release, there is an unconfirmed bug that causes the tool |
4127 | -to crash. |
4128 | - |
4129 | -The authoritative source for updated information is always the online issue |
4130 | -tracking system. Issues that affect this tool will be marked as such. You can |
4131 | -see a list of such issues at the following URL: |
4132 | -`http://www.percona.com/bugs/pt-duplicate-key-checker <http://www.percona.com/bugs/pt-duplicate-key-checker>`_. |
4133 | - |
4134 | -See also "BUGS" for more information on filing bugs and getting help. |
4135 | - |
4136 | - |
4137 | -*********** |
4138 | -DESCRIPTION |
4139 | -*********** |
4140 | - |
4141 | - |
4142 | -This program examines the output of SHOW CREATE TABLE on MySQL tables, and if |
4143 | -it finds indexes that cover the same columns as another index in the same |
4144 | -order, or cover an exact leftmost prefix of another index, it prints out |
4145 | -the suspicious indexes. By default, indexes must be of the same type, so a |
4146 | -BTREE index is not a duplicate of a FULLTEXT index, even if they have the same |
4147 | -columns. You can override this. |
4148 | - |
4149 | -It also looks for duplicate foreign keys. A duplicate foreign key covers the |
4150 | -same columns as another in the same table, and references the same parent |
4151 | -table. |
4152 | - |
4153 | - |
4154 | -******* |
4155 | -OPTIONS |
4156 | -******* |
4157 | - |
4158 | - |
4159 | -This tool accepts additional command-line arguments. Refer to the |
4160 | -"SYNOPSIS" and usage information for details. |
4161 | - |
4162 | - |
4163 | ---all-structs |
4164 | - |
4165 | - Compare indexes with different structs (BTREE, HASH, etc). |
4166 | - |
4167 | - By default this is disabled, because a BTREE index that covers the same columns |
4168 | - as a FULLTEXT index is not really a duplicate, for example. |
4169 | - |
4170 | - |
4171 | - |
4172 | ---ask-pass |
4173 | - |
4174 | - Prompt for a password when connecting to MySQL. |
4175 | - |
4176 | - |
4177 | - |
4178 | ---charset |
4179 | - |
4180 | - short form: -A; type: string |
4181 | - |
4182 | - Default character set. If the value is utf8, sets Perl's binmode on |
4183 | - STDOUT to utf8, passes the mysql_enable_utf8 option to DBD::mysql, and runs SET |
4184 | - NAMES UTF8 after connecting to MySQL. Any other value sets binmode on STDOUT |
4185 | - without the utf8 layer, and runs SET NAMES after connecting to MySQL. |
4186 | - |
4187 | - |
4188 | - |
4189 | ---[no]clustered |
4190 | - |
4191 | - default: yes |
4192 | - |
4193 | - PK columns appended to secondary key is duplicate. |
4194 | - |
4195 | - Detects when a suffix of a secondary key is a leftmost prefix of the primary |
4196 | - key, and treats it as a duplicate key. Only detects this condition on storage |
4197 | - engines whose primary keys are clustered (currently InnoDB and solidDB). |
4198 | - |
4199 | - Clustered storage engines append the primary key columns to the leaf nodes of |
4200 | - all secondary keys anyway, so you might consider it redundant to have them |
4201 | - appear in the internal nodes as well. Of course, you may also want them in the |
4202 | - internal nodes, because just having them at the leaf nodes won't help for some |
4203 | - queries. It does help for covering index queries, however. |
4204 | - |
4205 | - Here's an example of a key that is considered redundant with this option: |
4206 | - |
4207 | - |
4208 | - .. code-block:: perl |
4209 | - |
4210 | - PRIMARY KEY (`a`) |
4211 | - KEY `b` (`b`,`a`) |
4212 | - |
4213 | - |
4214 | - The use of such indexes is rather subtle. For example, suppose you have the |
4215 | - following query: |
4216 | - |
4217 | - |
4218 | - .. code-block:: perl |
4219 | - |
4220 | - SELECT ... WHERE b=1 ORDER BY a; |
4221 | - |
4222 | - |
4223 | - This query will do a filesort if we remove the index on \ ``b,a``\ . But if we |
4224 | - shorten the index on \ ``b,a``\ to just \ ``b``\ and also remove the ORDER BY, the query |
4225 | - should return the same results. |
4226 | - |
4227 | - The tool suggests shortening duplicate clustered keys by dropping the key |
4228 | - and re-adding it without the primary key prefix. The shortened clustered |
4229 | - key may still duplicate another key, but the tool cannot currently detect |
4230 | - when this happens without being ran a second time to re-check the newly |
4231 | - shortened clustered keys. Therefore, if you shorten any duplicate clustered |
4232 | - keys, you should run the tool again. |
4233 | - |
4234 | - |
4235 | - |
4236 | ---config |
4237 | - |
4238 | - type: Array |
4239 | - |
4240 | - Read this comma-separated list of config files; if specified, this must be the |
4241 | - first option on the command line. |
4242 | - |
4243 | - |
4244 | - |
4245 | ---databases |
4246 | - |
4247 | - short form: -d; type: hash |
4248 | - |
4249 | - Check only this comma-separated list of databases. |
4250 | - |
4251 | - |
4252 | - |
4253 | ---defaults-file |
4254 | - |
4255 | - short form: -F; type: string |
4256 | - |
4257 | - Only read mysql options from the given file. You must give an absolute pathname. |
4258 | - |
4259 | - |
4260 | - |
4261 | ---engines |
4262 | - |
4263 | - short form: -e; type: hash |
4264 | - |
4265 | - Check only tables whose storage engine is in this comma-separated list. |
4266 | - |
4267 | - |
4268 | - |
4269 | ---help |
4270 | - |
4271 | - Show help and exit. |
4272 | - |
4273 | - |
4274 | - |
4275 | ---host |
4276 | - |
4277 | - short form: -h; type: string |
4278 | - |
4279 | - Connect to host. |
4280 | - |
4281 | - |
4282 | - |
4283 | ---ignore-databases |
4284 | - |
4285 | - type: Hash |
4286 | - |
4287 | - Ignore this comma-separated list of databases. |
4288 | - |
4289 | - |
4290 | - |
4291 | ---ignore-engines |
4292 | - |
4293 | - type: Hash |
4294 | - |
4295 | - Ignore this comma-separated list of storage engines. |
4296 | - |
4297 | - |
4298 | - |
4299 | ---ignore-order |
4300 | - |
4301 | - Ignore index order so KEY(a,b) duplicates KEY(b,a). |
4302 | - |
4303 | - |
4304 | - |
4305 | ---ignore-tables |
4306 | - |
4307 | - type: Hash |
4308 | - |
4309 | - Ignore this comma-separated list of tables. Table names may be qualified with |
4310 | - the database name. |
4311 | - |
4312 | - |
4313 | - |
4314 | ---key-types |
4315 | - |
4316 | - type: string; default: fk |
4317 | - |
4318 | - Check for duplicate f=foreign keys, k=keys or fk=both. |
4319 | - |
4320 | - |
4321 | - |
4322 | ---password |
4323 | - |
4324 | - short form: -p; type: string |
4325 | - |
4326 | - Password to use when connecting. |
4327 | - |
4328 | - |
4329 | - |
4330 | ---pid |
4331 | - |
4332 | - type: string |
4333 | - |
4334 | - Create the given PID file. The file contains the process ID of the script. |
4335 | - The PID file is removed when the script exits. Before starting, the script |
4336 | - checks if the PID file already exists. If it does not, then the script creates |
4337 | - and writes its own PID to it. If it does, then the script checks the following: |
4338 | - if the file contains a PID and a process is running with that PID, then |
4339 | - the script dies; or, if there is no process running with that PID, then the |
4340 | - script overwrites the file with its own PID and starts; else, if the file |
4341 | - contains no PID, then the script dies. |
4342 | - |
4343 | - |
4344 | - |
4345 | ---port |
4346 | - |
4347 | - short form: -P; type: int |
4348 | - |
4349 | - Port number to use for connection. |
4350 | - |
4351 | - |
4352 | - |
4353 | ---set-vars |
4354 | - |
4355 | - type: string; default: wait_timeout=10000 |
4356 | - |
4357 | - Set these MySQL variables. Immediately after connecting to MySQL, this string |
4358 | - will be appended to SET and executed. |
4359 | - |
4360 | - |
4361 | - |
4362 | ---socket |
4363 | - |
4364 | - short form: -S; type: string |
4365 | - |
4366 | - Socket file to use for connection. |
4367 | - |
4368 | - |
4369 | - |
4370 | ---[no]sql |
4371 | - |
4372 | - default: yes |
4373 | - |
4374 | - Print DROP KEY statement for each duplicate key. By default an ALTER TABLE |
4375 | - DROP KEY statement is printed below each duplicate key so that, if you want to |
4376 | - remove the duplicate key, you can copy-paste the statement into MySQL. |
4377 | - |
4378 | - To disable printing these statements, specify --nosql. |
4379 | - |
4380 | - |
4381 | - |
4382 | ---[no]summary |
4383 | - |
4384 | - default: yes |
4385 | - |
4386 | - Print summary of indexes at end of output. |
4387 | - |
4388 | - |
4389 | - |
4390 | ---tables |
4391 | - |
4392 | - short form: -t; type: hash |
4393 | - |
4394 | - Check only this comma-separated list of tables. |
4395 | - |
4396 | - Table names may be qualified with the database name. |
4397 | - |
4398 | - |
4399 | - |
4400 | ---user |
4401 | - |
4402 | - short form: -u; type: string |
4403 | - |
4404 | - User for login if not current user. |
4405 | - |
4406 | - |
4407 | - |
4408 | ---verbose |
4409 | - |
4410 | - short form: -v |
4411 | - |
4412 | - Output all keys and/or foreign keys found, not just redundant ones. |
4413 | - |
4414 | - |
4415 | - |
4416 | ---version |
4417 | - |
4418 | - Show version and exit. |
4419 | - |
4420 | - |
4421 | - |
4422 | - |
4423 | -*********** |
4424 | -DSN OPTIONS |
4425 | -*********** |
4426 | - |
4427 | - |
4428 | -These DSN options are used to create a DSN. Each option is given like |
4429 | -\ ``option=value``\ . The options are case-sensitive, so P and p are not the |
4430 | -same option. There cannot be whitespace before or after the \ ``=``\ and |
4431 | -if the value contains whitespace it must be quoted. DSN options are |
4432 | -comma-separated. See the percona-toolkit manpage for full details. |
4433 | - |
4434 | - |
4435 | -\* A |
4436 | - |
4437 | - dsn: charset; copy: yes |
4438 | - |
4439 | - Default character set. |
4440 | - |
4441 | - |
4442 | - |
4443 | -\* D |
4444 | - |
4445 | - dsn: database; copy: yes |
4446 | - |
4447 | - Default database. |
4448 | - |
4449 | - |
4450 | - |
4451 | -\* F |
4452 | - |
4453 | - dsn: mysql_read_default_file; copy: yes |
4454 | - |
4455 | - Only read default options from the given file |
4456 | - |
4457 | - |
4458 | - |
4459 | -\* h |
4460 | - |
4461 | - dsn: host; copy: yes |
4462 | - |
4463 | - Connect to host. |
4464 | - |
4465 | - |
4466 | - |
4467 | -\* p |
4468 | - |
4469 | - dsn: password; copy: yes |
4470 | - |
4471 | - Password to use when connecting. |
4472 | - |
4473 | - |
4474 | - |
4475 | -\* P |
4476 | - |
4477 | - dsn: port; copy: yes |
4478 | - |
4479 | - Port number to use for connection. |
4480 | - |
4481 | - |
4482 | - |
4483 | -\* S |
4484 | - |
4485 | - dsn: mysql_socket; copy: yes |
4486 | - |
4487 | - Socket file to use for connection. |
4488 | - |
4489 | - |
4490 | - |
4491 | -\* u |
4492 | - |
4493 | - dsn: user; copy: yes |
4494 | - |
4495 | - User for login if not current user. |
4496 | - |
4497 | - |
4498 | - |
4499 | - |
4500 | -*********** |
4501 | -ENVIRONMENT |
4502 | -*********** |
4503 | - |
4504 | - |
4505 | -The environment variable \ ``PTDEBUG``\ enables verbose debugging output to STDERR. |
4506 | -To enable debugging and capture all output to a file, run the tool like: |
4507 | - |
4508 | - |
4509 | -.. code-block:: perl |
4510 | - |
4511 | - PTDEBUG=1 pt-duplicate-key-checker ... > FILE 2>&1 |
4512 | - |
4513 | - |
4514 | -Be careful: debugging output is voluminous and can generate several megabytes |
4515 | -of output. |
4516 | - |
4517 | - |
4518 | -******************* |
4519 | -SYSTEM REQUIREMENTS |
4520 | -******************* |
4521 | - |
4522 | - |
4523 | -You need Perl, DBI, DBD::mysql, and some core packages that ought to be |
4524 | -installed in any reasonably new version of Perl. |
4525 | - |
4526 | - |
4527 | -**** |
4528 | -BUGS |
4529 | -**** |
4530 | - |
4531 | - |
4532 | -For a list of known bugs, see `http://www.percona.com/bugs/pt-duplicate-key-checker <http://www.percona.com/bugs/pt-duplicate-key-checker>`_. |
4533 | - |
4534 | -Please report bugs at `https://bugs.launchpad.net/percona-toolkit <https://bugs.launchpad.net/percona-toolkit>`_. |
4535 | -Include the following information in your bug report: |
4536 | - |
4537 | - |
4538 | -\* Complete command-line used to run the tool |
4539 | - |
4540 | - |
4541 | - |
4542 | -\* Tool "--version" |
4543 | - |
4544 | - |
4545 | - |
4546 | -\* MySQL version of all servers involved |
4547 | - |
4548 | - |
4549 | - |
4550 | -\* Output from the tool including STDERR |
4551 | - |
4552 | - |
4553 | - |
4554 | -\* Input files (log/dump/config files, etc.) |
4555 | - |
4556 | - |
4557 | - |
4558 | -If possible, include debugging output by running the tool with \ ``PTDEBUG``\ ; |
4559 | -see "ENVIRONMENT". |
4560 | - |
4561 | - |
4562 | -*********** |
4563 | -DOWNLOADING |
4564 | -*********** |
4565 | - |
4566 | - |
4567 | -Visit `http://www.percona.com/software/percona-toolkit/ <http://www.percona.com/software/percona-toolkit/>`_ to download the |
4568 | -latest release of Percona Toolkit. Or, get the latest release from the |
4569 | -command line: |
4570 | - |
4571 | - |
4572 | -.. code-block:: perl |
4573 | - |
4574 | - wget percona.com/get/percona-toolkit.tar.gz |
4575 | - |
4576 | - wget percona.com/get/percona-toolkit.rpm |
4577 | - |
4578 | - wget percona.com/get/percona-toolkit.deb |
4579 | - |
4580 | - |
4581 | -You can also get individual tools from the latest release: |
4582 | - |
4583 | - |
4584 | -.. code-block:: perl |
4585 | - |
4586 | - wget percona.com/get/TOOL |
4587 | - |
4588 | - |
4589 | -Replace \ ``TOOL``\ with the name of any tool. |
4590 | - |
4591 | - |
4592 | -******* |
4593 | -AUTHORS |
4594 | -******* |
4595 | - |
4596 | - |
4597 | -Baron Schwartz and Daniel Nichter |
4598 | - |
4599 | - |
4600 | -********************* |
4601 | -ABOUT PERCONA TOOLKIT |
4602 | -********************* |
4603 | - |
4604 | - |
4605 | -This tool is part of Percona Toolkit, a collection of advanced command-line |
4606 | -tools developed by Percona for MySQL support and consulting. Percona Toolkit |
4607 | -was forked from two projects in June, 2011: Maatkit and Aspersa. Those |
4608 | -projects were created by Baron Schwartz and developed primarily by him and |
4609 | -Daniel Nichter, both of whom are employed by Percona. Visit |
4610 | -`http://www.percona.com/software/ <http://www.percona.com/software/>`_ for more software developed by Percona. |
4611 | - |
4612 | - |
4613 | -******************************** |
4614 | -COPYRIGHT, LICENSE, AND WARRANTY |
4615 | -******************************** |
4616 | - |
4617 | - |
4618 | -This program is copyright 2007-2011 Baron Schwartz, 2011 Percona Inc. |
4619 | -Feedback and improvements are welcome. |
4620 | - |
4621 | -THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
4622 | -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
4623 | -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
4624 | - |
4625 | -This program is free software; you can redistribute it and/or modify it under |
4626 | -the terms of the GNU General Public License as published by the Free Software |
4627 | -Foundation, version 2; OR the Perl Artistic License. On UNIX and similar |
4628 | -systems, you can issue \`man perlgpl' or \`man perlartistic' to read these |
4629 | -licenses. |
4630 | - |
4631 | -You should have received a copy of the GNU General Public License along with |
4632 | -this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
4633 | -Place, Suite 330, Boston, MA 02111-1307 USA. |
4634 | - |
4635 | - |
4636 | -******* |
4637 | -VERSION |
4638 | -******* |
4639 | - |
4640 | - |
4641 | -pt-duplicate-key-checker 1.0.1 |
4642 | - |
4643 | |
4644 | === removed file 'docs/user/pt-fifo-split.rst' |
4645 | --- docs/user/pt-fifo-split.rst 2011-09-01 16:00:38 +0000 |
4646 | +++ docs/user/pt-fifo-split.rst 1970-01-01 00:00:00 +0000 |
4647 | @@ -1,305 +0,0 @@ |
4648 | - |
4649 | -############# |
4650 | -pt-fifo-split |
4651 | -############# |
4652 | - |
4653 | -.. highlight:: perl |
4654 | - |
4655 | - |
4656 | -**** |
4657 | -NAME |
4658 | -**** |
4659 | - |
4660 | - |
4661 | -pt-fifo-split - Split files and pipe lines to a fifo without really splitting. |
4662 | - |
4663 | - |
4664 | -******** |
4665 | -SYNOPSIS |
4666 | -******** |
4667 | - |
4668 | - |
4669 | -Usage: pt-fifo-split [options] [FILE ...] |
4670 | - |
4671 | -pt-fifo-split splits FILE and pipes lines to a fifo. With no FILE, or when FILE |
4672 | -is -, read standard input. |
4673 | - |
4674 | -Read hugefile.txt in chunks of a million lines without physically splitting it: |
4675 | - |
4676 | - |
4677 | -.. code-block:: perl |
4678 | - |
4679 | - pt-fifo-split --lines 1000000 hugefile.txt |
4680 | - while [ -e /tmp/pt-fifo-split ]; do cat /tmp/pt-fifo-split; done |
4681 | - |
4682 | - |
4683 | - |
4684 | -***** |
4685 | -RISKS |
4686 | -***** |
4687 | - |
4688 | - |
4689 | -The following section is included to inform users about the potential risks, |
4690 | -whether known or unknown, of using this tool. The two main categories of risks |
4691 | -are those created by the nature of the tool (e.g. read-only tools vs. read-write |
4692 | -tools) and those created by bugs. |
4693 | - |
4694 | -pt-fifo-split creates and/or deletes the "--fifo" file. Otherwise, no other |
4695 | -files are modified, and it merely reads lines from the file given on the |
4696 | -command-line. It should be very low-risk. |
4697 | - |
4698 | -At the time of this release, we know of no bugs that could cause serious harm to |
4699 | -users. |
4700 | - |
4701 | -The authoritative source for updated information is always the online issue |
4702 | -tracking system. Issues that affect this tool will be marked as such. You can |
4703 | -see a list of such issues at the following URL: |
4704 | -`http://www.percona.com/bugs/pt-fifo-split <http://www.percona.com/bugs/pt-fifo-split>`_. |
4705 | - |
4706 | -See also "BUGS" for more information on filing bugs and getting help. |
4707 | - |
4708 | - |
4709 | -*********** |
4710 | -DESCRIPTION |
4711 | -*********** |
4712 | - |
4713 | - |
4714 | -pt-fifo-split lets you read from a file as though it contains only some of the |
4715 | -lines in the file. When you read from it again, it contains the next set of |
4716 | -lines; when you have gone all the way through it, the file disappears. This |
4717 | -works only on Unix-like operating systems. |
4718 | - |
4719 | -You can specify multiple files on the command line. If you don't specify any, |
4720 | -or if you use the special filename \ ``-``\ , lines are read from standard input. |
4721 | - |
4722 | - |
4723 | -******* |
4724 | -OPTIONS |
4725 | -******* |
4726 | - |
4727 | - |
4728 | -This tool accepts additional command-line arguments. Refer to the |
4729 | -"SYNOPSIS" and usage information for details. |
4730 | - |
4731 | - |
4732 | ---config |
4733 | - |
4734 | - type: Array |
4735 | - |
4736 | - Read this comma-separated list of config files; if specified, this must be the |
4737 | - first option on the command line. |
4738 | - |
4739 | - |
4740 | - |
4741 | ---fifo |
4742 | - |
4743 | - type: string; default: /tmp/pt-fifo-split |
4744 | - |
4745 | - The name of the fifo from which the lines can be read. |
4746 | - |
4747 | - |
4748 | - |
4749 | ---force |
4750 | - |
4751 | - Remove the fifo if it exists already, then create it again. |
4752 | - |
4753 | - |
4754 | - |
4755 | ---help |
4756 | - |
4757 | - Show help and exit. |
4758 | - |
4759 | - |
4760 | - |
4761 | ---lines |
4762 | - |
4763 | - type: int; default: 1000 |
4764 | - |
4765 | - The number of lines to read in each chunk. |
4766 | - |
4767 | - |
4768 | - |
4769 | ---offset |
4770 | - |
4771 | - type: int; default: 0 |
4772 | - |
4773 | - Begin at the Nth line. If the argument is 0, all lines are printed to the fifo. |
4774 | - If 1, then beginning at the first line, lines are printed (exactly the same as |
4775 | - 0). If 2, the first line is skipped, and the 2nd and subsequent lines are |
4776 | - printed to the fifo. |
4777 | - |
4778 | - |
4779 | - |
4780 | ---pid |
4781 | - |
4782 | - type: string |
4783 | - |
4784 | - Create the given PID file. The file contains the process ID of the script. |
4785 | - The PID file is removed when the script exits. Before starting, the script |
4786 | - checks if the PID file already exists. If it does not, then the script creates |
4787 | - and writes its own PID to it. If it does, then the script checks the following: |
4788 | - if the file contains a PID and a process is running with that PID, then |
4789 | - the script dies; or, if there is no process running with that PID, then the |
4790 | - script overwrites the file with its own PID and starts; else, if the file |
4791 | - contains no PID, then the script dies. |
4792 | - |
4793 | - |
4794 | - |
4795 | ---statistics |
4796 | - |
4797 | - Print out statistics between chunks. The statistics are the number of chunks, |
4798 | - the number of lines, elapsed time, and lines per second overall and during the |
4799 | - last chunk. |
4800 | - |
4801 | - |
4802 | - |
4803 | ---version |
4804 | - |
4805 | - Show version and exit. |
4806 | - |
4807 | - |
4808 | - |
4809 | - |
4810 | -*********** |
4811 | -ENVIRONMENT |
4812 | -*********** |
4813 | - |
4814 | - |
4815 | -The environment variable \ ``PTDEBUG``\ enables verbose debugging output to STDERR. |
4816 | -To enable debugging and capture all output to a file, run the tool like: |
4817 | - |
4818 | - |
4819 | -.. code-block:: perl |
4820 | - |
4821 | - PTDEBUG=1 pt-fifo-split ... > FILE 2>&1 |
4822 | - |
4823 | - |
4824 | -Be careful: debugging output is voluminous and can generate several megabytes |
4825 | -of output. |
4826 | - |
4827 | - |
4828 | -******************* |
4829 | -SYSTEM REQUIREMENTS |
4830 | -******************* |
4831 | - |
4832 | - |
4833 | -You need Perl, DBI, DBD::mysql, and some core packages that ought to be |
4834 | -installed in any reasonably new version of Perl. |
4835 | - |
4836 | - |
4837 | -**** |
4838 | -BUGS |
4839 | -**** |
4840 | - |
4841 | - |
4842 | -For a list of known bugs, see `http://www.percona.com/bugs/pt-fifo-split <http://www.percona.com/bugs/pt-fifo-split>`_. |
4843 | - |
4844 | -Please report bugs at `https://bugs.launchpad.net/percona-toolkit <https://bugs.launchpad.net/percona-toolkit>`_. |
4845 | -Include the following information in your bug report: |
4846 | - |
4847 | - |
4848 | -\* Complete command-line used to run the tool |
4849 | - |
4850 | - |
4851 | - |
4852 | -\* Tool "--version" |
4853 | - |
4854 | - |
4855 | - |
4856 | -\* MySQL version of all servers involved |
4857 | - |
4858 | - |
4859 | - |
4860 | -\* Output from the tool including STDERR |
4861 | - |
4862 | - |
4863 | - |
4864 | -\* Input files (log/dump/config files, etc.) |
4865 | - |
4866 | - |
4867 | - |
4868 | -If possible, include debugging output by running the tool with \ ``PTDEBUG``\ ; |
4869 | -see "ENVIRONMENT". |
4870 | - |
4871 | - |
4872 | -*********** |
4873 | -DOWNLOADING |
4874 | -*********** |
4875 | - |
4876 | - |
4877 | -Visit `http://www.percona.com/software/percona-toolkit/ <http://www.percona.com/software/percona-toolkit/>`_ to download the |
4878 | -latest release of Percona Toolkit. Or, get the latest release from the |
4879 | -command line: |
4880 | - |
4881 | - |
4882 | -.. code-block:: perl |
4883 | - |
4884 | - wget percona.com/get/percona-toolkit.tar.gz |
4885 | - |
4886 | - wget percona.com/get/percona-toolkit.rpm |
4887 | - |
4888 | - wget percona.com/get/percona-toolkit.deb |
4889 | - |
4890 | - |
4891 | -You can also get individual tools from the latest release: |
4892 | - |
4893 | - |
4894 | -.. code-block:: perl |
4895 | - |
4896 | - wget percona.com/get/TOOL |
4897 | - |
4898 | - |
4899 | -Replace \ ``TOOL``\ with the name of any tool. |
4900 | - |
4901 | - |
4902 | -******* |
4903 | -AUTHORS |
4904 | -******* |
4905 | - |
4906 | - |
4907 | -Baron Schwartz |
4908 | - |
4909 | - |
4910 | -********************* |
4911 | -ABOUT PERCONA TOOLKIT |
4912 | -********************* |
4913 | - |
4914 | - |
4915 | -This tool is part of Percona Toolkit, a collection of advanced command-line |
4916 | -tools developed by Percona for MySQL support and consulting. Percona Toolkit |
4917 | -was forked from two projects in June, 2011: Maatkit and Aspersa. Those |
4918 | -projects were created by Baron Schwartz and developed primarily by him and |
4919 | -Daniel Nichter, both of whom are employed by Percona. Visit |
4920 | -`http://www.percona.com/software/ <http://www.percona.com/software/>`_ for more software developed by Percona. |
4921 | - |
4922 | - |
4923 | -******************************** |
4924 | -COPYRIGHT, LICENSE, AND WARRANTY |
4925 | -******************************** |
4926 | - |
4927 | - |
4928 | -This program is copyright 2007-2011 Baron Schwartz, 2011 Percona Inc. |
4929 | -Feedback and improvements are welcome. |
4930 | - |
4931 | -THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
4932 | -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
4933 | -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
4934 | - |
4935 | -This program is free software; you can redistribute it and/or modify it under |
4936 | -the terms of the GNU General Public License as published by the Free Software |
4937 | -Foundation, version 2; OR the Perl Artistic License. On UNIX and similar |
4938 | -systems, you can issue \`man perlgpl' or \`man perlartistic' to read these |
4939 | -licenses. |
4940 | - |
4941 | -You should have received a copy of the GNU General Public License along with |
4942 | -this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
4943 | -Place, Suite 330, Boston, MA 02111-1307 USA. |
4944 | - |
4945 | - |
4946 | -******* |
4947 | -VERSION |
4948 | -******* |
4949 | - |
4950 | - |
4951 | -pt-fifo-split 1.0.1 |
4952 | - |
4953 | |
4954 | === removed file 'docs/user/pt-find.rst' |
4955 | --- docs/user/pt-find.rst 2011-09-01 16:00:38 +0000 |
4956 | +++ docs/user/pt-find.rst 1970-01-01 00:00:00 +0000 |
4957 | @@ -1,977 +0,0 @@ |
4958 | - |
4959 | -####### |
4960 | -pt-find |
4961 | -####### |
4962 | - |
4963 | -.. highlight:: perl |
4964 | - |
4965 | - |
4966 | -**** |
4967 | -NAME |
4968 | -**** |
4969 | - |
4970 | - |
4971 | -pt-find - Find MySQL tables and execute actions, like GNU find. |
4972 | - |
4973 | - |
4974 | -******** |
4975 | -SYNOPSIS |
4976 | -******** |
4977 | - |
4978 | - |
4979 | -Usage: pt-find [OPTION...] [DATABASE...] |
4980 | - |
4981 | -pt-find searches for MySQL tables and executes actions, like GNU find. The |
4982 | -default action is to print the database and table name. |
4983 | - |
4984 | -Find all tables created more than a day ago, which use the MyISAM engine, and |
4985 | -print their names: |
4986 | - |
4987 | - |
4988 | -.. code-block:: perl |
4989 | - |
4990 | - pt-find --ctime +1 --engine MyISAM |
4991 | - |
4992 | - |
4993 | -Find InnoDB tables that haven't been updated in a month, and convert them to |
4994 | -MyISAM storage engine (data warehousing, anyone?): |
4995 | - |
4996 | - |
4997 | -.. code-block:: perl |
4998 | - |
4999 | - pt-find --mtime +30 --engine InnoDB --exec "ALTER TABLE %D.%N ENGINE=MyISAM" |
5000 | - |
The diff has been truncated for viewing.