Close and delete temporary database right after copying it