-1

This is how I do in SQL Server:

Create Database MyDatabase
on (Name='MyDatabase_Data',
    Filename='c:\db\BdUnisanta_Data.mdf',
    Size= 20MB,
    FileGrowth = 10%,
    Maxsize=100MB)
log on 
    (Name = 'MyDatabase_log',
     Filename = 'c:\db\MyDatabase_Log.ldf',
     Size = 5MB,
     FileGrowth = 5%,
     MAXSIZE = UNLIMITED
     ) 

How I could do that in these databases?

3

2 Answers 2

2

In DB2 you can also specify MAXSIZE of each tablespace, as well as the maximum size and number of log files. For example:

create db mydb on /whatever dbpath on /whatever
catalog tablespace managed by automatic storage maxsize 500 M
user tablespace  managed by automatic storage maxsize 100 G;

update db cfg for mydb using logfilsiz 4000 logprimary 10 logsecond 100;

There is a question of temporary tablespace(s) though. By default they are created such that you cannot specify their maximum size, and really you should not. However, there is a workaround, although with a possible performance penalty.

Link to the manual.

1

In regards to PostgreSQL: As far as I know, you can't. However, there are workarounds explained in this posting: https://bytes.com/topic/postgresql/answers/421532-database-size-limiting

Hope this helps.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.