Differences between revisions 1 and 2
Revision 1 as of 2013-10-04 08:15:29
Size: 1254
Editor: HyunsikChoi
Comment: Add a manual for tajo_dump.
Revision 2 as of 2014-03-06 04:51:27
Size: 0
Editor: HyunsikChoi
Comment: the doc was moved into new doc.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Catalog Backup and Restore ==
Now, Tajo supports a two backup methods for catalog:
 * SQL dump
 * Database-level backup

=== SQL dump ===

SQL dump is an easy and strong way. If you use this approach, you don't need to concern database-level compatiblities. If you want to backup your catalog, just use bin/tajo_dump command. The basic usage of this command is:
{{{
$ tajo_dump table_name > outfile
}}}

For example, if you want to backup a table ''customer'', you should type a command as follows:
{{{
$ bin/tajo_dump customer > table_backup.sql
$ cat table_backup.sql
-- Tajo database dump
-- Dump date: 10/04/2013 16:28:03
--

--
-- Name: customer; Type: TABLE; Storage: CSV
-- Path: file:/home/hyunsik/tpch/customer
--
CREATE EXTERNAL TABLE customer (c_custkey INT8, c_name TEXT, c_address TEXT, c_nationkey INT8, c_phone TEXT, c_acctbal FLOAT8, c_mktsegment TEXT, c_comment TEXT) USING CSV LOCATION 'file:/home/hyunsik/tpch/customer';
}}}

If you want to restore the catalog from the SQL dump file, please type the below command:
{{{
$ bin/tsql -f table_backup.sql
}}}

If you use an option '-a', tajo_dump will dump all table DDLs.
{{{
$ bin/tajo_dump -a > all_backup.sql
}}}

=== Database-level backup ===