content_image/682544.jpg
SET GLOBAL innodb_status_output=ON; 

To disable the standard InnoDB  Monitor, set innodb_status_output  to OFF . 

When you shut down the server, the innodb_status_output  variable is set to the default OFF  value. 

## Enabling the InnoDB Lock Monitor 

InnoDB  Lock Monitor data is printed with the InnoDB  Standard Monitor output. Both the InnoDB  Standard Monitor and InnoDB  Lock Monitor must be enabled to have InnoDB  Lock Monitor data printed periodically. 

To enable the InnoDB  Lock Monitor, set the innodb_status_output_locks  system variable to ON . Both the InnoDB  standard Monitor and InnoDB  Lock Monitor must be enabled to have InnoDB  Lock Monitor data printed periodically: 

SET GLOBAL innodb_status_output=ON; SET GLOBAL innodb_status_output_locks=ON; 

To disable the InnoDB  Lock Monitor, set innodb_status_output_locks  to OFF . Set innodb_status_output  to OFF  to also disable the InnoDB  Standard Monitor. 

When you shut down the server, the innodb_status_output  and innodb_status_output_locks variables are set to the default OFF  value. 

## Obtaining Standard InnoDB Monitor Output On Demand 

<img src='content_image/682544.jpg'>

## Note 

To enable the InnoDB  Lock Monitor for SHOW ENGINE INNODB STATUS  output, you are only required to enable innodb_status_output_locks . 

As an alternative to enabling the standard InnoDB  Monitor for periodic output, you can obtain standard InnoDB  Monitor output on demand using the SHOW ENGINE INNODB STATUS  SQL statement, which fetches the output to your client program. If you are using the mysql  interactive client, the output is more readable if you replace the usual semicolon statement terminator with \G : 

mysql> SHOW ENGINE INNODB STATUS\G 

SHOW ENGINE INNODB STATUS  output also includes InnoDB  Lock Monitor data if the InnoDB  Lock Monitor is enabled. 

## Directing Standard InnoDB Monitor Output to a Status File 

Standard InnoDB  Monitor output can be enabled and directed to a status file by specifying the -- innodb-status-file  option at startup. When this option is used, InnoDB  creates a file named innodb_status. pid  in the data directory and writes output to it every 15 seconds, approximately. 

InnoDB  removes the status file when the server is shut down normally. If an abnormal shutdown occurs, the status file may have to be removed manually. 

The --innodb-status-file  option is intended for temporary use, as output generation can affect performance, and the innodb_status. pid  file can become quite large over time. 

## 15.17.3 InnoDB Standard Monitor and Lock Monitor Output 

The Lock Monitor is the same as the Standard Monitor except that it includes additional lock information. Enabling either monitor for periodic output turns on the same output stream, but the stream includes extra information if the Lock Monitor is enabled. For example, if you enable the Standard Monitor and Lock Monitor, that turns on a single output stream. The stream includes extra lock information until you disable the Lock Monitor. 

