Content Server Manual / Version 2406.0
Table Of Contents
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
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 if the above prerequisites are fulfilled. Proceed as follows:
Get the maximum sequence number from the database using the following SQL statement:
select max(sequenceno) from ChangeLog
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>
Delete also all but the last 100000 entries from the
LinkChangeLog
table.
delete from LinkChangeLog where sequenceno < <LimitSequenceNo>
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.