close

Filter

loading table of contents...

Content Server Manual / Version 2110

Table Of Contents

3.11 Truncate the ChangeLog

As described in Section 2.5, “Changelog”, all events are written to the ChangeLog table of the database. The table is never truncated by default in order to enable event replay right from the beginning. Nevertheless, you might want to reduce the size of the evergrowing table on your own. In one go, you can also truncate the LinkChangeLog and ObservedValueChangelog tables. That is, because the sequenceno in these tables is a foreign key to the sequenceno in the ChangeLog table and therefore useless if you delete the respective row in the ChangeLog table.

Caution

Caution

If you delete events from the ChangeLog, listeners which try to retrieve these events will fail. In particular, Replication Live Server that have not caught up with the Master Live Server will become unusable.

Prerequisites

If you want to truncate the ChangeLog table the following prerequisites should be fulfilled:

  • Little system load for example in the evening.

  • All clients which use the ChangeLog are up to date.

  • New backup of the system has been made

Truncate the ChangeLog

When you truncate the ChangeLog, you should not delete all entries. You may leave 100000 entries which is a good value proven by practice. Proceed as follows:

  1. Get the maximum sequence number from the database using the following SQL statement:

select max(sequenceno) from ChangeLog
  1. Delete all but the last 100000 entries from the table. Replace <LimitSequenceNo> with the maximum sequence number minus 100000:

delete from ChangeLog where sequenceno < <LimitSequenceNo>
  1. Delete also all but the last 100000 entries from the LinkChangeLog table.

delete from LinkChangeLog where sequenceno < <LimitSequenceNo>
  1. Delete also all but the last 100000 entries from the ObservedValueChangeLog table.

delete from ObservedValueChangeLog where sequenceno < <LimitSequenceNo>

All but the last 100000 entries are deleted from the ChangeLog, LinkChangeLog and ObservedValueChangeLog tables.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.