private void updateCatalogNameInTable(Statement stmt, String tableName, String catColName, String dbColName,
      String fromCatName, String toCatName, String dbName, boolean zeroUpdatesOk)
      throws HiveMetaException, SQLException {
    String update = String.format(schemaTool.quote(UPDATE_CATALOG_NAME_STMT), tableName, catColName, toCatName,
        catColName, fromCatName, dbColName, dbName);
    LOG.debug("Going to run " + update);
    int numUpdated = stmt.executeUpdate(update);
    if (numUpdated != 1 && !(zeroUpdatesOk && numUpdated == 0)) {
      throw new HiveMetaException("Failed to properly update the " + tableName +
          " table.  Expected to update 1 row but instead updated " + numUpdated);
    }
  }
Print Hive version and schema version.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMoveDatabase.java