Use of monitoring tools in Percona Toolkit series

Source: Internet
Author: User
Tags percona

Use of monitoring tools in percona-toolkit series

1. pt-deadlock-logger

Function introduction:

Extract and record mysql deadlock Information

Usage:

Pt-deadlock-logger [OPTION...] SOURCE_DSN

Collect and save the latest deadlock information on mysql. You can directly print the deadlock information and store the deadlock information to the database, the deadlock information includes the server where the deadlock occurred, the time when the deadlock occurred recently, the deadlock thread id, the deadlock transaction id, and the time when the deadlock occurs. For details, see the following example.

Example:

Example 1: print the deadlock information of the local mysql instance.

Pt-deadlock-logger -- user = root -- password = zhang @ 123 h = localhost-print

Example 2: record the local mysql deadlock information to the database table and print it out.

Pt-deadlock-logger -- user = root -- password = zhang @ 123 h = localhost -- print D = test, t = deadlocks

2. pt-fk-error-logger

Function introduction:

Extract and record mysql foreign key error messages

Usage:

Pt-fk-error-logger [OPTION...] SOURCE_DSN

Use show innodb status to extract and save the most recent foreign key error messages of the mysql database. You can use Parameter Control to print error messages directly or store error messages in database tables.

Example:

When running on the server, I always reported the following error:

Use of uninitialized value in concatenation (.) or string at/usr/bin/pt-fk-error-logger line 2045

I suspect there is a problem with this program. Try another version or debug the program.

3. pt-mext

Function introduction:

View the information of multiple samples of show global status in parallel.

Usage:

Pt-mext [OPTIONS] -- COMMAND

Principle: pt-mext executes the COMMAND you specified, reads a row of results each time, saves the empty row split content to a temporary file, and finally displays the results in parallel with these temporary files.

Example:

Example 1: Execute show global status once every 10 seconds and combine the results to view them.

Pt-mext -- mysqladmin ext-uroot-pzhang @ 123-i10-c3

4. pt-query-digest

Function introduction:

Analyze query execution logs and generate a query report, which is a MySQL, PostgreSQL, and memcached filter, replay, or conversion statement.

Usage:

Pt-query-digest [OPTION...] [FILE]

Parse and analyze mysql Log Files

Example:

Example 1: analyze the local slow Query file

Pt-query-digest -- user = root -- password = zhang @ 123/data/dbdata/localhost-slow.log

Example 2: Review the full query logs and save the results to query_review. Note that the table structure of the query_review table must be created first. The table structure is as follows:

Create table query_review (

Checksum bigint unsigned not null primary key,

Fingerprint text not null,

Sample text not null,

First_seen DATETIME,

Last_seen DATETIME,

Reviewed_by VARCHAR (20 ),

Reviewed_on DATETIME,

Comments TEXT

);

The command is as follows:

Pt-query-digest -- user = root -- password = zhang @ 123 -- review h = localhost, D = test, t = query_review/data/dbdata/localhost-slow.log

5. pt-trend

Function introduction:

Make statistics on the data points that reside in a group of time series.

Usage:

Pt-trend [OPTION...] [FILE...]

Read a slow query log and output statistics. You can also specify multiple files. If no file is specified, the information is directly read from the standard input.

Example:

Example 1: read local slow query logs and output statistics

Pt-trend/data/dbdata/localhost-slow.log

The output information is not described here. I cannot understand it!

Percona Toolkit: click here
Percona Toolkit: click here

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.