GBase的rmt导出功能只支持导出express引擎的表,系统表tables是MEMORY引擎,所以需要导出tables的话就得新建同结构的表,然后再进行转储导出。
创建同结构的express引擎临时表:
-
CREATE TABLE testdb.tables (
TABLE_CATALOG varchar(512) DEFAULT NULL,
TABLE_SCHEMA varchar(64) NOT NULL DEFAULT ‘’,
TABLE_NAME varchar(64) NOT NULL DEFAULT ‘’,
TABLE_TYPE varchar(64) NOT NULL DEFAULT ‘’,
ENGINE varchar(64) DEFAULT NULL,
VERSION bigint(21) DEFAULT NULL,
ROW_FORMAT varchar(10) DEFAULT NULL,
TABLE_ROWS bigint(21) DEFAULT NULL,
AVG_ROW_LENGTH bigint(21) DEFAULT NULL,
DATA_LENGTH bigint(21) DEFAULT NULL,
MAX_DATA_LENGTH bigint(21) DEFAULT NULL,
INDEX_LENGTH bigint(21) DEFAULT NULL,
DATA_FREE bigint(21) DEFAULT NULL,
AUTO_INCREMENT bigint(21) DEFAULT NULL,
CREATE_TIME datetime DEFAULT NULL,
UPDATE_TIME datetime DEFAULT NULL,
CHECK_TIME datetime DEFAULT NULL,
TABLE_COLLATION varchar(32) DEFAULT NULL,
CHECKSUM bigint(21) DEFAULT NULL,
CREATE_OPTIONS varchar(255) DEFAULT NULL,
TABLE_LIMIT_STORAGE_SIZE bigint(21) DEFAULT NULL,
TABLE_STORAGE_SIZE bigint(21) DEFAULT NULL,
TABLE_DATA_SIZE bigint(21) DEFAULT NULL,
TABLE_COMMENT varchar(2000) NOT NULL DEFAULT ‘’,
LOCAL_HASH_INDEX_FILE_SIZE bigint(21) DEFAULT NULL,
GLOBAL_HASH_INDEX_FILE_SIZE bigint(21) DEFAULT NULL,
SCN bigint(21) DEFAULT NULL,
TABLE_ID bigint(21) DEFAULT NULL,
OWNER_UID bigint(20) NOT NULL DEFAULT ‘0’
); -
允许跨引擎查询是走标准引擎:
gbase> set _gbase_query_path=1; -
把非express引擎表的数据插入到express引擎表中:
gbase> insert into tables select * from information_schema.tables;
4.禁用跨引擎查询是走标准引擎:
gbase> set _gbase_query_path=0;
5.开始导出数据:
gbase>rmt:select * from testdb.tables into outfile ‘/home/gbase/tables.txt’;