Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The SQL for purging L1 data is:

Code Block
sql
sql

SELECT 
    count(DATA_CATALOG_ADMIN.PurgeDatasetVersion(DatasetVersion))
FROM 
    DatasetGroup g 
JOIN 
    VerDataset d 
    ON 
    (
        d.DatasetGroup= g.DatasetGroup
    ) 
JOIN 
    DatasetVersion dv 
    ON 
    (
        dv.Dataset= d.Dataset
    ) 
WHERE 
    g.DatasetLogicalFolder=39684091 
    and d.LatestVersion != dv.DatasetVersion 
    and Registered<sysdate-14

This does not actually delete data, it just puts it into the "to be deleted" table – DATASETLOCATIONPURGE. We should run this nightly as a "oracle cron" This is now run automatically as an Oracle "cron"-job.

To actually delete the files the script in ~glast/devdatacat/prod/delete-datacat must be run . This currently only exists in DEV and uses a SNAPSHOT version of the data catalog crawler software, but nonetheless deleted the files in the PROD database(as glastraw on fermilnx-v21).