Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37853849
en ru br
Репозитории ALT
S:3.2-alt1
5.1: 3.2-alt1
4.1: 3.2-alt1
www.altlinux.org/Changes

Группа :: Базы Данных
Пакет: mysqlreport

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>mysqlreport Documentation</title>
<meta name="keywords" content="mysqlreport, documentation" />
<meta name="description" content="mysqlreport documentation." />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<?php @include('styles.inc'); ?>
</head>

<body>
<?php $page = 'mysqlreport'; @include('header_and_menu.inc') ?>

<div id="Content">
<h1>mysqlreport Documentation</h1>
<div class="inset_c">
mysqlreport makes a friendly report of important
<a href="http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html">MySQL status values</a>.
Actually, it makes
a friendly report of nearly every status value from SHOW STATUS. Unlike SHOW STATUS which
simply dumps over 100 values to screen in one long list, mysqlreport interprets and formats
the values and presents the basic values and many more inferred values in a human-readable
format. Numerous example reports are available at the <a href="http://hackmysql.com/mysqlreport">mysqlreport
web page</a>.<br /><br />

The benefit of mysqlreport is that it allows you to very quickly see a wide array of
performance indicators for your MySQL server which would otherwise need to be calculated
by hand from all the various SHOW STATUS values. For example, the Index Read Ratio is
an important value but it's not present in SHOW STATUS; it's an inferred value
(the ratio of Key_reads to Key_read_requests).<br /><br />

This documentation outlines all the command line options in mysqlreport,
most of which control which reports are printed. This document does not address how
to interpret these reports; that topic is covered in the document
<a href="http://hackmysql.com/mysqlreportguide">Guide To Understanding mysqlreport</a>.
</div>

<h2>A Note About Options</h2>
<div class="inset_c">
Technically, command line options are in the form --option, but -option works too.
All options can be abbreviated if the abbreviation is unique. For example, option --host
can be abbreviated --ho but not --h because --h is ambiguous: it could mean
--host or --help.
</div>

<h2>Options</h2>
<table cellspacing="0">
<tr>
<td class="doc_op">
--user USER<br />
--password<br />
--host ADDRESS<br />
--port PORT<br />
--socket SOCKET<br />
--no-mycnf<br />
--help
</td>
<td class="doc_ex">
These options mimic most standard applications. As of version 2.3 --password
can take the password on the command line like "--password FOO". Using --password
alone without giving a password on the command line causes mysqlreport to
prompt for a password. --no-mycnf makes mysqlreport not read ~/.my.cnf which
it does by default otherwise. --user and --password always override values
from ~/.my.cnf.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--infile FILE</td>
<td class="doc_ex">
Instead of getting SHOW STATUS values from MySQL, read values from FILE.
FILE is often a copy of the output of SHOW STATUS including formatting
characters (|, +, -). mysqlreport expects FILE to have the format
"value number" where value is only alpha and underscore characters (A-Z and _) and
number is a positive integer. Anything before, between, or after value and number
is ignored. mysqlreport also needs the following
<a href="http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html">MySQL server
variables</a>: version, table_cache, max_connections, key_buffer_size, query_cache_size,
thread_cache_size.
These values can be specified in INFILE in the format "name = value" where name
is one of the aforementioned server variables and value is a positive integer
with or without a trailing M and possible periods (for version).
For example, to specify an 18M key_buffer_size:
key_buffer_size = 18M. Or, a 256 table_cache: table_cache = 256. The M implies
Megabytes not million, so 18M means 18,874,368 not 18,000,000. If these
server variables are not specified the following defaults are used (respectively)
which may cause strange values to be reported: 0.0.0, 64, 100, 8M, 0, 0.<br /><br />
<b>NOTE</b>: For MySQL servers version 5.1.3 and newer, even though the system
variable table_cache was renamed to table_open_cache, still use table_cache in an
infile.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--outfile FILE</td>
<td class="doc_ex">
After printing the report to screen, print the report to FILE too. Internally, mysqlreport
always writes the report to a temp file first.
Then it prints the temp file to screen. Then, if
--outfile is specified, the temp file is copied to OUTFILE. After --email,
the temp file is deleted.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--email ADDRESS</td>
<td class="doc_ex">
After printing the report to screen, email the report to ADDRESS. This option
requires sendmail in /usr/sbin/, therefore it does not work on Windows. /usr/sbin/sendmail
can be a sym link to qmail, for example, or any MTA that emulates sendmail's
-t command line option and operation. The FROM: field is "mysqlreport", SUBJECT:
is "MySQL status report on HOST" where HOST is the host that the mysqlreport was ran on
(from the --host option, or "localhost" by default).
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">
--flush-status
</td>
<td class="doc_ex">
Execute a "FLUSH STATUS;" after generating the reports. If you do not have permissions
in MySQL to do this an error from DBD::mysql::st will be printed after the reports.
<br />&nbsp;<br />
</td>
</tr>

<tr>
<td class="doc_op">
--relative (-r) X
</td>
<td class="doc_ex">
The report that mysqlreport normally generates shows values for the entire
uptime of the MySQL server. The --relative option causes mysqlreport to
generate reports which are relative to previous reports.
<br /><br />
If the --relative option is given an integer value for X, then
mysqlreport will generate relative reports from the MySQL server
which are X seconds apart. The number of reports is controlled by
the --report-count option. The default is 1 relative report. For example,
given the option --relative 60, mysqlreport will generate 2 reports:
the first report will be generated immediately; this is the beginning
or baseline report. The second report will be generated 60 seconds
later. The values of the second report will be relative to the beginning
report. For example, assume that in the beginning report there were
10.00k Questions Total. Then assume that during the 60 second interval
the MySQL server answered another 1k Questions. The second report will
then show 1.00k Questions Total, not 11.00k.
<br /><br />
If the --relative option is given a list of infiles (like those used
for the --infile option), then mysqlreport will generate relative
reports from only the given infiles in the order that the infiles are given.
Therefore, it is important to give the infiles on the command line in
the proper order of time: older infiles first. The first infile should
have the manually added system variable values like key_buffer_size,
table_cache, etc. An infile can have one or more sets of MySQL SHOW STATUS
values. Note, however, that output from "mysqladmin -r -i N extended"
will not work because mysqladmin with the -r option already relativizes
the SHOW STATUS values.
<br /><br />
Because mysqlreport writes reports to temp file first, when --relative
is used with an integer (not with infiles), mysqlreport will says which
temp file it is writing to. Then one can watch the progress of relative
reports as they are written.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">
--report-count (-c) N
</td>
<td class="doc_ex">
Generate N number of relative reports. This option only works with --relative
when --relative is given an integer value for X. mysqlreport actually generates
N + 1 reports: the first report is the beginning or baseline report. Then, N
number of relative reports are generated.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">
--detach
</td>
<td class="doc_ex">
This option causes mysqlreport to fork, detach from the terminal, and continue
running in the background. After forking, mysqlreport will say which temp file
it is writing to. This option also needs either option --outfile
or --email. If neither --outfile nor --email are given, the report is simply
deleted because, since mysqlreport detached from the terminal, the report
cannot be printed to the terminal. This option is meant to be used with option
--relative so that mysqlreport can collect relative reports over long periods
of time without having to have a controlling terminal (i.e. a user logged in).
For example, one can capture a relative report over an hour interval and have
the whole report emailed to their self by running mysqlreport like:<br />
mysqlreport -r 3600 -detach -email host@domain.com<br />
After an hour, mysqlreport will email the relative report, remove its temporary
files, and terminate cleanly.
<br />&nbsp;<br />
</td>
</tr>

<tr>
<td class="doc_op">
--debug
</td>
<td class="doc_ex">
Print debugging information.
<br />&nbsp;<br />
</td>
</tr>

<tr>
<td class="doc_op">--dtq</td>
<td class="doc_ex">
Print Distribution of Total Queries (DTQ) report (under Total in Questions report).
Queries (or Questions) can be divided into four main areas: DMS (see --dms below),
Com_ (see --com below), COM_QUIT
(see <a href="http://hackmysql.com/com_quit">COM_QUIT and Questions</a>),
and Unknown. --dtq lists the number of queries in each of these areas in
descending order.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--dms</td>
<td class="doc_ex">
Print Data Manipulation Statements (DMS) report (under DMS in Questions report).
DMS are those from the MySQL manual section
<a href="http://dev.mysql.com/doc/refman/5.0/en/data-manipulation.html">13.2. Data Manipulation Statements</a>.
(Currently, mysqlreport considers only SELECT, INSERT, REPLACE, UPDATE, and DELETE.)
Each DMS is listed in descending order by count.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--com N</td>
<td class="doc_ex">
Print top N number of non-DMS Com_ status values in descending order (after DMS
in Questions report). If N is not given, default is 3. Such non-DMS Com_ values
include Com_change_db, Com_show_tables, Com_rollback, etc.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--sas</td>
<td class="doc_ex">
Print report for Select_ and Sort_ status values (after Questions report).
See <a href="http://hackmysql.com/selectandsort">MySQL Select and Sort Status Variables</a>.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--qcache</td>
<td class="doc_ex">
Print Query Cache report if the query cache is turned on.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--tab</td>
<td class="doc_ex">
Print Threads, Aborted, and Bytes status reports (after Created temp report).
As of mysqlreport v2.3 the Threads report reports on all Threads_ status values.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--innodb</td>
<td class="doc_ex">
Print <a href="http://dev.mysql.com/doc/refman/5.0/en/innodb.html">InnoDB</a>
reports which consist of the InnoDB Buffer Pool report for MySQL servers
version 5.0.2 and up, and the InnoDB Lock report for MySQL servers version 5.0.3 and up.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--innodb-only</td>
<td class="doc_ex">
Print <i>only</i> the InnoDB reports; hide all other reports.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op">--dpr</td>
<td class="doc_ex">
Print the InnoDB Data, Pages, Rows report.
<br />&nbsp;<br />
</td>
</tr>
<tr>
<td class="doc_op" style="border-bottom:none;">--all</td>
<td class="doc_ex" style="border-bottom:none;">
Show ALL extra reports if possible. Some reports like Query Cache
and InnoDB require certain versions of MySQL or certain features
to be enabled. For example, if the server's version supports the
query cache but the query cache is off, the Query Cache report
will not be printed with either --qcache or --all.
<br />&nbsp;<br />
</td>
</tr>
</table><br />

<h2>What To Do About Bug and Errors</h2>
<div class="inset_c">
If mysqlreport breaks, send me a
<a href="http://hackmysql.com/feedback">message</a> with the error.
</div>
(Doc rev: May 26 2007)
</div>
</body>
</html>
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin