Implement function for searching for database object leaks:
- This implements bug 0005861