how to investigate a database