RelationalDBDesignRelationalDBDesign


Create Database   «Prev  Next»
Lesson 11 Creating initial tablespaces
Objective Create initial tablespaces for your database.

Creating initial Tablespaces

There are at least four tablespaces that every OFA-compliant database should have. Tablespaces you should have These are:
  1. USERS: Holds user tables, indexes, and so forth.
  2. TEMP: Used for sorting.
  3. RBS: Holds the rollback segments.
  4. TOOLS: Holds tables and indexes for tools such as Enterprise Manager, Discoverer 2000, and so forth.

You can create these databases from Server Manager by using the CREATE TABLESPACE command. The syntax for that command looks like this:
CREATE TABLESPACE tablespace_name

 DATAFILE ‘filename’ SIZE integer[M|K];

Tablespace guidelines

This is a simplified version of CREATE TABLESPACE, but it will work for now. Before you can create these tablespaces, you need to decide on file locations, filenames, and file sizes for each of these. The OFA guidelines call for these tablespaces to be placed on separate drives, but because this is not a production database, let's place the files in the same directory used for all the other database files. For names and sizes, let's go with the following:

Tablespace Name  File Name   Size

 USERS     users01.dbf   5MB

 TOOLS     tools01.dbf   5MB

 TEMP     temp01.dbf   5MB

 RBS      rbs01.dbf   5MB

How you size these tablespaces depends on what tools you have installed and on the applications running against the database.

Create Initial Tablespaces - Exercise

Now, try this exercise to create tablespaces for your database.
Create Initial Tablespaces - Exercise