2016-12-11

SQL: Sybase transaction log

Each user's connection, has 2KB of memory assigned, that should be used as a buffer. It is called User Log Cache (ULC). It can be said, that transaction is played in the ULC first. If transaction is short, than it fits fully into the ULC, but if it is too long, than the ULC would fill up...

So whenever COMMIT is issued by the transaction or if the ULC becomes full, Sybase sends the modified pages into the database's transaction log.

At that time, we can say, that transaction log is more important as the database itself. Every committed transaction is saved in the log first. The data file can be not modified at all! Let's analyze, what happens when user modifies some data:

  • data is read form the disk into the buffer
  • user transaction begins
  • transaction data modifications are done and stored in ULC
  • finally, the transaction issues the COMMIT
  • data from ULC is sent to transaction log
  • when the 'save on disk' operation finishes the user application can continue, as at that moment we are sure, that the transaction is fully stored on the disk, data modification is also done in memory buffer, where the "up to date" pages are stored
  • ...
  • at some moment a CHECKPOINT is issued
  • CHECKPOINT synchronizes the data from buffer cache to disk

SAP Adaprive Server Enterprise

SAP Adaprive Server Enterprise
SAP Adaprive Server Enterprise