[MySQL工具] pt-query-digest使用出错问题分析Can't locate Time/HiRes.pm in @INC(二)

2015-02-03 10:33:25 · 作者: · 浏览: 54
-charset=s ? ? ? ? ? ? -A ?Default character set
? --config=A ? ? ? ? ? ? ? ? ?Read this comma-separated list of config files;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if specified, this must be the first option on
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? the command line
? --[no]continue-on-error ? ? Continue parsing even if there is an error (
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? default yes)
? --[no]create-history-table ?Create the --history table if it does not exist (
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? default yes)
? --[no]create-review-table ? Create the --review table if it does not exist (
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? default yes)
? --daemonize ? ? ? ? ? ? ? ? Fork to the background and detach from the shell
? --database=s ? ? ? ? ? ?-D ?Connect to this database
? --defaults-file=s ? ? ? -F ?Only read mysql options from the given file
? --embedded-attributes=a ? ? Two Perl regex patterns to capture pseudo-
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? attributes embedded in queries
....................................
?
分析本地的慢查询文件:
pt-query-digest --user=root --password=m@123 /data/dbdata/localhost-slow.log ?
?
?
?
重新回顾满查询日志,并将结果保存到query_review中,注意query_review表的表结构必须先建好,表结构如下:
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 ?
); ?
?
?
?
命令如下:
pt-query-digest --user=root --password=m@123 --review h=localhost,D=test,t=query_review /data/dbdata/localhost-slow.log ?
?