Data storage concepts
When converting from Informix® to IBM® DB2® the aim is to try to preserve as much of the data storage information as possible in the process. The most important storage decisions made for Informix database objects (like initial sizes and physical placement) can be applied to the IBM DB2 database.
Storage concepts are quite similar in Informix and in IBM DB2, but the names are different.
These tables compare Informix storage concepts to IBM DB2 storage concepts:
Informix | IBM DB2 |
---|---|
The largest unit of physical disk space is a "chunk", which can be allocated either as a cooked file ( I/O is controlled by the OS) or as raw device (=UNIX® partition, I/O is controlled by the database engine). A "dbspace" uses at least one "chunk" for storage. You must add "chunks" to "dbspaces" in order to increase the size of the logical unit of storage. |
One or more "containers" are created for each "tablespace" to physically store the data of all logical structures. Like Informix "chunks", "containers" can be an OS file or a raw device. You can add "containers" to a "tablespace" in order to increase the size of the logical unit of storage or you can define EXTEND options. |
A "page" is the smallest physical unit of disk storage that the engine uses to read from and write to databases. A "chunk" contains a certain number of "pages". The size of a "page" must be equal to the operating system's block size. |
At the finest level of granularity, IBM DB2 stores data in "data blocks" with size corresponding to a multiple of the operating system's block size. You set the "data block" size when creating the database. |
An "extent" consists of a collection of contiguous "pages" that the engine uses to allocate both initial and subsequent storage space for database tables. When creating a table, you can specify the first extent size and the size of future extents with the EXTENT SIZE and NEXT EXTENT options. For a single table, "extents" can be located in different "chunks" of the same "dbspace". |
An "extent" is a specific number of contiguous "data blocks", obtained in a single allocation. When creating a table, you can specify the first extent size and the size of future extents with the STORAGE() option. For a single table, "extents" can be located in different "data files" of the same "tablespace". |
Informix | IBM DB2 |
---|---|
A "table" is a logical unit of storage that contains rows of data values. | Same concept as Informix. |
A "database" is a logical unit of storage that contains table and index data. Each database also contains a system catalog that tracks information about database elements like tables, indexes, stored procedures, integrity constraints and user privileges. | Same concept as Informix. An IBM DB2 instance can manage several databases. |
Database tables are created in a specific "dbspace", which defines a logical place to store data. If no dbspace is given when creating the table, Informix defaults to the current database dbspace. |
Database tables are created in a specific "tablespace", which defines a logical place to store data. The main difference with Informix "dbspaces", is that IBM DB2 tablespaces belong to a "database", while Informix "dbspaces" are external to a database. |
Informix | IBM DB2 |
---|---|
When initializing an Informix engine, a "root dbspace" is created to store information about all databases, including storage information (chunks used, other dbspaces, etc.). | Each IBM DB2 database uses a set of "control files" to store internal information. These files are located in a dedicated directory: ".../$DB2INSTANCE/NODEnnnn" |
The "physical log" is a set of continuous disk pages where the engine stores "before-images" of data that has been modified during processing. The "logical log" is a set of "logical-log files" used to record logical operations during on-line processing. All transaction information is stored in the logical log files if a database has been created with transaction log. Informix combines "physical log" and "logical log" information when doing fast recovery. Saved "logical logs" can be used to restore a database from tape. | DB2 uses "database log files" to record SQL transactions. |