Difference between revisions of "Managing databases tables"

From FMR Knowledge Base
Jump to navigation Jump to search
(Logging Tables)
(Logging Tables)
Line 13: Line 13:
  
 
[[File:ModificationModal.png|thumb]]
 
[[File:ModificationModal.png|thumb]]
 +
 +
  
 
The information in these tables may relate to structural submission or simply a web service query.  It is generally recommended to persist any requests which have a transaction ID against them as these are releated to structural submission, modification or deletion.
 
The information in these tables may relate to structural submission or simply a web service query.  It is generally recommended to persist any requests which have a transaction ID against them as these are releated to structural submission, modification or deletion.

Revision as of 07:25, 13 February 2023

The Registry persists information, such as settings and structural metadata to a database. The only time you may need to directly modify this database without using the Registry User Interface is to possibly remove unwanted logging information. Generally Metadata Technology does not recommend modifying database tables unless explicitly instructed to do so.

Logging Tables

Auditing and Logging in the Registry can produce large amounts of data, which is stored in the following 3 tables:

  • registry_audit
  • registry_logs (Fusion Registry 10 only)
  • registry_logs_zip (Fusion Registry 10 only)

The table registry_audit stores Audit information for requests received directly to Registry Web Services (e.g. the Data Transformation Web Service) as well as calls directly to the GUI and any Web Services that are called as direct consequence of that (e.g. the front page of the Registry 'overview.html' calls subsequent Web Services ). The registry_logs and registry_logs_zip tables are used for storing logging information which is the information generated by the Registry logger. This information is usually output to the Apache Tomcat file "FusionRegistry.logs" but can also be stored in the database.

The information stored in these tables is not particulalary visible to users of the Registry and is generally only accessible when using the "Activity" administration pages where the information can be displayed in a modal like the following:

ModificationModal.png


The information in these tables may relate to structural submission or simply a web service query. It is generally recommended to persist any requests which have a transaction ID against them as these are releated to structural submission, modification or deletion.

So to save space in your database it is recommended to periodically delete any audit and log entries that do not have an associated transaction id.

For the Audit table this can be achieved with:

 DELETE
 FROM registry_audit 
 WHERE tx_id IS NULL

and for the logging tables:

 DELETE
 FROM registry_logs logs
 JOIN registry_logs_zip zip ON logs.log_uid = zip.log_uid
 WHERE logs.log_uid IN (SELECT log_uid FROM registry_logs WHERE tx_id IS NULL);