Assigning space and devices to databases

Adaptive Server allocates storage space to databases when a user enters the create database or alter database command. create database can specify one or more database devices, along with the amount of space on each that is to be allocated to the new database.

WARNING! Unless you are creating a small or noncritical database, always place the log on a separate database device. Follow the instructions in “Placing the transaction log on a separate device” to create production databases.

If you use the default keyword, or if you omit the on clause, Adaptive Server puts the database on one or more of the default database devices specified in master..sysdevices. See Chapter 7, “Initializing Database Devices,” in the System Administration Guide: Volume 1.

To specify a size (4MB in the following example) for a database that is to be stored in a default location, use:

create database newpubs
on default = "4M"

To place the database on specific database devices, include the names of the database devices in the command. You can request that a database be stored on more than one database device, with a different amount of space on each. All the database devices named in create database must be listed in sysdevices (that is, they must have been initialized with disk init). See Chapter 7, “Initializing Database Devices,” in the System Administration Guide: Volume 1

The following statement creates the newdb database and allocates 3MB on mydata and 2MB on newdata. The database and transaction log are not separated:

create database newdb
on mydata = "3M", newdata = "2M"

If the amount of space you request on a specific database device is unavailable, Adaptive Server creates the database with as much space as possible on each device and displays a message informing you how much space it has allocated on each database device. If there is less than the minimum space necessary for a database on the specified database device, create database fails.

If you create (or alter) a database on a UNIX device file that does not use the dsync setting, Adaptive Server displays an error message in the error log file, for example:

Warning: The database 'newdb' is using an unsafe virtual device 'mydata'. The recovery of this database can not be guaranteed.