检查mysiam表SQL

接管一套陌生的数据库一定要检查一下业务数据库是否存在mysiam存储引擎,默认情况下,我们是不允许使用mysiam存储引擎的。
SELECT 
TABLE_SCHEMA AS database_name,
TABLE_NAME AS table_name,
TABLE_ROWS AS table_rows,
ENGINE AS table_engine,
ROUND((DATA_LENGTH)/1024.0/1024, 2) AS Data_MB,
ROUND((INDEX_LENGTH)/1024.0/1024, 2) AS Index_MB,
ROUND((DATA_LENGTH+INDEX_LENGTH)/1024.0/1024, 2) AS Total_MB,
ROUND((DATA_FREE)/1024.0/1024, 2) AS Free_MB
FROM information_schema.`TABLES` AS T1
WHERE T1.`TABLE_SCHEMA` NOT IN(‘performance_schema‘,‘mysql‘,‘information_schema‘,‘sys‘)
AND T1.`ENGINE` NOT IN (‘innodb‘);

检查mysiam表SQL

上一篇:Java8 新特性 Lamdba表达式的一些简单用法


下一篇:PLSQL连接数据库