2016-09-19

Database creation - the 3 worst practicies

Isn't it stupid, that default settings are usually not the best!? Couldn't every software be designed so, that default options are optimal and
recommended values? No. Default settings should allow the currently running process to finish successfully...

So let's take look at default options when a new database is created in Sybase. Are defaults optimal?

The shortest form

CREATE DATABASE Alfa
What will happen here? Where will the database be created? Answer is easy - on default device! If the administrator followed one of the best practices during devices administration, that the default device is on a dedicated file or disk. But if the administrator was too lazy, than the default device is still master!


Creating database without pointing to a device causes all those databases being created on the same device. Very bad practice!

Having user databases on master device may cause space will be exhausted on the device and space in master may be the problem. This may even cause system instability. Additionally recovering a user database or master database may be much more difficult. If you wish to have problems follow this way.

Database without size

CREATE DATABASE Alfa
ON DataDev1
LOG ON LogDev1
It is much better than previous example, but here no size was mentioned. What does it mean? As you probably remember a new database is a copy of a model database. This answers question about the size of a new database - it is equal to model database, what usually means it is too small. Shortly users will contact you complaining about database being full. If you enjoy being sociable that way - yes this is something you should try...

Database without log specified

CREATE DATABASE Alfa
ON DataDev1 = "1G"

Well here a database is being created on dedicated device and has size specified. Nice. But where is the log? If not specified than log resides on the same device as the data. Is this optimal? Not quite, as this causes performance problems (data and log compete for disk operations) and recover-ability of the database in case of disk failure. If something happens, both the data and the log will be lost. However  if you like risky adventures - it is something for you!

No comments:

Post a Comment

SAP Adaprive Server Enterprise

SAP Adaprive Server Enterprise
SAP Adaprive Server Enterprise