global-archiver
This is a tool to move a part of a global from a database to another database.
Article on DC-EN.
Sample repository with mirroring and ECP: global-archiver-sample
Run with Docker
Build:
docker-compose build --no-cache
Start container :
docker-compose up -d
Installation ZPM
zpm "install global-archiver"
How to Test it
Create a database named “ARCHIVE”
Do ##class(lscalese.globalarchiver.sample.DataLog).CreateDB("ARCHIVE")
Open IRIS terminal:
Generate 10 000 records in a sample table.
Do ##class(lscalese.globalarchiver.sample.DataLog).GenerateData(10000)
Get the last id older than 30 days:
Set lastId = ##class(lscalese.globalarchiver.sample.DataLog).GetLastId(30)
Copy data older than 30 days to the ARCHIVE database:
Set Global = $Name(^lscalese.globalarcCA13.DataLogD)
Set sc = ##class(lscalese.globalarchiver.Copier).Copy(Global, lastId, "ARCHIVE")
Delete data from the source database:
Set sc = ##class(lscalese.globalarchiver.Cleaner).DeleteArchivedData(Global,"ARCHIVE")