private boolean checkMetaStoreDBLocation(Connection conn, URI[] defaultServers) throws HiveMetaException {
    String dbLocQuery = schemaTool.quote(QUERY_DB_LOCATION);

    int numOfInvalid = 0;
    try (Statement stmt = conn.createStatement();
         ResultSet res = stmt.executeQuery(dbLocQuery)) {
      while (res.next()) {
        String locValue = res.getString(3);
        String dbName = getNameOrID(res, 2, 1);
        if (!checkLocation("Database " + dbName, locValue, defaultServers)) {
          numOfInvalid++;
        }
      }
    } catch (SQLException e) {
      throw new HiveMetaException("Failed to get DB Location Info.", e);
    }
    return numOfInvalid == 0;
  }
Print Hive version and schema version.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskValidate.java