How can I run a repair/optimize on database tables?

I inadvertedly remove users from the global wp-users table that’s found in my multi-db global database. I didn’t take note of the user IDs before removing, and now have several “ghost” accounts in the wp_usermeta table.

I’ve found a few plugins that may possibly help cleanup my mess, however, they’re not able to see these tables. Is there another option I can use to repair/optimize my tables, or to help fix my screw up?

Thanks!