Contents Index Using additional dbspaces Deleting a dbspace

ASA Database Administration Guide
  Working with Database Files
    Using additional dbspaces

Creating a dbspace


You create a new database file, or dbspace, either from Sybase Central, or using the CREATE DBSPACE statement. The database file for a new dbspace may be on the same disk drive as the main file or on another disk drive. You must have DBA authority to create dbspaces.

For each database, you can create up to twelve dbspaces in addition to the main dbspace.

Placing tables in dbspaces 

A newly created dbspace is empty. When you create a new table you can place it in a specific dbspace with an IN clause in the CREATE TABLE statement. If you don't specify an IN clause, the table appears in the main dbspace.

Each table is entirely contained in the dbspace it is created in. By default, indexes appear in the same dbspace as their table, but you can place them in a separate dbspace by supplying an IN clause.

To create a dbspace (Sybase Central)

  1. Connect to the database.

  2. Open the Dbspaces folder for that database.

  3. Click the New Dbspace button on the toolbar.

  4. Follow the instructions in the wizard.

    The new dbspace then appears in the Dbspaces folder.

To create a dbspace (SQL)

  1. Connect to the database.

  2. Execute a CREATE DBSPACE statement.

Examples 

The following command creates a new dbspace called library in the file library.db in the same directory as the main file:

CREATE DBSPACE library
AS 'library.db'

The following command creates a table LibraryBooks and places it in the library dbspace.

CREATE TABLE LibraryBooks (
title char(100),
author char(50),
isbn char(30)
) IN library

See also


Contents Index Using additional dbspaces Deleting a dbspace