`
hejiajunsh
  • 浏览: 409898 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

名词解释system tablespace/ib_logfile/.ibd file/ibdata file/storage engine/tablespace

阅读更多

出自:http://dev.mysql.com/doc/refman/5.5/en/glossary.html

 

 

 

system tablespace

A small set of data files (the ibdata files) containing the metadata for InnoDB-related objects (the data dictionary), and the storage areas for the undo log, the change buffer, and the doublewrite buffer. Depending on the setting of the innodb_file_per_table, when tables are created, it might also contain table and index data for some or all InnoDB tables. The data and metadata in the system tablespace apply to all the databases in a MySQL instance.

Prior to MySQL 5.6.7, the default was to keep all InnoDB tables and indexes inside the system tablespace, often causing this file to become very large. Because the system tablespace never shrinks, storage problems could arise if large amounts of temporary data were loaded and then deleted. In MySQL 5.6.7 and higher, the default is file-per-tablemode, where each table and its associated indexes are stored in a separate .ibd file. This new default makes it easier to use InnoDB features that rely on the Barracuda file format, such as table compression and the DYNAMIC row format.

In MySQL 5.6 and higher, setting a value for the innodb_undo_tablespaces option splits the undo log into one or more separate tablespace files. These files are still considered part of the system tablespace.

Keeping all table data in the system tablespace or in separate .ibd files has implications for storage management in general. The MySQL Enterprise Backup product might back up a small set of large files, or many smaller files. On systems with thousands of tables, the filesystem operations to process thousands of .ibd files can cause bottlenecks.

 

 

ib_logfile

A set of files, typically named ib_logfile0 and ib_logfile1, that form the redo log. Also sometimes referred to as the log group. These files record statements that attempt to change data in InnoDB tables. These statements are replayed automatically to correct data written by incomplete transactions, on startup following a crash.

This data cannot be used for manual recovery; for that type of operation, use the binary log.

 

.ibd file

Each InnoDB table created using the file-per-table mode goes into its own tablespace file, with a .ibd extension, inside the database directory. This file contains the table data and any indexes for the table. File-per-table mode, controlled by the innodb_file_per_table option, affects many aspects of InnoDB storage usage and performance, and is enabled by default in MySQL 5.6.7 and higher.

This extension does not apply to the system tablespace, which consists of the ibdata files.

 

ibdata file

A set of files with names such as ibdata1ibdata2, and so on, that make up the InnoDB system tablespace. These files contain metadata about InnoDB tables, (the data dictionary), and the storage areas for the undo log, 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.

 

data files

The files that physically contain the InnoDB table and index data. There can be a one-to-many relationship between data files and tables, as in the case of the system tablespace, which can hold multiple InnoDB tables as well as the data dictionary. There can also be a one-to-one relationship between data files and tables, as when the file-per-table setting is enabled, causing each newly created table to be stored in a separate tablespace.

 

database

Within the MySQL data directory, each database is represented by a separate directory. The InnoDB system tablespace, which can hold table data from multiple databases within a MySQL instance, is kept in its data files that reside outside the individual database directories. When file-per-table mode is enabled, the .ibd files representing individual InnoDB tables are stored inside the database directories.

For long-time MySQL users, a database is a familiar notion. Users coming from an Oracle Database background will find that the MySQL meaning of a database is closer to what Oracle Database calls a schema.

 

storage engine

A component of the MySQL database that performs the low-level work of storing, updating, and querying data. In MySQL 5.5 and higher, InnoDB is the default storage engine for new tables, superceding MyISAM. Different storage engines are designed with different tradeoffs between factors such as memory usage versus disk usage, read speed versus write speed, and speed versus robustness. Each storage engine manages specific tables, so we refer to InnoDB tables, MyISAM tables, and so on.

 

tablespace

A data file that can hold data for one or more InnoDB tables and associated indexes. The system tablespace contains the tables that make up the data dictionary, and prior to MySQL 5.6 holds all the other InnoDB tables by default. Turning on the innodb_file_per_table option, the default in MySQL 5.6 and higher, allows newly created tables to each have their own tablespace, with a separate data file for each table.

 

 

 

 

 

 

分享到:
评论

相关推荐

    MySQL启动报错问题InnoDB:Unable to lock/ibdata1 error

    5. **InnoDB日志文件问题**:InnoDB使用重做日志文件(`ib_logfile0`和`ib_logfile1`)进行事务持久化。如果这些文件损坏或无法访问,也可能导致启动失败。检查日志文件的状态。 6. **数据文件损坏**:`ibdata1`...

    rman_xttconvert_VER4.3.zip.7z

    (比如存储在 SYSTEM 表空间内的 pl/sql 对象,sequences 等),你可以使用数据泵来拷贝这些对象至目标系统。 注意: 考虑使用新release的版本V4的过程。 这个版本极大地简化了相关步骤。 请参考文档:V4 Reduce ...

    QC9.0安装过程图解

    - 临时表空间:`create temporary tablespace QC_TEMP tempfile 'F:/oracle/product/10.2.0/tablespace/qc/qc_temp1.dbf' size 500M autoextend on next 10M;` - 永久表空间:`create tablespace QC_TABLE data...

    ORACLE常用命令

    `alter system switch logfile;` 这个命令用于在当前日志组填满前强制进行日志切换,确保事务记录不丢失。 2. **强制检查点**: `alter system checkpoint;` 强制数据库立即执行检查点,同步所有数据缓冲区到...

    v10.5_linuxx64_expc.tar.gz

    它引入了SQL Analytics Engine(SQLAE),使得在复杂查询和分析任务上表现更出色。此外,v10.5还加强了云集成能力,支持多种云环境。 【Linux x64】意味着这个安装文件是为基于AMD64或Intel x86-64架构的64位Linux...

    查看oracle表空间利用率的三个脚本

    SELECT b.file_id ID, b.tablespace_name Tablespace, b.file_name FileName, b.bytes/1024/1024 SizeM, c.max_extents/1024/1024 ExtentM, b.bytes/1024/1024-(b.bytes/1024/1024-2048)+c.max_extents/1024/1024 ...

    1.2 oracle 11.2.0.4常用操作说明书_20200709_v0.1.doc

    ALTER TABLESPACE zf ADD DATAFILE '/u01/app/oracle/oradata/yourdb/zf_datafile_new.dbf' SIZE 10G AUTOEXTEND ON; ``` 这会向名为“zf”的表空间添加一个新的数据文件,并设置自动扩展。 除此之外,手册可能还...

    oracle常用命令大全

    `alter system switch logfile` 命令用于在当前的日志组满时,强制数据库进行日志切换,以确保事务的连续性。 2. **强制检查点**: `alter system checkpoint` 用于立即完成所有未完成的数据库更改,并将这些更改...

    Oracle数据库管理员的常用命令

    `alter system switch logfile;` 这个命令用于强制切换redo log文件组,当一个redo log文件满时,系统会自动切换到下一个文件,但你可以通过这个命令强制进行。 2. **Forcing Checkpoint**: `alter system ...

    DBA常用命令

    impdp system/manager directory=dump_dir dumpfile=tablespace.dmp tablespaces=users 导入数据库 impdp system/manager directory=dump_dir dumpfile=full.dmp full=y 三、外部表: bad file: 不符合规则的...

    T100 数据还原.txt

    1、找到昨晚备份,用root用户解压:gunzip -d exp_hc01.dmp.gz 2、如果toptet数据库开了就进...imp test/test@toptst file=/u3/imp/exp_hc01.dmp log=/tmp/imp_pia.log fromuser=hc01 touser=test tables=pia_file

    oracle_rman增量备份脚本

    sql 'alter system archive log current'; backup archivelog all format '/dinglp/ora_managed/backup/rman_backup/log_%d_%s_%p_%u.bak' delete all input; release channel d2; release channel d1; } ...

    Oracle_审计表_sys.aud$_授权给用户Truncate权限.docx

    WHERE TABLESPACE_NAME = 'SYSTEM' GROUP BY SEGMENT_NAME ORDER BY 2 DESC) WHERE ROWNUM ; ``` - **表空间利用率**:此外,还可以通过以下SQL语句来查看各个表空间的利用率。 ```sql SELECT F.TABLESPACE_...

    如何正确的删除Oracle表空间数据文件

    `但未实际删除文件,可以先将文件ONLINE,然后使用`ALTER TABLESPACE XXX DROP DATAFILE N;`命令删除。 2. 如果数据文件已被删除,可以使用`ALTER DATABASE CREATE DATAFILE N AS '/tmp/ts_dd_lhr02.dbf';`创建新的...

    ORACLE9i脚本整理,工作中常用到得实用的

    ALTER SYSTEM SWITCH LOGFILE; ``` 执行检查点: ```sql ALTER SYSTEM CHECKPOINT; ``` 以上这些脚本和命令涵盖了Oracle 9i数据库管理的各个方面,从创建数据库到日常的维护操作,都是数据库管理员必须掌握的核心...

    RMAN备份命令详解

    7. SQL> alter system archive log start; 二、连接RMAN 使用RMAN命令连接到数据库: %rman target=rman/rman@mydb 三、基本设置 在RMAN命令中,需要设置默认的备份设备为磁盘,并设置备份的并行级别和文件格式...

    sql脚本代码

    Oracle数据库日常检查 select a.tablespace_name tnm,a.bytes/1024/1024 total,c.bytes/1024/1024 free, trunc((a.bytes-c.bytes)*100/a.bytes,0) "% USED",trunc((c.bytes*100)/a.bytes,0) "% FREE" from SYS.SM$...

    Linux下RMAN备份策略.txt

    6. **监控表空间使用情况**:创建一个名为`tablespace.sh`的脚本来监控表空间的使用情况。 ```bash vi /opt/app/oracle/rman_bak/scripts/tablespace.sh chmod +x /opt/app/oracle/rman_bak/scripts/tablespace....

Global site tag (gtag.js) - Google Analytics