Database finalizing