Skip to content

Instantly share code, notes, and snippets.

@robrich
Created June 18, 2020 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save robrich/4e78c6e48a036fc924c1998c32dce56d to your computer and use it in GitHub Desktop.
Save robrich/4e78c6e48a036fc924c1998c32dce56d to your computer and use it in GitHub Desktop.
MemSQL Backup with Split Partitions
-- create a database with 2 master partitions
create database thedb partitions 2;
-- create sample data
use thedb;
create table data (msg varchar(200));
insert into data (msg) values ('the data');
-- notice how we're not using the database efficiently
show partitions;
-- run backup
backup thedb with split partitions to './memsqlbackup';
-- check it
restore database thedb2 from './memsqlbackup/thedb.backup';
select * from data;
drop database thedb2;
-- restore backup into place
drop database thedb;
restore database thedb from './memsqlbackup';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment