For each database, you can create up to 12 dbspaces in addition to the system (main) dbspace. When a table is created without
specifying a dbspace, the dbspace named by this option setting is used. If this option is not set, is set to the empty string,
or is set to system, then the system dbspace is used.
When you create temporary tables or indexes, they are always placed in the TEMPORARY dbspace, regardless of the setting of
the default_dbspace option. If you specify the IN clause when creating a base table, the dbspace specified by the IN clause
is used, rather than the dbspace specified by the default_dbspace option.
If all tables are created in a location other than the system dbspace, then the system dbspace is only used for the checkpoint
log and system tables. This is useful if you want to put the checkpoint log on a separate disk from the rest of your database
objects for performance reasons. You can place the checkpoint log in a separate disk by changing all CREATE TABLE statements
to specify the dbspace, or by changing this option before creating any tables.
In the following example, a new dbspace named MyLibrary is created. The default dbspace is then set to the MyLibrary dbspace
and the table LibraryBooks is stored in the MyLibrary dbspace instead of the system dbspace.
CREATE DBSPACE MyLibrary
AS 'c:\\dbfiles\\library.db';
SET OPTION default_dbspace = 'MyLibrary';
CREATE TABLE LibraryBooks (
title CHAR(100),
author CHAR(50),
isbn CHAR(30),
);