Virtuoso RDF Graph Replication log files Purge Function

What

By default Virtuoso RDF Graph Replication writes replication log and configuration files to the same directory as the replication master publisher node database files reside in.

Why

The replication logs files grow in number continuously overtime as more update activities take place on the replication master publisher node, consuming a significant amount of disk space. There is this the need for a function to purge these logs files and also and also write them to a different location if required.

How

A new function repl_purge_to_level ('__rdf_repl') is available in Virtuoso 08.03.3315+ and 07.20.3232+ builds for purging replication logs. This function will purge all existing replication logs up to the current log, unless second argument is given to specify to what replication level (also called sync anchor) to start the purge from ie repl_purge_to_level ('__rdf_repl', level).

After running the repl_purge_to_level ('__rdf_repl') function the purged logs will be renamed to xxx.log.bak and the repl.cfg file will be updated with active replications logs. The purged xxx.log.bak files can then be archived or deleted as required.

Example

SQL> repl_purge_to_level ('__rdf_repl');

Done. -- 17 msec.
SQL> quit;
hwilliams@madras:/openlink/support/virtuoso/v72$ ls -ltr database 
total 1505211
lrwxrwxrwx 1 hwilliams support        24 Sep 18 14:33 virtuoso -> ../bin/virtuoso-iodbc-t
-rw-r--r-- 1 hwilliams support     73076 Sep 18 14:33 php.ini
drwxr-sr-x 2 hwilliams support         2 Sep 18 14:33 backup
-rw-r--r-- 1 hwilliams support         0 Sep 18 14:33 virtuoso.pxa
-rw-r--r-- 1 hwilliams support      6651 Sep 18 14:33 virtuoso.ini
-rw-r--r-- 1 hwilliams support      3732 Sep 18 14:33 repl.cfg.bak
-rw-r--r-- 1 hwilliams support  15421021 Sep 18 14:33 __rdf_repl.log.bak
-rw-r--r-- 1 hwilliams support  15845745 Sep 18 14:33 __rdf_repl20181123160100236959.log.bak
-rw-r--r-- 1 hwilliams support  16538582 Sep 18 14:33 __rdf_repl20181123160108136316.log.bak
-rw-r--r-- 1 hwilliams support  13586224 Sep 18 14:33 __rdf_repl20181123160116631230.log.bak
.
.
.
-rw-r--r-- 1 hwilliams support  10096470 Sep 18 14:33 __rdf_repl20181123162012881755.log.bak
-rw-r--r-- 1 hwilliams support  10147865 Sep 18 14:33 __rdf_repl20181123162013702397.log.bak
-rw-r--r-- 1 hwilliams support   7860840 Sep 18 14:33 __rdf_repl20181123162014529454.log
-rw-r--r-- 1 hwilliams support        14 Sep 18 15:06 virtuoso.lck
-rw-r--r-- 1 hwilliams support   2097152 Sep 18 15:06 virtuoso-temp.db
-rw-r--r-- 1 hwilliams support 400556032 Sep 18 15:06 virtuoso.db
-rw-r--r-- 1 hwilliams support      1715 Sep 18 15:16 virtuoso.trx
-rw-r--r-- 1 hwilliams support    644696 Sep 18 15:18 virtuoso.log
-rw-r--r-- 1 hwilliams support        56 Sep 18 15:18 repl.cfg
hwilliams@madras:/openlink/support/virtuoso/v72$
hwilliams@madras:/openlink/support/virtuoso/v72$ cat database/repl.cfg
__rdf_repl           __rdf_repl20181123162014529454.log
hwilliams@madras:/openlink/support/virtuoso/v72$

Note when initially setting up the replication master publisher, the directory replication file are written to can also be specified, with the Virtuoso Configuration (virtuoso.ini) file LogDirectory parameter in the Replication section ie

[Replication]
LogDirectory = replication

Related