CHAPTER 3 Working with Database Objects

Creating a database

When you create a database, the database server creates the following four dbspaces:

 

 

Default operating

dbspace name

Contents

system file name

 

 

 

IQ_SYSTEM_MAIN

Main (permanent) IQ

dbname.iq

 

Store file

 

 

 

 

IQ_SYSTEM_TEMP

Temporary IQ Store file

dbname.iqtmp

 

 

 

IQ_SYSTEM_MSG

Message log file

dbname.iqmsg

 

 

 

SYSTEM

Catalog Store file

dbname.db

 

 

 

 

The SYSTEM dbspace contains the system tables, which hold the schema

 

definition as you build your database. It also holds a separate checkpoint log,

 

rollback log, and optionally a write file, transaction log, and transaction log

 

mirror, for the Catalog Store.

 

 

 

Note In addition to these database files, the database server also uses a

 

temporary file to hold information needed during a session. This temporary file

 

is not the same as the Temporary IQ Store, and is not needed once the database

 

server shuts down. The file has a server-generated name with the extension

 

.tmp. Its location is determined by the TEMP environment variable, or the

 

ASTMP environment variable on UNIX.

 

 

 

You create a database using either the CREATE DATABASE statement or Sybase

 

Central. Once the database is created, you can connect to it and build the tables

 

and other objects that you need in the database.

Before you create

In order to create a database, you must:

your database

• Start the database server

 

 

• Start either Sybase Central or DBISQL

 

To create a database in DBISQL, you need to connect to an existing database,

 

or else start the utility database, a phantom database with no database files and

 

no data. You must start the utility database before creating new databases if no

 

databases are built yet. For information on the utility database and its security,

 

see the Adaptive Server IQ Installation and Configuration Guide.

 

If you are creating an IQ database for the first time, see the Introduction to

 

Adaptive Server IQ for assistance.

107

Page 127
Image 127
Sybase 12.4.2 manual Creating a database, 107