Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Backup specific Hive table

Solved Go to solution
Highlighted

Backup specific Hive table

Explorer

Hi,

I am able to backup all my hive tables by backuping the HDFS folder /apps/hive/warehouse and the MySQL database (mysql dump and restore).

How can I backup some Hive tables only? for HDFS files it's easy. But how can I backup/restore the metadata from MySQL for only those tables ?

Cheers!

Joe

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Backup specific Hive table

Hi @Joe Harvy

You can create scripts that will create the databases and tables based off the Hive metastore. This blog walks you through the step.

https://sharebigdata.wordpress.com/2016/06/12/hive-metastore-internal-tables/

View solution in original post

3 REPLIES 3
Highlighted

Re: Backup specific Hive table

Hi @Joe Harvy

You can create scripts that will create the databases and tables based off the Hive metastore. This blog walks you through the step.

https://sharebigdata.wordpress.com/2016/06/12/hive-metastore-internal-tables/

View solution in original post

Highlighted

Re: Backup specific Hive table

Rising Star

Great post @Scott Shaw

The partial backup/restore of Hive metastore can be a good new feature for Hive.

In general Hive Metastore is shared by many projects/teams , and at the moment we are unable to restore the metadata for one team ( only few tables ) without impacting the others.

Re: Backup specific Hive table

Contributor

One another way to backup/restore specific hive tables would be to use 'show create table' to back up DDL which could be used to recreate the table. Then the saved hdfs files could be dropped to warehouse dir to finish the table restore.

beeline -u jdbc:hive2://<cluster-name>:<port#>/<db-name> --outputformat=csv -e "show create table <table-name>;" > <table_name>.ddl

Don't have an account?
Coming from Hortonworks? Activate your account here