improved database_info script