Home | Previous Page | Next Page   Basics of Database Design and Implementation > Implementing a Relational Data Model > Creating the Database >

Using CREATE DATABASE

A database is a container that holds all parts of a data model. These parts include not only the tables but also views, indexes, synonyms, and other objects that are associated with the database. You must create a database before you can create anything else.

Global Language Support

When the database server creates a database, it stores the locale of the database that is derived from the DB_LOCALE environment variable in its system catalog. This locale determines how the database server interprets character data that is stored within the database. By default, the database locale is the U.S. English locale that uses the ISO8859-1 code set. For information on how to use alternative locales, see the IBM Informix: GLS User's Guide.

End of Global Language Support

When the database server creates a database, it sets up records that show the existence of the database and its mode of logging. These records are not visible to operating-system commands because the database server manages disk space directly.

Avoiding Name Conflicts

Normally, only one copy of the database server is running on a computer, and the database server manages the databases that belong to all users of that computer. The database server keeps only one list of database names. The name of your database must be different from that of any other database that the database server manages. (It is possible to run more than one copy of the database server. You can create more than one copy of the database server, for example, to create a safe environment for testing apart from the operational data. In this case, be sure that you are using the correct database server when you create the database and again when you access it later.)

Selecting a Dbspace

The database server lets you create the database in a particular dbspace. A dbspace is a named area of disk storage. Ask your database server administrator whether you should use a particular dbspace. You can put a database in a separate dbspace to isolate it from other databases or to locate it on a particular disk device. For information about dbspaces and their relationship to disk devices, see your IBM Informix: Administrator's Guide. For information about how to fragment the tables of your database across multiple dbspaces, see Building a Dimensional Data Model.

Some dbspaces are mirrored (duplicated on two disk devices for high reliability). You might put your database in a mirrored dbspace if its contents are of exceptional importance.

Choosing the Type of Logging

To specify a logging or nonlogging database, use the CREATE DATABASE statement. The database server offers the following choices for transaction logging:

Dynamic Server

For databases that are not ANSI-compliant, the database server administrator (DBA) can turn transaction logging on and off or change from buffered to unbuffered logging. For example, you might turn logging off before inserting a large number of new rows.

You can use IBM Informix Server Administrator (ISA) or the ondblog and ontape utilities to change the logging status or buffering mode. For information about these tools, refer to the IBM Informix: Dynamic Server Administrator's Guide. You can also use the SET LOG statement to change between buffered and unbuffered logging. For information about SET LOG, see your IBM Informix: Guide to SQL Syntax.

End of Dynamic Server
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]