Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » SQL Anywhere database connections » Database file types » Additional dbspaces considerations

 

Preallocating database file space (SQL)

When you create a new database file, you can preallocate database space using the DATABASE SIZE clause of the CREATE DATABASE statement. Preallocating space can improve performance for loading large amounts of data and keeps database files more contiguous.

Prerequisites

You must have the MANAGE ANY DBSPACE system privilege.

Context and remarks

As you use a database, it automatically grows database files as needed. Rapidly-changing database files can lead to excessive file fragmentation on the disk, resulting in potential performance problems. As well, many small allocations are slower than one large allocation. If you are working with a database with a high rate of change, you can preallocate disk space for dbspaces or for transaction logs using either Sybase Central or the ALTER DBSPACE statement.

Tip

Running a disk defragmentation utility after preallocating disk space helps ensure that the database file is not fragmented over many disjointed areas of the disk drive. Performance can suffer if there is excessive fragmentation of database files.

 Task
  1. Connect to a database.

  2. Execute an ALTER DBSPACE statement.

Results

Database file space is preallocated.

Example

Increase the size of the system dbspace by 200 pages.

ALTER DBSPACE system
ADD 200;

Increase the size of the system dbspace by 400 megabytes.

ALTER DBSPACE system
ADD 400 MB;

 See also