Switching your ReportServer archive tables off

ReportServer uses Hibernate Envers (https://hibernate.org/orm/envers/) as an archiving / versioning solution for entity classes. This might result in an unexpected and unwanted growth of size of the ReportServer repository database.

A new revision is created on every single entity change, so the archive tables grow with each entity modification. Thus, these tables get larger and larger, making your DB occupy a large amount of space after some time. If you don’t need the archive tables, you can easily turn this behaviour off.

For each table in the ReportServer repository there is a shadow table which has the same as the original tables plus the suffix _A. All entity versions can be found in the these tables. The “_A” suffix stands for “archive” or “audit”. So, e.g., your User’s revisions are found in the RS_USER_A archive table, since the respective actual entity versions are located in the RS_USER table.

To stop this behaviour in your ReportServer installation, open your persistence.xml and locate the section containing the string <!– Envers –>.
Then add the following:

<property name="hibernate.integration.envers.enabled" value="false"/>

The result would be similar to:

<!-- Envers -->
<property name="org.hibernate.envers.audit_table_suffix" value="_A"/>
<property name="org.hibernate.envers.audit_table_prefix" value=""/>
<property name="hibernate.integration.envers.enabled" value="false"/>

After a ReportServer restart, you can make sure that the archive tables are switched off by opening a ReportServer terminal session and typing a rev command for a given entity, as in this example:

Making sure the archive tables are switched off

If you get the message “Service is not yet initialized”, the archive tables are correctly turned off.

Once your archive tables are switched off, you can modify your “_A” tables: you can either leave them as they are or delete the entries.

Attention:
Once the archive tables are switched off, they cannot be switched on again unproblematically.
Pls. do not confuse the archive tables with the audit log ReportServer maintains in the RS_AUDIT_* tables. These are not impacted by the operations described above.