Detach and Reattach the database