You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Terry <th...@gmail.com> on 2019/05/26 08:13:56 UTC

Delete all databases in hive

Team, Is there a way to delete all db’s owned by a user in hive? We have
hundreds of db’s owned by several users who left the organization.


Any help is much appreciated!

RE: Delete all databases in hive

Posted by Jon Morisi <Jo...@hsc.utah.edu>.
Dump a list of databases to a file, write a bash script to iterate through and execute drop database with cascade commands?

Something like:
hive --outputformat=dsv --showHeader=false -e "drop database $LINE with cascade;"
done < "$FILE"

From: Terry <th...@gmail.com>
Sent: Sunday, May 26, 2019 2:14 AM
To: user@hive.apache.org
Subject: Delete all databases in hive


Team, Is there a way to delete all db’s owned by a user in hive? We have hundreds of db’s owned by several users who left the organization.



Any help is much appreciated!