Forked from robrich/backup-with-split-partitions.sql
Created
October 12, 2021 16:33
-
-
Save VeryFatBoy/2179fca9b126e52e5cb20856caa65b97 to your computer and use it in GitHub Desktop.
MemSQL Backup with Split Partitions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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