public static void checkDBVersion() throws AmbariException {

    LOG.info("Checking DB store version");
    if (metainfoDAO == null) {
      metainfoDAO = injector.getInstance(MetainfoDAO.class);
    }

    MetainfoEntity schemaVersionEntity = metainfoDAO.findByKey(Configuration.SERVER_VERSION_KEY);
    String schemaVersion = null;

    if (schemaVersionEntity != null) {
      schemaVersion = schemaVersionEntity.getMetainfoValue();
    }

    Configuration conf = injector.getInstance(Configuration.class);
    File versionFile = new File(conf.getServerVersionFilePath());
    if (!versionFile.exists()) {
      throw new AmbariException("Server version file does not exist.");
    }
    String serverVersion = null;
    try (Scanner scanner = new Scanner(versionFile)) {
      serverVersion = scanner.useDelimiter("\\Z").next();

    } catch (IOException ioe) {
      throw new AmbariException("Unable to read server version file.");
    }

    if (schemaVersionEntity==null || VersionUtils.compareVersions(schemaVersion, serverVersion, 3) != 0) {
      String error = "Current database store version is not compatible with " +
        "current server version"
        + ", serverVersion=" + serverVersion
        + ", schemaVersion=" + schemaVersion;
      LOG.warn(error);
      throw new AmbariException(error);
    }

    LOG.info("DB store version is compatible");
  }
Validates configuration consistency by ensuring that configuration types
only have a single entry in {@link ClusterConfigEntity} which is enabled.
Additionally will check to ensure that every installed service's
configurations are present in the configuration table.

@throws AmbariException
          if check failed
@see ClusterConfigEntity#isSelected()
ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java