热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

PerconaToolkit命令聚合工具,Mysql不可或缺的必备利器之一

PerconaToolkitforMySQLisacollectionofadvancedcommand-linetoolsusedbyPerconaMySQLsupportsta

Percona-Toolkit命令集合工具,mysql不可或缺的必备利器之一

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/ 

相关配置如下:

[[email protected] 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]  [[email protected] 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 [[email protected] local]#

欢迎大家阅读《Percona-Toolkit命令聚合工具,Mysql不可或缺的必备利器之一》,跪求各位点评,by

然后进行相关的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工具;

[[email protected] 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 [[email protected] local]# cd percona-toolkit-2.2.1 [[email protected] 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 [[email protected] 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 [[email protected] percona-toolkit-2.2.1]#
[[email protected] 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 [[email protected] percona-toolkit-2.2.1]#  

然后就可以使用各种包里的相关命令集合了,呵呵,比如:

pt-duplicate-key-checker,pt-online-schema-change,pt-query-advisor,pt-show-grants,pt-upgrade等等各种命令!

[[email protected] 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 [[email protected] 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 [[email protected] percona-toolkit-2.2.1]#

1楼songxixi8小时前
http://www.mysqlpub.com/thread-31990-1-1.htmln以上是相关的pt工具命令的集合!请查看!


推荐阅读
  • 本文介绍了Hyperledger Fabric外部链码构建与运行的相关知识,包括在Hyperledger Fabric 2.0版本之前链码构建和运行的困难性,外部构建模式的实现原理以及外部构建和运行API的使用方法。通过本文的介绍,读者可以了解到如何利用外部构建和运行的方式来实现链码的构建和运行,并且不再受限于特定的语言和部署环境。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • t-io 2.0.0发布-法网天眼第一版的回顾和更新说明
    本文回顾了t-io 1.x版本的工程结构和性能数据,并介绍了t-io在码云上的成绩和用户反馈。同时,还提到了@openSeLi同学发布的t-io 30W长连接并发压力测试报告。最后,详细介绍了t-io 2.0.0版本的更新内容,包括更简洁的使用方式和内置的httpsession功能。 ... [详细]
  • 图解redis的持久化存储机制RDB和AOF的原理和优缺点
    本文通过图解的方式介绍了redis的持久化存储机制RDB和AOF的原理和优缺点。RDB是将redis内存中的数据保存为快照文件,恢复速度较快但不支持拉链式快照。AOF是将操作日志保存到磁盘,实时存储数据但恢复速度较慢。文章详细分析了两种机制的优缺点,帮助读者更好地理解redis的持久化存储策略。 ... [详细]
  • http:my.oschina.netleejun2005blog136820刚看到群里又有同学在说HTTP协议下的Get请求参数长度是有大小限制的,最大不能超过XX ... [详细]
  • 如何在服务器主机上实现文件共享的方法和工具
    本文介绍了在服务器主机上实现文件共享的方法和工具,包括Linux主机和Windows主机的文件传输方式,Web运维和FTP/SFTP客户端运维两种方式,以及使用WinSCP工具将文件上传至Linux云服务器的操作方法。此外,还介绍了在迁移过程中需要安装迁移Agent并输入目的端服务器所在华为云的AK/SK,以及主机迁移服务会收集的源端服务器信息。 ... [详细]
  • 单点登录原理及实现方案详解
    本文详细介绍了单点登录的原理及实现方案,其中包括共享Session的方式,以及基于Redis的Session共享方案。同时,还分享了作者在应用环境中所遇到的问题和经验,希望对读者有所帮助。 ... [详细]
  • 本文详细介绍了如何使用MySQL来显示SQL语句的执行时间,并通过MySQL Query Profiler获取CPU和内存使用量以及系统锁和表锁的时间。同时介绍了效能分析的三种方法:瓶颈分析、工作负载分析和基于比率的分析。 ... [详细]
  • 本文讨论了如何在codeigniter中识别来自angularjs的请求,并提供了两种方法的代码示例。作者尝试了$this->input->is_ajax_request()和自定义函数is_ajax(),但都没有成功。最后,作者展示了一个ajax请求的示例代码。 ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • uniapp开发H5解决跨域问题的两种代理方法
    本文介绍了uniapp开发H5解决跨域问题的两种代理方法,分别是在manifest.json文件和vue.config.js文件中设置代理。通过设置代理根域名和配置路径别名,可以实现H5页面的跨域访问。同时还介绍了如何开启内网穿透,让外网的人可以访问到本地调试的H5页面。 ... [详细]
  • 本文介绍了一个React Native新手在尝试将数据发布到服务器时遇到的问题,以及他的React Native代码和服务器端代码。他使用fetch方法将数据发送到服务器,但无法在服务器端读取/获取发布的数据。 ... [详细]
  • Java 11相对于Java 8,OptaPlanner性能提升有多大?
    本文通过基准测试比较了Java 11和Java 8对OptaPlanner的性能提升。测试结果表明,在相同的硬件环境下,Java 11相对于Java 8在垃圾回收方面表现更好,从而提升了OptaPlanner的性能。 ... [详细]
  • 如何利用 Myflash 解析 binlog ?
    本文主要介绍了对Myflash的测试,从准备测试环境到利用Myflash解析binl ... [详细]
  • 本文介绍了禅道作为一款国产开源免费的测试管理工具的特点和功能,并提供了禅道的搭建和调试方法。禅道是一款B/S结构的项目管理工具,可以实现组织管理、后台管理、产品管理、项目管理和测试管理等功能。同时,本文还介绍了其他软件测试相关工具,如功能自动化工具和性能自动化工具,以及白盒测试工具的使用。通过本文的阅读,读者可以了解禅道的基本使用方法和优势,从而更好地进行测试管理工作。 ... [详细]
author-avatar
ChinaSpecial
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有