
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can I see global locks in MySQL (innodb)?
In order to see the global locks in MySQL (Innodb), use the SHOW command. The below query shows the global locks as well owner of locks and waiters. The following query will also show transaction id and more related to Innodb.
The query is as follows:
mysql> SHOW ENGINE INNODB STATUS\G
The following is the output:
*************************** 1. row *************************** Type: InnoDB Name: Status: ===================================== 2019-01-23 14:46:58 0x2914 INNODB MONITOR OUTPUT ===================================== Per second averages calculated from the last 23 seconds ----------------- BACKGROUND THREAD ----------------- srv_master_thread loops: 87 srv_active, 0 srv_shutdown, 51953 srv_idle srv_master_thread log flush and writes: 0 ---------- SEMAPHORES ---------- OS WAIT ARRAY INFO: reservation count 244 OS WAIT ARRAY INFO: signal count 241 RW-shared spins 23, rounds 37, OS waits 14 RW-excl spins 16, rounds 380, OS waits 9 RW-sx spins 1, rounds 4, OS waits 0 Spin rounds per wait: 1.61 RW-shared, 23.75 RW-excl, 4.00 RW-sx ------------ TRANSACTIONS ------------ Trx id counter 60219 Purge done for trx's n:o < 60218 undo n:o < 0 state: running but idle History list length 32 LIST OF TRANSACTIONS FOR EACH SESSION: ---TRANSACTION 284507225290560, not started 0 lock struct(s), heap size 1136, 0 row lock(s) -------- FILE I/O -------- I/O thread 0 state: wait Windows aio (insert buffer thread) I/O thread 1 state: wait Windows aio (log thread) I/O thread 2 state: wait Windows aio (read thread) I/O thread 3 state: wait Windows aio (read thread) I/O thread 4 state: wait Windows aio (read thread) I/O thread 5 state: wait Windows aio (read thread) I/O thread 6 state: wait Windows aio (write thread) I/O thread 7 state: wait Windows aio (write thread) I/O thread 8 state: wait Windows aio (write thread) I/O thread 9 state: wait Windows aio (write thread) Pending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] , ibuf aio reads:, log i/o's:, sync i/o's: Pending flushes (fsync) log: 0; buffer pool: 0 2134 OS file reads, 2843 OS file writes, 1186 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 2267, node heap has 0 buffer(s) Hash table size 2267, node heap has 1 buffer(s) Hash table size 2267, node heap has 1 buffer(s) Hash table size 2267, node heap has 1 buffer(s) Hash table size 2267, node heap has 0 buffer(s) Hash table size 2267, node heap has 0 buffer(s) Hash table size 2267, node heap has 0 buffer(s) Hash table size 2267, node heap has 0 buffer(s) 0.00 hash searches/s, 0.00 non-hash searches/s --- LOG --- Log sequence number 44174557 Log buffer assigned up to 44174557 Log buffer completed up to 44174557 Log written up to 44174557 Log flushed up to 44174557 Added dirty pages up to 44174557 Pages flushed up to 44174557 Last checkpoint at 44174557 1117 log i/o's done, 0.00 log i/o's/second ---------------------- BUFFER POOL AND MEMORY ---------------------- Total large memory allocated 8585216 Dictionary memory allocated 503201 Buffer pool size 512 Free buffers 253 Database pages 256 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 2111, created 215, written 1437 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: 256, 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 Process ID=8992, Main thread ID=00000000000029F4 , state=sleeping Number of rows inserted 247, updated 512, deleted 19, read 6593 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)
- Related Articles
- How can I install or enable innoDB in MySQL?
- Can I use InnoDB and MyISAM tables in a single database in MySQL?
- How can I see the description of a MySQL Temporary Tables?
- MyISAM versus InnoDB in MySQL?
- How can I see the CREATE TABLE statement of an existing MySQL table?
- How can I see how long statements take to execute on the MySQL command line?
- How do I know if a MySQL table is using myISAM or InnoDB Engine?
- How to convert MyISAM to InnoDB storage engine in MySQL?
- While connecting to one MySQL database, how can I see the list of tables of other MySQL database?
- Is INNODB enabled by default in MySQL?
- How to display all tables in MySQL with InnoDB storage engine?
- Using “TYPE = InnoDB” in MySQL throws an exception?
- Converting table from MyISAM to INNODB in MySQL?
- While creating a MySQL table, how can I specify the storage engine of my choice rather than using the default storage engine InnoDB?
- How to create a MySQL table with InnoDB engine table?

Advertisements