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
Master database has all the system tables as a normal database but  additionally contains some server scope tables:
  • sysdatabases where each row represents one database hosted on the server
  • sysdevices storing information regarding devices
  • sysusages connecting information from devices and databases tables
  • syslogins containing definitions of users allowed to connect to server
  • sysconfigures where each record represents one configuration option
  • sysmessages where all the error messages can be found
  • sysprocesses listing all the currently running processes on the server
  • syslocks storing information about all granted locks
  • sysservers containing definitions of remote servers available on local server

model

The model database is used generally only when a new database is being created. During new database creation process model database is copied. In this way new databases have all the required system tables and other objects. Administrator may also add some own tables, objects or modify parameters of model database. After this is done all new created databases will have those custom elements. 

tempdb

Tempdb is used in background when some more heavy operations are done in the normal databases. Probably this is the most used database in each implementation. Tempdb should be put on the fastest drives on the system. Temporal tables created by users will be removed when the user disconnects. Tempdb is recreated everytime when Sybase ASE starts.

sybsystemprocs

Here most of the system stored procedures are hold. Some stored procedures are saved in master databases and user procedures are saved in user databases. Procedures stored in sybsystemprocs can be called from every user databases. Those procedures usually operate on system tables that should not be modified directly.

Optional system databases

Other system tables are optional as they are supporting optional features of the server:

  • sybsecurity - used for audit purpose
  • dbccdb - supports dbcc checkstorage command that is often used by administrator as efficient way of database consistency check
  • sybsyntax - database required when administrator plans to use sp_syntax stored procedure allowing to get better help with syntax information regarding commands
  • example databases: pubs2, pubs3 - that can be added to server using install scripts created during installation in /sybase/install directory.

No comments:

Post a Comment

SAP Adaprive Server Enterprise

SAP Adaprive Server Enterprise
SAP Adaprive Server Enterprise