![]() ![]() To obtain complete storage details and approximate fragmented space at the database level and table level, run the following query: Note: This query is not applicable to tables residing in shared tablespace. mysql> SELECT file_name, ROUND(SUM(total_extents * extent_size)/1024/1024/1024,2) AS "TableSizeinGB" from information_schema.files where file_name like '%/database_name/%' To get more accurate tables sizes in MySQL version 5.7 and higher, or MySQL 8.0 and higher, use the following query: Note: The information_schema.files query is not applicable to MariaDB engines. To check the size of each table for a particular database (in your DB instance), run the following query: mysql> SELECT table_schema "DB Name", table_name,(data_length + index_length)/1024/1024/1024 AS "TableSizeinGB" from information_schema.tables where table_schema='database_name' To find the size of each user-created database, run the following query: mysql> SELECT table_schema, ROUND(SUM(data_length+index_length)/1024/1024/1024,2) "size in GB" FROM information_schema.tables GROUP BY 1 ORDER BY 2 DESC Resolution Analyze the total space used on the DB instance (user-created databases) ![]() To review the transactions that have been active for a long time, run the INFORMATION_SCHEMA.INNODB_TRX or SHOW ENGINE INNODB STATUS command. The SHOW FULL PROCESSLIST command provides information about all active connections and queries that are performed by each connection. Note: If there's a sudden decrease in available storage, check ongoing queries at the DB instance level by running the SHOW FULL PROCESSLIST command. Then, monitor the FreeStorageSpace metric to avoid running out of space again. General logs, slow query logs, and error logsĪfter you identify what's using storage space, you can reclaim storage space.Binary logs or MySQL standby instance relay logs (if you use a read replica).Space on your DB instance is used for the following: To troubleshoot a storage full issue, you must first analyze the total space used on your DB instance. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |