使用InnoDB,我如何才能索回索引空间? [英] With InnoDB, how can I claim back index space?

查看:203
本文介绍了使用InnoDB,我如何才能索回索引空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些大的InnoDB数据库,接近1TB。

I have some large InnoDB databases, close to 1TB.

为了在处理备用存储时释放一些空间,我删除了一些未使用的InnoDB索引希望这将释放一些空间。

In order to free up some space while working on an alternative storage, I deleted some unused InnoDB indexes hoping that it would free up some space.

它没有任何东西。

因为它是InnoDB,引擎会使用空的分配空间用于进一步插入和索引?

As it's InnoDB, will the engine use the empty allocated space for further inserts and indexing ?

谢谢

推荐答案

在此答案: https://stackoverflow.com/a/8932289/82114



如果你不使用innodb_file_per_table,可以回收磁盘空间,但是非常繁琐,并且需要大量的停机时间。

Answer here: https://stackoverflow.com/a/8932289/82114

If you don't use innodb_file_per_table, reclaiming disk space is possible, but quite tedious, and requires a significant amount of downtime.

如何要可以在这里找到: http:/ /dev.mysql.com/doc/refman/5.6/en/innodb-data-log-reconfiguration.html

The "How To" can be found here: http://dev.mysql.com/doc/refman/5.6/en/innodb-data-log-reconfiguration.html

一定要在转储中保留模式的副本。

Be sure to also retain a copy of your schema in your dump.


目前,您无法从系统表空间中删除数据文件。
要减小系统表空间大小,请使用以下过程:

Currently, you cannot remove a data file from the system tablespace. To decrease the system tablespace size, use this procedure:

使用mysqldump转储所有InnoDB表。

Use mysqldump to dump all your InnoDB tables.

停止服务器。

删除所有现有的表空间文件,包括ibdata和
ib_log文件。如果要保留信息的备份副本,
然后将所有ib *文件复制到另一个位置,然后再删除MySQL安装中的
文件。

Remove all the existing tablespace files, including the ibdata and ib_log files. If you want to keep a backup copy of the information, then copy all the ib* files to another location before the removing the files in your MySQL installation.

删除InnoDB表的任何.frm文件。

Remove any .frm files for InnoDB tables.

配置新的表空间。

重启服务器。

导入转储文件。

这篇关于使用InnoDB,我如何才能索回索引空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆