Based on implementing archival strategies across multiple ETQ 2022 deployments, here’s a comprehensive approach that addresses all your focus areas:
Tiered Archival Architecture:
Implement a three-tier model that balances performance with accessibility:
- Active Tier (Primary DB): Last 24 months of data - full read/write access, optimized indexes
- Archive Tier (Secondary DB): 2-7 years of data - read-only access through ETQ interface, materialized views for reporting
- Cold Storage Tier: 7+ years for extended compliance - compressed backup format, restored on-demand for audits
The key architectural decision is keeping the Archive Tier accessible through ETQ’s standard interface. This requires maintaining the same table schema and creating database links or synonyms so ETQ queries can span both databases transparently.
Compliance Retention Policies:
Your 7-year requirement is common in regulated industries. Critical compliance considerations:
- Maintain complete audit trail in archived records (all workflow history, approvals, electronic signatures)
- Preserve original timestamps and user attribution
- Ensure archived records remain tamper-evident (use read-only databases with checksums)
- Document your archival procedure as part of your QMS documentation
- Validate that archived records can be retrieved and displayed with full context during audits
For FDA/ISO compliance, the archived data must be as accessible as active data, just potentially slower to retrieve. Plan for auditors to request historical trending reports that span archived data.
Automated Archival Scheduling:
Create a robust automated process:
- Monthly archival window (typically weekend/off-hours)
- Pre-archival validation: Check for open dependencies (linked CAPAs, active workflows, pending approvals)
- Archival execution: Move records meeting age + closure criteria
- Post-archival verification: Validate record counts, audit trail integrity, FK relationships
- Performance baseline: Run standard query set to measure improvement
Implement these safety checks:
-- Dependency validation before archival
SELECT i.Incident_ID, i.Status,
COUNT(c.CAPA_ID) as Open_CAPAs
FROM Incidents i
LEFT JOIN CAPA c ON i.Incident_ID = c.Related_Incident_ID
AND c.Status NOT IN ('Closed', 'Cancelled')
WHERE i.Created_Date < DATEADD(month, -24, GETDATE())
GROUP BY i.Incident_ID, i.Status
HAVING COUNT(c.CAPA_ID) > 0;
Database Performance Monitoring:
Establish comprehensive monitoring:
- Baseline query performance metrics before archival (capture top 20 slowest queries)
- Set up SQL Server Extended Events to track query duration and resource usage
- Monitor table sizes and index fragmentation monthly
- Track archival database growth rate to predict storage needs
- Create automated alerts for queries exceeding performance thresholds
Key metrics to track:
- Average query response time for incident searches
- Report generation time for standard compliance reports
- Database size growth rate (should flatten after initial archival)
- Index maintenance duration
- Backup/restore times
Audit Trail Preservation:
This is critical and often overlooked:
- Archive entire record graphs, not just parent records (include all child tables: comments, attachments, workflow history, notifications)
- Preserve the Audit_Log table entries related to archived records
- Maintain user and lookup table data needed to interpret archived records
- Test retrieval of archived records quarterly to ensure accessibility
- Document the archival process itself in your audit trail
Implementation Lessons Learned:
- Start with read-only archive database - don’t try to build a full read/write tiered system initially
- Test archive retrieval extensively before going live - nothing worse than archived data you can’t actually access
- Plan for archive database to eventually need its own archival strategy (cold storage tier)
- Consider regulatory requirements for system validation - archival process changes may require revalidation
- Budget for increased storage - you’re not deleting data, just moving it
- Train users on how to access archived records (may require different search interface)
For your 850K records over 7 years, I’d estimate moving records older than 24 months to archive will reduce your primary database by 60-70%, which should bring query performance back to acceptable levels. The initial archival will take several hours, but subsequent monthly runs should complete in under 30 minutes.