Add more judgment

database is exists,
all tables types checking