Percona Toolkit for MySQL is a collection of advanced command-line tools used by Percona MySQL support staff to perform a variety of MySQL server and system tasks that are too difficult or complex to perform manually, including:
1.对主从复制数据的一致性校验;
2.有效的对相关的行数据进行归档操作;
3.查到相关的重复的索引;
4.归总大批量Mysql服务的维护运维工作;
5.问题发生时收集重要的系统信息;
官网项目地址;
http://www.percona.com/software/percona-toolkit/
相关配置如下:
[root@Slave02 local]# wget percona.com/get/percona-toolkit.tar.gz
--2013-04-01 13:20:06-- http://percona.com/get/percona-toolkit.tar.gz
Resolving percona.com... 74.121.199.234
Connecting to percona.com|74.121.199.234|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.percona.com/get/percona-toolkit.tar.gz [following]
--2013-04-01 13:20:07-- http://www.percona.com/get/percona-toolkit.tar.gz
Resolving www.percona.com... 74.121.199.234
Reusing existing connection to percona.com:80.
HTTP request sent, awaiting response... 302 Found
Location: http://www.percona.com/downloads/percona-toolkit/2.2.1/percona-toolkit-2.2.1.tar.gz [following]
--2013-04-01 13:20:08-- http://www.percona.com/downloads/percona-toolkit/2.2.1/percona-toolkit-2.2.1.tar.gz
Reusing existing connection to percona.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 1343968 (1.3M) [application/x-gzip]
Saving to: `percona-toolkit-2.2.1.tar.gz'
100%[======================================>] 1,343,968 26.9K/s in 76s
2013-04-01 13:21:24 (17.3 KB/s) - `percona-toolkit-2.2.1.tar.gz' saved [1343968/1343968]
[root@Slave02 local]# ls
bin mysql
cmake-2.8.5 mysqlsla-2.03
doc mysqlsla-2.03.tar.gz
etc percona-toolkit-2.2.1.tar.gz
games puppetlabs-release-6-1.noarch.rpm
include sbin
innotop-1.8.1 share
innotop-1.8.1.tar.gz software
lib src
libexec xtrabackup-1.6.2
man xtrabackup-1.6.2.tar.gz
[root@Slave02 local]#
然后进行相关的perl配置包文件,如下:
进入cpan对其进行安装
#perl -MCPAN -e shell
cpan>install DBI
cpan>install DBD::mysql
cpan>install CGI
cpan[3]> install CGI
Running install for module 'CGI'
Running make for M/MA/MARKSTOS/CGI.pm-3.63.tar.gz
Fetching with LWP:
http://mirrors.sohu.com/CPAN/authors/id/M/MA/MARKSTOS/CGI.pm-3.63.tar.gz
Fetching with LWP:
http://mirrors.sohu.com/CPAN/authors/id/M/MA/MARKSTOS/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/M/MA/MARKSTOS/CGI.pm-3.63.tar.gz ok
CPAN.pm: Building M/MA/MARKSTOS/CGI.pm-3.63.tar.gz
Checking if your kit is complete...
Looks good
Warning: prerequisite FCGI 0.67 not found.
Writing Makefile for CGI
Writing MYMETA.yml and MYMETA.json
---- Unsatisfied dependencies detected during ----
---- MARKSTOS/CGI.pm-3.63.tar.gz ----
FCGI [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes] yes
Running make test
Delayed until after prerequisites
Running make install
Delayed until after prerequisites
Running install for module 'FCGI'
Running make for F/FL/FLORA/FCGI-0.74.tar.gz
Fetching with LWP:
http://mirrors.sohu.com/CPAN/authors/id/F/FL/FLORA/FCGI-0.74.tar.gz
Fetching with LWP:
http://mirrors.sohu.com/CPAN/authors/id/F/FL/FLORA/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/F/FL/FLORA/FCGI-0.74.tar.gz ok
CPAN.pm: Building F/FL/FLORA/FCGI-0.74.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for FCGI
Writing MYMETA.yml and MYMETA.json
Running ./configure for you
Please read configure.readme for information on how to run it yourself
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for ssize_t... yes
checking for sun_len in sys/un.h... no
checking for fpos_t in stdio.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for unistd.h... (cached) yes
checking for a fileno() prototype in stdio.h... yes
checking whether cross-process locking is required by accept()... no
checking whether va_arg(arg, long double) crashes the compiler... no
checking for an ANSI C-conforming const... yes
configure: creating ./config.status
config.status: creating fcgi_config.h
/usr/bin/perl FCGI.PL FCGI.pm
Generating FCGI.pm
cp FCGI.pm blib/arch/FCGI.pm
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" FCGI.XL FCGI.xs
Generating FCGI.xs for Perl version 5.008008
/usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap FCGI.xs > FCGI.xsc && mv FCGI.xsc FCGI.c
gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DVERSION=\"0.74\" -DXS_VERSION=\"0.74\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE" FCGI.c
FCGI.xs: In function 釬CGI_Finish?
FCGI.xs:187: warning: suggest parentheses around assignment used as truth value
FCGI.c: In function 釾S_FCGI__Stream_WRITE?
FCGI.c:674: warning: unused variable 鈚arg?
FCGI.c:673: warning: unused variable 釸ETVAL?
FCGI.c: In function 釾S_FCGI__Stream_GETC?
FCGI.c:775: warning: unused variable 釸ETVAL?
gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DVERSION=\"0.74\" -DXS_VERSION=\"0.74\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE" fcgiapp.c
gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DVERSION=\"0.74\" -DXS_VERSION=\"0.74\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE" os_unix.c
os_unix.c: In function 釵S_Accept?
os_unix.c:1169: warning: pointer targets in passing argument 3 of 鈇ccept?differ in signedness
os_unix.c: In function 釵S_IsFcgi?
os_unix.c:1269: warning: pointer targets in passing argument 3 of 鈍etpeername?differ in signedness
Running Mkbootstrap for FCGI ()
chmod 644 FCGI.bs
rm -f blib/arch/auto/FCGI/FCGI.so
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -L/usr/local/lib FCGI.o fcgiapp.o os_unix.o -o blib/arch/auto/FCGI/FCGI.so \
\
chmod 755 blib/arch/auto/FCGI/FCGI.so
cp FCGI.bs blib/arch/auto/FCGI/FCGI.bs
chmod 644 blib/arch/auto/FCGI/FCGI.bs
Manifying blib/man3/FCGI.3pm
FCGI.pm:306: Unknown command paragraph "=HEAD1 LIMITATIONS"
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" echo.PL echo.fpl
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" remote.PL remote.fpl
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" threaded.PL threaded.fpl
FLORA/FCGI-0.74.tar.gz
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
1..1
# Running under perl version 5.008008 for linux
# Current time local: Mon Apr 1 13:40:50 2013
# Current time GMT: Mon Apr 1 05:40:50 2013
# Using Test.pm version 1.25
ok 1
FLORA/FCGI-0.74.tar.gz
/usr/bin/make test -- OK
Running make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/FCGI.pm
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/FCGI/FCGI.bs
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/FCGI/FCGI.so
Installing /usr/share/man/man3/FCGI.3pm
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
FLORA/FCGI-0.74.tar.gz
/usr/bin/make install -- OK
Running make for M/MA/MARKSTOS/CGI.pm-3.63.tar.gz
Has already been unwrapped into directory /root/.cpan/build/CGI.pm-3.63-dl05L8
CPAN.pm: Building M/MA/MARKSTOS/CGI.pm-3.63.tar.gz
cp lib/CGI/Switch.pm blib/lib/CGI/Switch.pm
cp lib/CGI/Cookie.pm blib/lib/CGI/Cookie.pm
cp lib/CGI/Pretty.pm blib/lib/CGI/Pretty.pm
cp lib/CGI.pm blib/lib/CGI.pm
cp lib/CGI/Carp.pm blib/lib/CGI/Carp.pm
cp lib/CGI/Apache.pm blib/lib/CGI/Apache.pm
cp lib/CGI/Util.pm blib/lib/CGI/Util.pm
cp lib/CGI/Push.pm blib/lib/CGI/Push.pm
cp lib/CGI/Fast.pm blib/lib/CGI/Fast.pm
Manifying blib/man3/CGI::Switch.3pm
Manifying blib/man3/CGI::Cookie.3pm
Manifying blib/man3/CGI::Pretty.3pm
Manifying blib/man3/CGI.3pm
Manifying blib/man3/CGI::Carp.3pm
Manifying blib/man3/CGI::Apache.3pm
Manifying blib/man3/CGI::Util.3pm
Manifying blib/man3/CGI::Push.3pm
Manifying blib/man3/CGI::Fast.3pm
MARKSTOS/CGI.pm-3.63.tar.gz
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/headers/*.t
t/apache.t ............... ok
t/autoescape.t ........... ok
t/can.t .................. ok
t/carp.t ................. ok
t/charset.t .............. ok
t/checkbox_group.t ....... ok
t/cookie.t ............... ok
t/delete.t ............... ok
t/Dump.t ................. ok
t/end_form.t ............. ok
t/fast.t ................. ok
t/form.t ................. ok
t/function.t ............. ok
t/headers.t .............. ok
t/hidden.t ............... ok
t/html.t ................. ok
t/http.t ................. ok
t/init.t ................. ok
t/multipart_init.t ....... ok
t/no_tabindex.t .......... ok
t/param_fetch.t .......... ok
t/popup_menu.t ........... ok
t/pretty.t ............... ok
t/push.t ................. ok
t/query_string.t ......... ok
t/request.t .............. ok
t/rt-52469.t ............. ok
t/save_read_roundtrip.t .. ok
t/start_end_asterisk.t ... ok
t/start_end_end.t ........ ok
t/start_end_start.t ...... ok
t/switch.t ............... ok
t/tmpdir.t ............... skipped: Root can write to 'unwritable files', so many of these tests don't make sense for root.
t/unescapeHTML.t ......... ok
t/upload.t ............... ok
t/uploadInfo.t ........... ok
t/url.t .................. 1/? Use of uninitialized value in scalar assignment at t/url.t line 28.
Use of uninitialized value in scalar assignment at t/url.t line 29.
Use of uninitialized value in scalar assignment at t/url.t line 30.
Use of uninitialized value in scalar assignment at t/url.t line 31.
t/url.t .................. ok
t/user_agent.t ........... ok
t/utf8.t ................. ok
t/util-58.t .............. ok
t/util.t ................. ok
All tests successful.
Files=41, Tests=700, 2 wallclock secs ( 0.15 usr 0.02 sys + 1.20 cusr 0.13 csys = 1.50 CPU)
Result: PASS
MARKSTOS/CGI.pm-3.63.tar.gz
/usr/bin/make test -- OK
Running make install
Installing /usr/lib/perl5/5.8.8/CGI.pm
Installing /usr/lib/perl5/5.8.8/CGI/Switch.pm
Installing /usr/lib/perl5/5.8.8/CGI/Push.pm
Installing /usr/lib/perl5/5.8.8/CGI/Apache.pm
Installing /usr/lib/perl5/5.8.8/CGI/Fast.pm
Installing /usr/lib/perl5/5.8.8/CGI/Pretty.pm
Installing /usr/lib/perl5/5.8.8/CGI/Util.pm
Installing /usr/lib/perl5/5.8.8/CGI/Carp.pm
Installing /usr/lib/perl5/5.8.8/CGI/Cookie.pm
Installing /usr/share/man/man3/CGI::Apache.3pm
Installing /usr/share/man/man3/CGI::Cookie.3pm
Installing /usr/share/man/man3/CGI::Fast.3pm
Installing /usr/share/man/man3/CGI::Push.3pm
Installing /usr/share/man/man3/CGI::Util.3pm
Installing /usr/share/man/man3/CGI::Pretty.3pm
Installing /usr/share/man/man3/CGI.3pm
Installing /usr/share/man/man3/CGI::Switch.3pm
Installing /usr/share/man/man3/CGI::Carp.3pm
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
MARKSTOS/CGI.pm-3.63.tar.gz
/usr/bin/make install -- OK
cpan[4]>
然后开始编译相关的percona-toolkit工具;
[root@Slave02 local]# tar zxvf percona-toolkit-2.2.1.tar.gz
percona-toolkit-2.2.1/
percona-toolkit-2.2.1/README
percona-toolkit-2.2.1/COPYING
percona-toolkit-2.2.1/Makefile.PL
percona-toolkit-2.2.1/lib/
percona-toolkit-2.2.1/MANIFEST
percona-toolkit-2.2.1/INSTALL
percona-toolkit-2.2.1/bin/
percona-toolkit-2.2.1/bin/pt-query-digest
percona-toolkit-2.2.1/bin/pt-archiver
percona-toolkit-2.2.1/bin/pt-index-usage
percona-toolkit-2.2.1/bin/pt-mysql-summary
percona-toolkit-2.2.1/bin/pt-table-checksum
percona-toolkit-2.2.1/bin/pt-visual-explain
percona-toolkit-2.2.1/bin/pt-show-grants
percona-toolkit-2.2.1/bin/pt-ioprofile
percona-toolkit-2.2.1/bin/pt-fifo-split
percona-toolkit-2.2.1/bin/pt-kill
percona-toolkit-2.2.1/bin/pt-align
percona-toolkit-2.2.1/bin/pt-slave-restart
percona-toolkit-2.2.1/bin/pt-slave-find
percona-toolkit-2.2.1/bin/pt-table-usage
percona-toolkit-2.2.1/bin/pt-fk-error-logger
percona-toolkit-2.2.1/bin/pt-online-schema-change
percona-toolkit-2.2.1/bin/pt-upgrade
percona-toolkit-2.2.1/bin/pt-heartbeat
percona-toolkit-2.2.1/bin/pt-config-diff
percona-toolkit-2.2.1/bin/pt-slave-delay
percona-toolkit-2.2.1/bin/pt-duplicate-key-checker
percona-toolkit-2.2.1/bin/pt-find
percona-toolkit-2.2.1/bin/pt-sift
percona-toolkit-2.2.1/bin/pt-pmp
percona-toolkit-2.2.1/bin/pt-deadlock-logger
percona-toolkit-2.2.1/bin/pt-variable-advisor
percona-toolkit-2.2.1/bin/pt-stalk
percona-toolkit-2.2.1/bin/pt-fingerprint
percona-toolkit-2.2.1/bin/pt-summary
percona-toolkit-2.2.1/bin/pt-table-sync
percona-toolkit-2.2.1/bin/pt-mext
percona-toolkit-2.2.1/bin/pt-diskstats
percona-toolkit-2.2.1/Changelog
percona-toolkit-2.2.1/docs/
percona-toolkit-2.2.1/docs/percona-toolkit.pod
[root@Slave02 local]# cd percona-toolkit-2.2.1
[root@Slave02 percona-toolkit-2.2.1]# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for percona-toolkit
Writing MYMETA.yml and MYMETA.json
[root@Slave02 percona-toolkit-2.2.1]# make
cp bin/pt-mysql-summary blib/script/pt-mysql-summary
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-mysql-summary
cp bin/pt-pmp blib/script/pt-pmp
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-pmp
cp bin/pt-kill blib/script/pt-kill
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-kill
cp bin/pt-online-schema-change blib/script/pt-online-schema-change
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-online-schema-change
cp bin/pt-align blib/script/pt-align
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-align
cp bin/pt-heartbeat blib/script/pt-heartbeat
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-heartbeat
cp bin/pt-table-sync blib/script/pt-table-sync
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-table-sync
cp bin/pt-upgrade blib/script/pt-upgrade
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-upgrade
cp bin/pt-table-usage blib/script/pt-table-usage
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-table-usage
cp bin/pt-slave-delay blib/script/pt-slave-delay
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-slave-delay
cp bin/pt-sift blib/script/pt-sift
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-sift
cp bin/pt-fifo-split blib/script/pt-fifo-split
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-fifo-split
cp bin/pt-slave-find blib/script/pt-slave-find
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-slave-find
cp bin/pt-ioprofile blib/script/pt-ioprofile
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-ioprofile
cp bin/pt-diskstats blib/script/pt-diskstats
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-diskstats
cp bin/pt-find blib/script/pt-find
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-find
cp bin/pt-archiver blib/script/pt-archiver
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-archiver
cp bin/pt-deadlock-logger blib/script/pt-deadlock-logger
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-deadlock-logger
cp bin/pt-fingerprint blib/script/pt-fingerprint
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-fingerprint
cp bin/pt-visual-explain blib/script/pt-visual-explain
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-visual-explain
cp bin/pt-variable-advisor blib/script/pt-variable-advisor
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-variable-advisor
cp bin/pt-mext blib/script/pt-mext
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-mext
cp bin/pt-index-usage blib/script/pt-index-usage
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-index-usage
cp bin/pt-slave-restart blib/script/pt-slave-restart
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-slave-restart
cp bin/pt-summary blib/script/pt-summary
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-summary
cp bin/pt-duplicate-key-checker blib/script/pt-duplicate-key-checker
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-duplicate-key-checker
cp bin/pt-fk-error-logger blib/script/pt-fk-error-logger
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-fk-error-logger
cp bin/pt-table-checksum blib/script/pt-table-checksum
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-table-checksum
cp bin/pt-query-digest blib/script/pt-query-digest
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-query-digest
cp bin/pt-show-grants blib/script/pt-show-grants
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-show-grants
cp bin/pt-config-diff blib/script/pt-config-diff
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-config-diff
cp bin/pt-stalk blib/script/pt-stalk
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pt-stalk
Manifying blib/man1/pt-mysql-summary.1p
Manifying blib/man1/pt-kill.1p
Manifying blib/man1/pt-online-schema-change.1p
Manifying blib/man1/pt-table-sync.1p
Manifying blib/man1/pt-upgrade.1p
Manifying blib/man1/pt-table-usage.1p
Manifying blib/man1/pt-fifo-split.1p
Manifying blib/man1/pt-slave-find.1p
Manifying blib/man1/pt-ioprofile.1p
Manifying blib/man1/pt-find.1p
Manifying blib/man1/pt-archiver.1p
Manifying blib/man1/pt-deadlock-logger.1p
Manifying blib/man1/pt-fingerprint.1p
Manifying blib/man1/pt-mext.1p
Manifying blib/man1/pt-slave-restart.1p
Manifying blib/man1/pt-summary.1p
Manifying blib/man1/pt-fk-error-logger.1p
Manifying blib/man1/pt-table-checksum.1p
Manifying blib/man1/pt-query-digest.1p
Manifying blib/man1/pt-show-grants.1p
Manifying blib/man1/percona-toolkit.1p
Manifying blib/man1/pt-pmp.1p
Manifying blib/man1/pt-align.1p
Manifying blib/man1/pt-heartbeat.1p
Manifying blib/man1/pt-slave-delay.1p
Manifying blib/man1/pt-sift.1p
Manifying blib/man1/pt-diskstats.1p
Manifying blib/man1/pt-visual-explain.1p
Manifying blib/man1/pt-variable-advisor.1p
Manifying blib/man1/pt-index-usage.1p
Manifying blib/man1/pt-duplicate-key-checker.1p
Manifying blib/man1/pt-config-diff.1p
Manifying blib/man1/pt-stalk.1p
[root@Slave02 percona-toolkit-2.2.1]#
[root@Slave02 percona-toolkit-2.2.1]# make install
Installing /usr/share/man/man1/pt-pmp.1p
Installing /usr/share/man/man1/pt-upgrade.1p
Installing /usr/share/man/man1/pt-fk-error-logger.1p
Installing /usr/share/man/man1/pt-visual-explain.1p
Installing /usr/share/man/man1/pt-ioprofile.1p
Installing /usr/share/man/man1/pt-fifo-split.1p
Installing /usr/share/man/man1/pt-heartbeat.1p
Installing /usr/share/man/man1/pt-table-sync.1p
Installing /usr/share/man/man1/pt-slave-restart.1p
Installing /usr/share/man/man1/pt-align.1p
Installing /usr/share/man/man1/pt-find.1p
Installing /usr/share/man/man1/pt-summary.1p
Installing /usr/share/man/man1/pt-slave-find.1p
Installing /usr/share/man/man1/pt-fingerprint.1p
Installing /usr/share/man/man1/pt-show-grants.1p
Installing /usr/share/man/man1/pt-duplicate-key-checker.1p
Installing /usr/share/man/man1/pt-config-diff.1p
Installing /usr/share/man/man1/pt-variable-advisor.1p
Installing /usr/share/man/man1/pt-kill.1p
Installing /usr/share/man/man1/pt-sift.1p
Installing /usr/share/man/man1/pt-diskstats.1p
Installing /usr/share/man/man1/pt-online-schema-change.1p
Installing /usr/share/man/man1/pt-stalk.1p
Installing /usr/share/man/man1/pt-slave-delay.1p
Installing /usr/share/man/man1/pt-table-checksum.1p
Installing /usr/share/man/man1/pt-deadlock-logger.1p
Installing /usr/share/man/man1/pt-index-usage.1p
Installing /usr/share/man/man1/pt-mext.1p
Installing /usr/share/man/man1/pt-table-usage.1p
Installing /usr/share/man/man1/percona-toolkit.1p
Installing /usr/share/man/man1/pt-archiver.1p
Installing /usr/share/man/man1/pt-mysql-summary.1p
Installing /usr/share/man/man1/pt-query-digest.1p
Installing /usr/bin/pt-online-schema-change
Installing /usr/bin/pt-table-usage
Installing /usr/bin/pt-sift
Installing /usr/bin/pt-archiver
Installing /usr/bin/pt-visual-explain
Installing /usr/bin/pt-heartbeat
Installing /usr/bin/pt-query-digest
Installing /usr/bin/pt-find
Installing /usr/bin/pt-config-diff
Installing /usr/bin/pt-table-sync
Installing /usr/bin/pt-fk-error-logger
Installing /usr/bin/pt-mext
Installing /usr/bin/pt-mysql-summary
Installing /usr/bin/pt-duplicate-key-checker
Installing /usr/bin/pt-table-checksum
Installing /usr/bin/pt-stalk
Installing /usr/bin/pt-show-grants
Installing /usr/bin/pt-ioprofile
Installing /usr/bin/pt-diskstats
Installing /usr/bin/pt-variable-advisor
Installing /usr/bin/pt-summary
Installing /usr/bin/pt-index-usage
Installing /usr/bin/pt-slave-find
Installing /usr/bin/pt-slave-restart
Installing /usr/bin/pt-kill
Installing /usr/bin/pt-upgrade
Installing /usr/bin/pt-deadlock-logger
Installing /usr/bin/pt-slave-delay
Installing /usr/bin/pt-fifo-split
Installing /usr/bin/pt-align
Installing /usr/bin/pt-pmp
Installing /usr/bin/pt-fingerprint
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
[root@Slave02 percona-toolkit-2.2.1]#
然后就可以使用各种包里的相关命令集合了,呵呵,比如:
pt-duplicate-key-checker,pt-online-schema-change,pt-query-advisor,pt-show-grants,pt-upgrade等等各种命令!
[root@Slave02 percona-toolkit-2.2.1]# pt-duplicate-key-checker --host=localhost
--user=root --password=root --databases=prod
# ########################################################################
# prod.customers
# ########################################################################
# customer_name_i is a duplicate of sss
# Key definitions:
# KEY `customer_name_i` (`CUSTOMER_NAME`),
# KEY `sss` (`CUSTOMER_NAME`)
# Column types:
# `customer_name` varchar(40) not null
# To remove this duplicate index, execute:
ALTER TABLE `prod`.`customers` DROP INDEX `customer_name_i`;
# ########################################################################
# Summary of indexes
# ########################################################################
# Size Duplicate Indexes 4238388
# Total Duplicate Indexes 1
# Total Indexes 15
[root@Slave02 percona-toolkit-2.2.1]# pt-duplicate-key-checker --host=localhost
--user=root --password=root --databases=book
# ########################################################################
# book.artist
# ########################################################################
# type is a left-prefix of type_2
# Key definitions:
# KEY `type` (`type`),
# KEY `type_2` (`type`,`gender`,`country_id`),
# Column types:
# `type` enum('band','person','unknown','combination') not null
# `gender` enum('male','female') default null
# `country_id` smallint(5) unsigned default null
# To remove this duplicate index, execute:
ALTER TABLE `book`.`artist` DROP INDEX `type`;
# ########################################################################
# Summary of indexes
# ########################################################################
# Size Duplicate Indexes 582368
# Total Duplicate Indexes 1
# Total Indexes 7
[root@Slave02 percona-toolkit-2.2.1]#