Sie sind auf Seite 1von 5

SHOW has many forms that provide information about databases, tables,

columns, or status information about the server. This section describes


those following:

SHOW AUTHORS
SHOW {BINARY | MASTER} LOGS
SHOW BINLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count]
SHOW CHARACTER SET [like_or_where]
SHOW COLLATION [like_or_where]
SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]
SHOW CONTRIBUTORS
SHOW CREATE DATABASE db_name
SHOW CREATE EVENT event_name
SHOW CREATE FUNCTION func_name
SHOW CREATE PROCEDURE proc_name
SHOW CREATE TABLE tbl_name
SHOW CREATE TRIGGER trigger_name
SHOW CREATE VIEW view_name
SHOW DATABASES [like_or_where]
SHOW ENGINE engine_name {STATUS | MUTEX}
SHOW [STORAGE] ENGINES
SHOW ERRORS [LIMIT [offset,] row_count]
SHOW EVENTS
SHOW FUNCTION CODE func_name
SHOW FUNCTION STATUS [like_or_where]
SHOW GRANTS FOR user
SHOW INDEX FROM tbl_name [FROM db_name]
SHOW MASTER STATUS
SHOW OPEN TABLES [FROM db_name] [like_or_where]
SHOW PLUGINS
SHOW PROCEDURE CODE proc_name
SHOW PROCEDURE STATUS [like_or_where]
SHOW PRIVILEGES
SHOW [FULL] PROCESSLIST
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
SHOW PROFILES
SHOW RELAYLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count]
SHOW SLAVE HOSTS
SHOW SLAVE STATUS
SHOW [GLOBAL | SESSION] STATUS [like_or_where]
SHOW TABLE STATUS [FROM db_name] [like_or_where]
SHOW [FULL] TABLES [FROM db_name] [like_or_where]
SHOW TRIGGERS [FROM db_name] [like_or_where]
SHOW [GLOBAL | SESSION] VARIABLES [like_or_where]
SHOW WARNINGS [LIMIT [offset,] row_count]

like_or_where:
LIKE 'pattern'
| WHERE expr

If the syntax for a given SHOW statement includes a LIKE 'pattern'


part, 'pattern' is a string that can contain the SQL "%" and "_"
wildcard characters. The pattern is useful for restricting statement
output to matching values.

Several SHOW statements also accept a WHERE clause that provides more
flexibility in specifying which rows to display. See
http://dev.mysql.com/doc/refman/5.5/en/extended-show.html.

URL: http://dev.mysql.com/doc/refman/5.5/en/show.html
Syntax:
SHOW ENGINE engine_name {STATUS | MUTEX}

SHOW ENGINE displays operational information about a storage engine. It


requires the PROCESS privilege. The statement has these variants:

SHOW ENGINE INNODB STATUS


SHOW ENGINE INNODB MUTEX
SHOW ENGINE {NDB | NDBCLUSTER} STATUS
SHOW ENGINE PERFORMANCE_SCHEMA STATUS

SHOW ENGINE INNODB STATUS displays extensive information from the


standard InnoDB Monitor about the state of the InnoDB storage engine.
For information about the standard monitor and other InnoDB Monitors
that provide information about InnoDB processing, see
http://dev.mysql.com/doc/refman/5.5/en/innodb-monitors.html.

SHOW ENGINE INNODB MUTEX displays InnoDB mutex and rw-lock statistics.
Statement output has the following columns:

o Type

Always InnoDB.

o Name

The source file where the mutex is implemented, and the line number
in the file where the mutex is created. The line number is specific
to your version of MySQL.

o Status

The mutex status. This field displays several values if UNIV_DEBUG


was defined at MySQL compilation time (for example, in include/univ.i
in the InnoDB part of the MySQL source tree). If UNIV_DEBUG was not
defined, the statement displays only the os_waits value. In the
latter case (without UNIV_DEBUG), the information on which the output
is based is insufficient to distinguish regular mutexes and mutexes
that protect rw-locks (which permit multiple readers or a single
writer). Consequently, the output may appear to contain multiple rows
for the same mutex.

o count indicates how many times the mutex was requested.

o spin_waits indicates how many times the spinlock had to run.

o spin_rounds indicates the number of spinlock rounds. (spin_rounds


divided by spin_waits provides the average round count.)

o os_waits indicates the number of operating system waits. This


occurs when the spinlock did not work (the mutex was not locked
during the spinlock and it was necessary to yield to the operating
system and wait).

o os_yields indicates the number of times a thread trying to lock a


mutex gave up its timeslice and yielded to the operating system (on
the presumption that permitting other threads to run will free the
mutex so that it can be locked).

o os_wait_times indicates the amount of time (in ms) spent in


operating system waits. In MySQL 5.5 timing is disabled and this
value is always 0.

As of MySQL 5.5, SHOW ENGINE INNODB MUTEX skips the mutexes and
rw-locks of buffer pool blocks, as the amount of output can be
overwhelming on systems with a large buffer pool. (There is one mutex
and one rw-lock in each 16K buffer pool block, and there are 65,536
blocks per gigabyte.) SHOW ENGINE INNODB MUTEX also does not list any
mutexes or rw-locks that have never been waited on (os_waits=0). Thus,
SHOW ENGINE INNODB MUTEX only displays information about mutexes and
rw-locks outside of the buffer pool that have caused at least one
OS-level wait.

SHOW ENGINE INNODB MUTEX information can be used to diagnose system


problems. For example, large values of spin_waits and spin_rounds may
indicate scalability problems.

Use SHOW ENGINE PERFORMANCE_SCHEMA STATUS to inspect the internal


operation of the Performance Schema code:

mysql> SHOW ENGINE PERFORMANCE_SCHEMA STATUS\G


...
*************************** 3. row ***************************
Type: performance_schema
Name: events_waits_history.row_size
Status: 76
*************************** 4. row ***************************
Type: performance_schema
Name: events_waits_history.row_count
Status: 10000
*************************** 5. row ***************************
Type: performance_schema
Name: events_waits_history.memory
Status: 760000
...
*************************** 57. row ***************************
Type: performance_schema
Name: performance_schema.memory
Status: 26459600
...

This statement is intended to help the DBA understand the effects that
different Performance Schema options have on memory requirements.

Name values consist of two parts, which name an internal buffer and a
buffer attribute, respectively. Interpret buffer names as follows:

o An internal buffer that is not exposed as a table is named within


parentheses. Examples: (pfs_cond_class).row_size,
(pfs_mutex_class).memory.

o An internal buffer that is exposed as a table in the


performance_schema database is named after the table, without
parentheses. Examples: events_waits_history.row_size,
mutex_instances.row_count.

o A value that applies to the Performance Schema as a whole begins with


performance_schema. Example: performance_schema.memory.

Buffer attributes have these meanings:

o row_size is the size of the internal record used by the


implementation, such as the size of a row in a table. row_size values
cannot be changed.

o row_count is the number of internal records, such as the number of


rows in a table. row_count values can be changed using Performance
Schema configuration options.
o For a table, tbl_name.memory is the product of row_size and
row_count. For the Performance Schema as a whole,
performance_schema.memory is the sum of all the memory used (the sum
of all other memory values).

In some cases, there is a direct relationship between a Performance


Schema configuration parameter and a SHOW ENGINE value. For example,
events_waits_history_long.row_count corresponds to
performance_schema_events_waits_history_long_size. In other cases, the
relationship is more complex. For example,
events_waits_history.row_count corresponds to
performance_schema_events_waits_history_size (the number of rows per
thread) multiplied by performance_schema_max_thread_instances ( the
number of threads).

If the server has the NDBCLUSTER storage engine enabled, SHOW ENGINE
NDB STATUS displays cluster status information such as the number of
connected data nodes, the cluster connectstring, and cluster binary log
epochs, as well as counts of various Cluster API objects created by the
MySQL Server when connected to the cluster. Sample output from this
statement is shown here:

mysql> SHOW ENGINE NDB STATUS;


+------------+-----------------------
+--------------------------------------------------+
| Type | Name | Status
|
+------------+-----------------------
+--------------------------------------------------+
| ndbcluster | connection | cluster_node_id=7,
connected_host=192.168.0.103, connected_port=1186, number_of_data_nodes=4,
number_of_ready_data_nodes=3, connect_count=0
|
| ndbcluster | NdbTransaction | created=6, free=0, sizeof=212
|
| ndbcluster | NdbOperation | created=8, free=8, sizeof=660
|
| ndbcluster | NdbIndexScanOperation | created=1, free=1, sizeof=744
|
| ndbcluster | NdbIndexOperation | created=0, free=0, sizeof=664
|
| ndbcluster | NdbRecAttr | created=1285, free=1285, sizeof=60
|
| ndbcluster | NdbApiSignal | created=16, free=16, sizeof=136
|
| ndbcluster | NdbLabel | created=0, free=0, sizeof=196
|
| ndbcluster | NdbBranch | created=0, free=0, sizeof=24
|
| ndbcluster | NdbSubroutine | created=0, free=0, sizeof=68
|
| ndbcluster | NdbCall | created=0, free=0, sizeof=16
|
| ndbcluster | NdbBlob | created=1, free=1, sizeof=264
|
| ndbcluster | NdbReceiver | created=4, free=0, sizeof=68
|
| ndbcluster | binlog | latest_epoch=155467,
latest_trans_epoch=148126,
latest_received_binlog_epoch=0, latest_handled_binlog_epoch=0,
latest_applied_binlog_epoch=0
|
+------------+-----------------------
+--------------------------------------------------+

The rows with connection and binlog in the Name column were added to
the output of this statement in MySQL 5.1. The Status column in each of
these rows provides information about the MySQL server's connection to
the cluster and about the cluster binary log's status, respectively.
The Status information is in the form of comma-delimited set of
name/value pairs.

URL: http://dev.mysql.com/doc/refman/5.5/en/show-engine.html