文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 28 个 INFORMATION_SCHEMA 表 / 28.4 INFORMATION_SCHEMA InnoDB 表 / 28.4.24 INFORMATION_SCHEMA INNODB_TABLESPACES 表
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 73%

28.4.24 INFORMATION_SCHEMA INNODB_TABLESPACES 表28.4.24 The INFORMATION_SCHEMA INNODB_TABLESPACES Table

INNODB_TABLESPACES 表提供关于 InnoDB 文件每表、通用和撤销表空间的元数据。The INNODB_TABLESPACES table provides metadata about InnoDB file-per-table, general, and undo tablespaces.

有关相关的使用信息和示例,请参见 第 17.15.3 节,“InnoDB INFORMATION_SCHEMA 模式对象表”。For related usage information and examples, see Section 17.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.

Note

INFORMATION_SCHEMA FILES 表报告了 InnoDB 表空间类型的元数据,包括每表文件表空间、通用表空间、系统表空间、全局临时表空间和回滚表空间。The INFORMATION_SCHEMA FILES table reports metadata for InnoDB tablespace types including file-per-table tablespaces, general tablespaces, the system tablespace, the global temporary tablespace, and undo tablespaces.

INNODB_TABLESPACES 表具有以下列:The INNODB_TABLESPACES table has these columns:

  • SPACE

    表空间 ID。The tablespace ID.

  • NAMENAME

    模式(数据库)和表名。The schema (database) and table name.

  • FLAG

    表示表空间格式和存储特性的位级信息的数值。A numeric value that represents bit-level information about tablespace format and storage characteristics.

  • ROW_FORMATROW_FORMAT

    表空间行格式(Compact or Redundant,Dynamic 或 Compressed,或者 Undo)。此列中的数据是根据存储在数据文件中的表空间标志信息解释得出的。The tablespace row format (Compact or Redundant, Dynamic or Compressed, or Undo). The data in this column is interpreted from the tablespace flag information that resides in the data file.

    无法通过这些标志信息判断表空间行格式是 Redundant 还是 Compact,这就是为什么其中一个可能的 ROW_FORMAT 值是 Compact or Redundant。There is no way to determine from this flag information if the tablespace row format is Redundant or Compact, which is why one of the possible ROW_FORMAT values is Compact or Redundant.

  • PAGE_SIZE

    表空间页大小。此列中的数据是根据存储在 .ibd 文件 中的表空间标志信息解释得出的。The tablespace page size. The data in this column is interpreted from the tablespace flags information that resides in the .ibd file.

  • ZIP_PAGE_SIZE

    表空间压缩页的大小。此列中的数据是根据存储在.ibd 文件中的表空间标志信息进行解释的。The tablespace zip page size. The data in this column is interpreted from the tablespace flags information that resides in the .ibd file.

  • SPACE_TYPE

    表空间的类型。可能的值包括用于通用表空间的General,用于每表单文件表空间的Single,系统表空间的System,以及撤销表空间的Undo。The type of tablespace. Possible values include General for general tablespaces, Single for file-per-table tablespaces, System for the system tablespace, and Undo for undo tablespaces.

  • FS_BLOCK_SIZE

    文件系统块大小,即用于打孔的单位大小。此列与InnoDB 透明页压缩功能相关。The file system block size, which is the unit size used for hole punching. This column pertains to the InnoDB transparent page compression feature.

  • FILE_SIZE

    文件的表观大小,表示文件的最大未压缩大小。此列与 InnoDB 透明页压缩 功能相关。The apparent size of the file, which represents the maximum size of the file, uncompressed. This column pertains to the InnoDB transparent page compression feature.

  • ALLOCATED_SIZE

    文件的实际大小,即磁盘上分配的空间量。此列与 InnoDB 透明页压缩 功能相关。The actual size of the file, which is the amount of space allocated on disk. This column pertains to the InnoDB transparent page compression feature.

  • AUTOEXTEND_SIZE

    表空间的自动扩展大小。The auto-extend size of the tablespace.

  • SERVER_VERSION

    The MySQL version that created the tablespace, or the MySQL version into which the tablespace was imported, or the version of the last major MySQL version upgrade. The value is unchanged by a release series upgrade, such as an upgrade from MySQL 8.4.x to 8.4.y. The value can be considered a “creation” marker or “certified” marker for the tablespace.

  • SPACE_VERSION

    表空间版本,用于跟踪表空间格式的更改。The tablespace version, used to track changes to the tablespace format.

  • ENCRYPTIONENCRYPTION

    表空间是否加密。Whether the tablespace is encrypted.

  • STATE

    表空间状态。The tablespace state.

    对于每表文件和通用表空间,状态包括:For file-per-table and general tablespaces, states include:

    • normal:表空间正常且激活。normal: The tablespace is normal and active.

    • discarded:表空间已被 ALTER TABLE ... DISCARD TABLESPACE 语句丢弃。discarded: The tablespace was discarded by an ALTER TABLE ... DISCARD TABLESPACE statement.

    • corrupted:该表空间已被 InnoDB 识别为损坏。corrupted: The tablespace is identified by InnoDB as corrupted.

    对于撤销表空间,状态包括:For undo tablespaces, states include:

    • active:撤销表空间中的回滚段可以被分配给新的事务。active: Rollback segments in the undo tablespace can be allocated to new transactions.

    • inactive:撤销表空间中的回滚段不再被新事务使用。截断过程正在进行中。撤销表空间要么是被清除线程自动选择的,要么是通过ALTER UNDO TABLESPACE ... SET INACTIVE语句设为非活动状态的。inactive: Rollback segments in the undo tablespace are no longer used by new transactions. The truncate process is in progress. The undo tablespace was either selected by the purge thread implicitly or was made inactive by an ALTER UNDO TABLESPACE ... SET INACTIVE statement.

    • empty:撤销表空间已被截断,不再处于活动状态。它已经准备好被删除,或者可以通过ALTER UNDO TABLESPACE ... SET INACTIVE语句重新激活。empty: The undo tablespace was truncated and is no longer active. It is ready to be dropped or made active again by an ALTER UNDO TABLESPACE ... SET INACTIVE statement.

示例Example

mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES WHERE SPACE = 26\G
*************************** 1. row ***************************
         SPACE: 26
          NAME: test/t1
          FLAG: 0
    ROW_FORMAT: Compact or Redundant
     PAGE_SIZE: 16384
 ZIP_PAGE_SIZE: 0
    SPACE_TYPE: Single
 FS_BLOCK_SIZE: 4096
     FILE_SIZE: 98304
ALLOCATED_SIZE: 65536
AUTOEXTEND_SIZE: 0
SERVER_VERSION: 8.4.0
 SPACE_VERSION: 1
    ENCRYPTION: N
         STATE: normal

注释Notes

  • 你必须拥有 PROCESS 权限才能查询此表。You must have the PROCESS privilege to query this table.

  • 使用 INFORMATION_SCHEMA COLUMNS 表或 SHOW COLUMNS 语句查看关于此表列的更多信息,包括数据类型和默认值。Use the INFORMATION_SCHEMA COLUMNS table or the SHOW COLUMNS statement to view additional information about the columns of this table, including data types and default values.