@Override
  public boolean dropDatabase(String catName, String dbname)
      throws NoSuchObjectException, MetaException {
    boolean success = false;
    LOG.info("Dropping database {}.{} along with all tables", catName, dbname);
    dbname = normalizeIdentifier(dbname);
    catName = normalizeIdentifier(catName);
    try {
      openTransaction();

      // then drop the database
      MDatabase db = getMDatabase(catName, dbname);
      pm.retrieve(db);
      List<MDBPrivilege> dbGrants = this.listDatabaseGrants(catName, dbname, null);
      if (CollectionUtils.isNotEmpty(dbGrants)) {
        pm.deletePersistentAll(dbGrants);
      }
      pm.deletePersistent(db);
      success = commitTransaction();
    } catch (Exception e) {
      LOG.error("Failed to drop database", e);
      throw new MetaException(e.getMessage());
    } finally {
      rollbackAndCleanup(success, null);
    }
    return success;
  }
Alter the database object in metastore. Currently only the parameters
of the database or the owner can be changed.
@param dbName the database name
@param db the Hive Database object
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java