Database file space pre-allocation

When you create a new database file, you can preallocate database space using the DATABASE SIZE clause of the CREATE DATABASE statement or by specifying the dbinit -dbs option. See CREATE DATABASE statement, and Initialization utility (dbinit).

As you use the database, SQL Anywhere 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. See ALTER DBSPACE statement.

 Preallocate space (Sybase Central)
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.

  1. Connect to the database as a user with DBA authority.

  2. Use the SQL Anywhere 12 plug-in to connect to the database as a user with DBA authority.

  3. Open the Dbspaces folder.

  4. Right-click the dbspace and click Preallocate Space.

  5. Enter the amount of space to add to the dbspace. You can add space in units of pages, bytes, kilobytes (KB), megabytes (MB), gigabytes (GB), or terabytes (TB).

  6. Click OK.

 Preallocate space (SQL)
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.

  1. Connect to a database as a user with DBA authority.

  2. Execute an ALTER DBSPACE statement.

 See also
 Examples