Search code examples
sybasesap-ase

Sybase: Can't CREATE DATABASE: Why not?


This should be simple.

The Sybase docs ("Example 1") say you don't have to specify the size parameter but even if I do:

create database pubs5 on default = '10M'

I still get an error :

Could not execute statement.
CREATE DATABASE failed because of incorrectly specified or unavailable
space. Total number of megabytes specified and available must be at
least 6 megabytes so Model Database can be copied to the new database.
SQLCODE=1810

I've tried different sizes (all over 6MB), removing the size and trying double quotes, single quotes, and no quotes.

Why is this so difficult?

Thanks.


Solution

  • The syntax is correct, but there is just not sufficient space on your Sybase database device that is marked as default.

    The simplest way of solving it is as follows:

    disk resize name='master', size='20m'
    
    create database pubs5 on master = '10M'
    

    This extends the master device by 20MB, giving you space to create the database on it. Depending on your setup, your original command may also success after the 'disk resize' command.