码迷,mamicode.com
首页 > 数据库 > 详细

MySQL 5.7 CLUSTER NDB 7.5 创建磁盘表 undo logfile group tablespace 内存表修改为磁盘表

时间:2016-06-13 13:36:17      阅读:845      评论:0      收藏:0      [点我收藏+]

标签:



-- MySQL 5.7 CLUSTER NDB 7.5
 
-- 创建undo logfile group

create logfile group lg_1
        ADD UNDOFILE ‘undo_1.log‘
        INITIAL_SIZE 1024M
        undo_buffer_size 8M
        ENGINE NDBCLUSTER;
        
-- 增加 logfile

ALTER logfile group lg_1
         ADD UNDOFILE ‘undo_2.log‘
         initial_size 1024M
         ENGINE NDBCLUSTER;
         
-- 创建tablespace

CREATE TABLESPACE ts1
    ADD DATAFILE ‘data_1.dat‘
    USE LOGFILE GROUP lg_1
    INITIAL_SIZE 1024M
    ENGINE NDBCLUSTER;

-- 扩张tablespace
ALTER TABLESPACE ts_1
    ADD DATAFILE ‘data_2.dat‘
    INITIAL_SIZE 1024M
    ENGINE NDBCLUSTER;
    
-- 创建disk table

CREATE TABLE dt_1 (
    member_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    last_name VARCHAR(50) NOT NULL,
    first_name VARCHAR(50) NOT NULL,
    dob DATE NOT NULL,
    joined DATE NOT NULL,
    INDEX(last_name, first_name)
    )
    TABLESPACE ts_1 STORAGE DISK
    ENGINE NDBCLUSTER;
    
-- 删除table

mysql> DROP TABLE dt_1;

mysql> ALTER TABLESPACE ts_1
    -> DROP DATAFILE ‘data_2.dat‘
    -> ENGINE NDBCLUSTER;

mysql> ALTER TABLESPACE ts_1
    -> DROP DATAFILE ‘data_1.dat‘
    -> ENGINE NDBCLUSTER;

mysql> DROP TABLESPACE ts_1
    -> ENGINE NDBCLUSTER;

mysql> DROP LOGFILE GROUP lg_1
    -> ENGINE NDBCLUSTER;
    
-- 修改内存表为磁盘表

alter table tablename tablespace
 ts_1 STORAGE DISK ENGINE=NDB;

MySQL 5.7 CLUSTER NDB 7.5 创建磁盘表 undo logfile group tablespace 内存表修改为磁盘表

标签:

原文地址:http://www.cnblogs.com/nbuntu/p/5580166.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!