Search code examples
virtuosotransaction-log

Is it safe to delete virtuoso.trx?


I just looked into one of our Virtuoso db directories and noticed that virtuoso.db is not the biggest file there -- virtuoso.trx (transaction log) is.

Assuming that I am happy with the data in virtuoso.db and do not anticipate needing to reverse any transactions, is it safe to delete that file and restart (to conserve disk space)?

RELATED: Virtuoso Data Backup & Recovery


Solution

  • virtuoso.db was the active DB immediately following the last CHECKPOINT.

    virtuoso.trx is the transaction log, which holds all changes made since the last CHECKPOINT was run.

    virtuoso.db plus virtuoso.trx delivers your current active DB.

    You should not delete the virtuoso.trx if you want the virtuoso.db to stay as it is. You should start an iSQL or similar session, and run a CHECKPOINT(). The .trx file will be reduced to zero as part of this process.

    If you delete this file without running a CHECKPOINT, you will lose all that activity -- whether it was INSERT, UPDATE, DELETE, or otherwise.

    Default configuration has CheckpointInterval of 60 minutes -- so a CHECKPOINT(); will run every 60 minutes, and the transaction log will not grow excessively.

    See --