您的位置:首页 > 数据库 > MySQL

MYSQL show engine等实用 command

2016-05-06 14:30 585 查看
看DB参数和数据用:show status;

>>show tables from information_schema;

+---------------------------------------+

| Tables_in_information_schema          |

+---------------------------------------+

| CHARACTER_SETS                        |

| COLLATIONS                            |

| COLLATION_CHARACTER_SET_APPLICABILITY |

| COLUMNS                               |

| COLUMN_PRIVILEGES                     |

| ENGINES                               |

| EVENTS                                |

| FILES                                 |

| GLOBAL_STATUS                         |

| GLOBAL_VARIABLES                      |

| KEY_COLUMN_USAGE                      |

| OPTIMIZER_TRACE                       |

| PARAMETERS                            |

| PARTITIONS                            |

| PLUGINS                               |

| PROCESSLIST                           |

| PROFILING                             |

| REFERENTIAL_CONSTRAINTS               |

| ROUTINES                              |

| SCHEMATA                              |

| SCHEMA_PRIVILEGES                     |

| SESSION_STATUS                        |

| SESSION_VARIABLES                     |

| STATISTICS                            |

| TABLES                                |

| TABLESPACES                           |

| TABLE_CONSTRAINTS                     |

| TABLE_PRIVILEGES                      |

| TRIGGERS                              |

| USER_PRIVILEGES                       |

| VIEWS                                 |

| INNODB_CMP_RESET                      |

| INNODB_FT_CONFIG                      |

| INNODB_SYS_DATAFILES                  |

| INNODB_TRX                            |

| INNODB_SYS_TABLESTATS                 |

| ndb_transid_mysql_connection_map      |

| INNODB_FT_BEING_DELETED               |

| INNODB_LOCKS                          |

| INNODB_CMP_PER_INDEX                  |

| INNODB_BUFFER_PAGE_LRU                |

| INNODB_FT_DELETED                     |

| INNODB_CMPMEM_RESET                   |

| INNODB_LOCK_WAITS                     |

| INNODB_CMP                            |

| INNODB_SYS_INDEXES                    |

| INNODB_SYS_TABLES                     |

| INNODB_SYS_FIELDS                     |

| INNODB_CMP_PER_INDEX_RESET            |

| INNODB_BUFFER_PAGE                    |

| INNODB_FT_DEFAULT_STOPWORD            |

| INNODB_FT_INDEX_TABLE                 |

| INNODB_FT_INDEX_CACHE                 |

| INNODB_SYS_TABLESPACES                |

| INNODB_METRICS                        |

| INNODB_SYS_FOREIGN_COLS               |

| INNODB_CMPMEM                         |

| INNODB_BUFFER_POOL_STATS              |

| INNODB_SYS_COLUMNS                    |

| INNODB_SYS_FOREIGN                    |

+---------------------------------------+

MySQL>> show create table ossOperationType;

| Table            | Create Table                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                               
                                                                                                                                     |

+---------------------------------------------

| ossOperationType | CREATE TABLE `ossOperationType` (

  `ossOperationTypeId` binary(1) NOT NULL,

  `ssInThePLMNId` binary(2) NOT NULL,

  `mobileNetworkCodeId` binary(3) NOT NULL,

  `mobileCountryCodeId` binary(3) NOT NULL,

  `stringIA5` binary(17) DEFAULT NULL,

  `stringUssd` binary(17) DEFAULT NULL,

  `stringUcs2` binary(17) DEFAULT NULL,

  `ossOperationTypeTime` bigint(20) /*!50606 COLUMN_FORMAT DYNAMIC */ DEFAULT NULL,

  PRIMARY KEY (`ossOperationTypeId`,`ssInThePLMNId`,`mobileNetworkCodeId`,`mobileCountryCodeId`) USING HASH

) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_bin

/*!50100 PARTITION BY KEY (ossOperationTypeId) */ |

+---------------------+

1 row in set (0.01 sec)

mysql> show status;

...

.....

mysql> show processlist;

+------+-------------+-----------------+------+---------+--------+-----------------------------------------------------------------------------+------------------+

| Id   | User        | Host            | db   | Command | Time   | State                                                                       | Info             |

+------+-------------+-----------------+------+---------+--------+-----------------------------------------------------------------------------+------------------+

|    1 | system user |                 |      | Daemon  |      1 | Waiting for event from ndbcluster                                           | NULL             |

|    2 | dbsup       | STATION_A:59079 | NULL | Sleep   |      1 |                                                                             | NULL             |

|    3 | system user |                 | NULL | Connect | 490535 | Waiting for master to send event                                            | NULL             |

|    4 | system user |                 | NULL | Connect |      1 | Slave has read all relay log; waiting for the slave I/O thread to update it | NULL             |

| 9721 | admin       | localhost       | hlr  | Query   |      0 | init                                                                        | show processlist |

+------+-------------+-----------------+------+---------+--------+-----------------------------------------------------------------------------+------------------+

5 rows in set (0.00 sec)

看存储引擎参数:

mysql> show engine innodb status\G;

*************************** 1. row ***************************

  Type: InnoDB

  Name: 

Status: 

=====================================

2016-05-06 14:12:46 7f406e04c700 INNODB MONITOR OUTPUT

=====================================

Per second averages calculated from the last 22 seconds

-----------------

BACKGROUND THREAD

-----------------

srv_master_thread loops: 1 srv_active, 0 srv_shutdown, 488673 srv_idle

srv_master_thread log flush and writes: 488674

----------

SEMAPHORES

----------

OS WAIT ARRAY INFO: reservation count 2

OS WAIT ARRAY INFO: signal count 2

Mutex spin waits 0, rounds 0, OS waits 0

RW-shared spins 2, rounds 60, OS waits 2

RW-excl spins 0, rounds 0, OS waits 0

Spin rounds per wait: 0.00 mutex, 30.00 RW-shared, 0.00 RW-excl

------------

TRANSACTIONS

------------

Trx id counter 5381

Purge done for trx's n:o < 0 undo n:o < 0 state: running but idle

History list length 0

LIST OF TRANSACTIONS FOR EACH SESSION:

---TRANSACTION 0, not started

MySQL thread id 9721, OS thread handle 0x7f406e04c700, query id 7570041 localhost admin init

show engine innodb status

--------

FILE I/O

--------

I/O thread 0 state: waiting for i/o request (insert buffer thread)

I/O thread 1 state: waiting for i/o request (log thread)

I/O thread 2 state: waiting for i/o request (read thread)

I/O thread 3 state: waiting for i/o request (read thread)

I/O thread 4 state: waiting for i/o request (read thread)

I/O thread 5 state: waiting for i/o request (read thread)

I/O thread 6 state: waiting for i/o request (write thread)

I/O thread 7 state: waiting for i/o request (write thread)

I/O thread 8 state: waiting for i/o request (write thread)

I/O thread 9 state: waiting for i/o request (write thread)

Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,

 ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0

Pending flushes (fsync) log: 0; buffer pool: 0

318 OS file reads, 5 OS file writes, 5 OS fsyncs

0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s

-------------------------------------

INSERT BUFFER AND ADAPTIVE HASH INDEX

-------------------------------------

Ibuf: size 1, free list len 0, seg size 2, 0 merges

merged operations:

 insert 0, delete mark 0, delete 0

discarded operations:

 insert 0, delete mark 0, delete 0

Hash table size 276707, node heap has 0 buffer(s)

0.00 hash searches/s, 0.00 non-hash searches/s

---

LOG

---

Log sequence number 1626067

Log flushed up to   1626067

Pages flushed up to 1626067

Last checkpoint at  1626067

0 pending log writes, 0 pending chkp writes

8 log i/o's done, 0.00 log i/o's/second

----------------------

BUFFER POOL AND MEMORY

----------------------

Total memory allocated 137363456; in additional pool allocated 0

Dictionary memory allocated 59957

Buffer pool size   8192

Free buffers       8023

Database pages     169

Old database pages 0

Modified db pages  0

Pending reads 0

Pending writes: LRU 0, flush list 0, single page 0

Pages made young 0, not young 0

0.00 youngs/s, 0.00 non-youngs/s

Pages read 169, created 0, written 1

0.00 reads/s, 0.00 creates/s, 0.00 writes/s

No buffer pool page gets since the last printout

Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s

LRU len: 169, unzip_LRU len: 0

I/O sum[0]:cur[0], unzip sum[0]:cur[0]

--------------

ROW OPERATIONS

--------------

0 queries inside InnoDB, 0 queries in queue

0 read views open inside InnoDB

Main thread process no. 479821, id 139913752205056, state: sleeping

Number of rows inserted 0, updated 0, deleted 0, read 0

0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s

----------------------------

END OF INNODB MONITOR OUTPUT

============================

1 row in set (0.00 sec)

ERROR: 
No query specified

mysql> show engine ndbcluster status\G;

*************************** 1. row ***************************

  Type: ndbcluster

  Name: connection

Status: cluster_node_id=116, connected_host=STATION_A, connected_port=2200, number_of_data_nodes=14, number_of_ready_data_nodes=14, connect_count=0

*************************** 2. row ***************************

  Type: ndbcluster

  Name: NdbTransaction

Status: created=14, free=14, sizeof=368

*************************** 3. row ***************************

  Type: ndbcluster

  Name: NdbOperation

Status: created=28, free=28, sizeof=944

*************************** 4. row ***************************

  Type: ndbcluster

  Name: NdbIndexScanOperation

Status: created=0, free=0, sizeof=1152

*************************** 5. row ***************************

  Type: ndbcluster

  Name: NdbIndexOperation

Status: created=0, free=0, sizeof=952

*************************** 6. row ***************************

  Type: ndbcluster

  Name: NdbRecAttr

Status: created=0, free=0, sizeof=88

*************************** 7. row ***************************

  Type: ndbcluster

  Name: NdbApiSignal

Status: created=16, free=16, sizeof=144

*************************** 8. row ***************************

  Type: ndbcluster

  Name: NdbLabel

Status: created=0, free=0, sizeof=200

*************************** 9. row ***************************

  Type: ndbcluster

  Name: NdbBranch

Status: created=0, free=0, sizeof=32

*************************** 10. row ***************************

  Type: ndbcluster

  Name: NdbSubroutine

Status: created=0, free=0, sizeof=72

*************************** 11. row ***************************

  Type: ndbcluster

  Name: NdbCall

Status: created=0, free=0, sizeof=24

*************************** 12. row ***************************

  Type: ndbcluster

  Name: NdbBlob

Status: created=0, free=0, sizeof=496

*************************** 13. row ***************************

  Type: ndbcluster

  Name: NdbReceiver

Status: created=0, free=0, sizeof=128

*************************** 14. row ***************************

  Type: ndbcluster

  Name: NdbLockHandle

Status: created=0, free=0, sizeof=48

*************************** 15. row ***************************

  Type: ndbcluster

  Name: binlog

Status: latest_epoch=2005758317166600, latest_trans_epoch=2005758317166596, latest_received_binlog_epoch=2005758317166600, latest_handled_binlog_epoch=2005758317166600, latest_applied_binlog_epoch=2005758317166596

15 rows in set (0.00 sec)

ERROR: 

No query specified
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: