The mysql table is full of "the table XXX is full" problem

      I will write another article while there is still some time. This problem is encountered today. Thank you in advance for the operation and maintenance of children's shoes.embarrassment

 

     【background】

      Need to add a column to a large table in the morning

alter table A add column XXX tinyint default 0 comment 'Whether the depth recognition is 0 or 1 is';

      Table A has tens of millions of rows of data at that time. When the traffic is at a low peak, the above sql is executed. After about 5 minutes of execution, the problem "the table XXX is full" is reported.

 

    【identify the problem】

     At that time, I searched the Internet first. If you set the maximum number of lines, the viewing configuration is already large enough to meet the current growth needs; if you have cleaned up the directory, but did not give a specific directory, I asked the operation and maintenance classmates to explain. As follows: When the alter operation is performed, the original table is temporarily copied, changes are made on the copy, then the original table is deleted, and the new table is renamed. When alter table is executed, other users can read the original table, but the operation of updating and modifying the table will be delayed until the new table is generated. After the new table is generated, these updates and modifications are automatically transferred to the new table, but the rename operation does not create a temporary table. By understanding the principle, combined with the phenomenon of "after 5 minutes of execution, an error is reported", it is considered that the disk space is insufficient due to the creation of a temporary table, which causes the execution of the statement to fail.

 

   【solution】

     1. Delete useless files in the directory

     2. Point the temporary table directory to a large disk directory (but restart is required)

   

   【Concluding remarks】

     MySQL is not as powerful as oracle, some things need to be prepared in advance

    

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326942101&siteId=291194637