第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

mysql關(guān)于ibdata文件的理解

標(biāo)簽:
MySQL

总结

1、默认情况下ibdata存放InnoDB表(InnoDB数据字典)元数据、undo logs、the change buffer, and the doublewrite buffer

2、如果innodb_file_per_table=off,则ibdata也存放InnoDB表的实际数据,也就是InnoDB表建立后,不会再有单独的tablename.ibd文件

3、虽然InnoDB表元数据通过information_schema.tables来读取,但是实际上information_schema是一个虚拟数据库,并不物理存在,这些数据真正存放的地方就是ibdata

备注:元数据(meta data)--"data about data" 关于数据的数据,一般是结构化数据(如存储在数据库里的数据,规定了字段的长度、类型等)

ibdata file

https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_ibdata_file

A set of files with names such as ibdata1, ibdata2, and so on, that make up the InnoDB system tablespace. These files contain metadata about InnoDB tables, (the InnoDB data dictionary), and the storage areas for one or more undo logs, the change buffer, and the doublewrite buffer. They also can contain some or all of the table data also (depending on whether the file-per-table mode is in effect when each table is created). When the innodb_file_per_table option is enabled, data and indexes for newly created tables are stored in separate .ibd files rather than in the system tablespace.

The growth of the ibdata files is influenced by the innodb_autoextend_increment configuration option

一组名称为ibdata1,ibdata2等的文件,构成InnoDB系统表空间。 这些文件包含有关InnoDB表(InnoDB数据字典)的元数据,以及一个或多个撤消日志,更改缓冲区和双写缓冲区的存储区域。 它们还可以包含部分或全部表数据(取决于创建每个表时每个表的文件模式是否有效)。 启用innodb_file_per_table选项后,新创建的表的数据和索引将存储在单独的.ibd文件中,而不是存储在系统表空间中。

ibdata文件的增长受innodb_autoextend_increment配置选项的影响,默认是64M

The increment size (in megabytes) for extending the size of an auto-extending InnoDB system tablespace file when it becomes full. The default value is 64

MySQL开启独享表空间的参数是Innodb_file_per_table,会为每个Innodb表创建一个.ibd的文件。

开启独享表空间后,并不是说就不需要ibdata1了,因为在ibdata1中还保存着下面这些数据。

InnoDB表的元数据

Buffer

UNDO日志

system tablespace

https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_system_tablespace

One or more data files (ibdata files) containing metadata for InnoDB-related objects (the InnoDB data dictionary), and the storage areas for the change buffer, the doublewrite buffer, and possibly undo logs. It may also contain table and index data for InnoDB tables if tables were created in the system tablespace instead of file-per-table or general tablespaces. The data and metadata in the system tablespace apply to all databases in a MySQL instance.

系统表空间

包含InnoDB相关对象(InnoDB数据字典)的元数据的一个或多个数据文件(ibdata文件),以及更改缓冲区,双写缓冲区和可能的撤消日志的存储区域。 如果在系统表空间而不是每个表文件或一般表空间中创建表,它还可能包含InnoDB表的表和索引数据。 系统表空间中的数据和元数据适用于MySQL实例中的所有数据库。

实验过程

会话1

mysql> set global innodb_file_per_table=off;

mysql> show variables like '%innodb_file_per_table%';

+-----------------------+-------+

| Variable_name | Value |

+-----------------------+-------+

| innodb_file_per_table | OFF |

+-----------------------+-------+

打开会话2

创建了表tab4并插入数据,却发现tab4表没有tab4.ibd文件

mysql> create table test1.tab4 (hid int);

mysql> insert into test1.tab4 values (1);

[root@mydb ~]# ll /var/lib/mysql/test1 |grep tab4

-rw-r----- 1 mysql mysql 8558 Sep 30 19:56 tab4.frm



作者:Java邵先生
链接:https://www.jianshu.com/p/449aa46b6a69


點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消