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!

Database: creating a new database

Before creating a database display the list of devices available. Take a look at device names, sizes and options. When database is being created nothing should happen incidentally.

To create a database use command like this one:

CREATE DATABASE ALFA
ON AlfaDataDev = '50M'
LOG ON AlfaLogDev

This command will create a database named ALFA and it will reside on two devices: AlfaDataDev and AlfaLogDev. Not all device space needs to be consumed by the database. As it is shown from the first device only 50 MB was taken.  In the case of the second device all space will be used by the database.
Why have we used two devices? What the syntax "ON" and "LOG ON" mean?

2016-09-11

System databases

System databases contain basic configuration information or some default values allowing Sybase to work.

master

The most important database is master. When Sybase starts option -d points to location of master device. The entire server configuration is next loaded from master database. Having this in mind - yes, master is the most important database. Next points are just consequences of this remark:
  • administrator should always have up to date backup of master database
  • no user databases should be put on the master device

Database: What is a database in SAP Sybase? System tables

A database is the basic component, where user data is stored, but apart from user data, databases store also some other elements:

  • indexes that speedup data retrieval
  • views, functions and procedures that simplify working with data
  • transaction log that is required to guarantee transactions to be consistent even if database server would be unexpectedly stopped
  • system tables describing objects that bildup the database
Let's take closer look to system tables. Their names usually begin with 'sys' prefix and generally should never be modified directly (however after changing the 'allow updates' parameter it is possible):

SAP Adaprive Server Enterprise

SAP Adaprive Server Enterprise
SAP Adaprive Server Enterprise