MySQL社区

标题: 生产环境使用Innodb存储引擎,如何设置共享表空间? [打印本页]

作者: wxlkeepmoving    时间: 2015-1-26 07:23
标题: 生产环境使用Innodb存储引擎,如何设置共享表空间?
生产环境使用Innodb存储引擎,设置了innodb_file_per_table=1,那么此时如何设置共享表空间?应该使用几个共享表空间文件?每个共享表空间的大小是多少? 我如下设置之后,以后还可以动态修改吗?
innodb_data_file_path=/mysql_data/ibdata1:1G;/mysql_data/ibdata2:1G:autoextend

作者: kider    时间: 2015-1-26 09:50
共享表空间也是和原来的一样设置,如果你设置了innodb_file_per_table=1,那么数据几乎都是写到每个表的独立表空间了。而在ibdata文件中写入的很少了,那么这个文件也就不需要太大的空间了。 设置完以后生效了,写入了数据,就不能再动态的修改了,最后一个文件可以变大,或除非全备份出来,然后修改大小,再导入进去。
作者: wxlkeepmoving    时间: 2015-1-27 10:07
kider 发表于 2015-1-26 09:50
共享表空间也是和原来的一样设置,如果你设置了innodb_file_per_table=1,那么数据几乎都是写到每个表的独 ...

非常感谢。

作者: psufnxk2000    时间: 2015-2-10 16:57
innodb_file_per_table is dynamic and can be set ON or OFF using SET GLOBAL

Be aware that enabling innodb_file_per_table also means that an ALTER TABLE operation will
move InnoDB table from the system tablespace to an individual .ibd file in cases where ALTER TABLE
recreates the table (ALGORITHM=COPY).




欢迎光临 MySQL社区 (http://www.mysqlpub.com/) Powered by Discuz! X3.2