Trim database archives based on retention