16.10.2015 Views

Getting Started with DB2 Express-C

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

66 <strong>Getting</strong> <strong>Started</strong> <strong>with</strong> <strong>DB2</strong> <strong>Express</strong>-C<br />

Figure 4.8 –Table spaces created by default when a database is created<br />

Table space SYSCATSPACE contains the System Catalog tables. The System Catalog is<br />

called the data dictionary in other relational database management systems. It basically<br />

contains system information that should not be modified or deleted; otherwise the database<br />

will not work correctly. Table space TEMPSPACE1 is used by <strong>DB2</strong> when it needs additional<br />

space to perform some operations such as sorts. Table space USERSPACE1 is normally<br />

used to store user database tables if there is no table space specified when creating a<br />

table.<br />

You can also create your own table spaces using the CREATE TABLESPACE statement.<br />

Figure 4.9 shows the table space MYTBLS1 created inside database MYDB1 on instance<br />

<strong>DB2</strong>. When you create a table space, you specify the disks to use and the memory (buffer<br />

pool) to use. Therefore, if you have a “hot” table, that is, a table that is used very often, you<br />

can allocate the fastest disks and the most memory by assigning a table space <strong>with</strong> these<br />

characteristics.<br />

In Figure 4.9, we show two other objects created by default: A buffer pool called<br />

IBMDEFAULTBP, and the log files.<br />

A buffer pool is basically a memory cache used by the database. You can create one or<br />

more buffer pools, but there should always be one buffer pool <strong>with</strong> a page size that<br />

matches the page size of existing table spaces. Pages and page size will be discussed in<br />

more detail in Chapter 6, <strong>DB2</strong> Architecture.<br />

The log files are used for recovery. When you work on a database, not only is information<br />

stored in the disks for the database, but while you are working on the database, log files<br />

store all the operations executed on the data. Think of logs as temporary files where an<br />

“autosave” operation is performed. Logs are discussed in more detail in Chapter 11,<br />

Backup and Recovery.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!