返回首页

gbase数据、南大通用产品文档:GBase8c%st

更新日期:2024年09月11日

Mem:
8038844k total,
7165272k used,
873572k free,
530444k buffers
Swap:
4192924k total,
4920k used,
4188004k free,
4742904k cached

GBase 8c V5 开发者手册
南大通用数据技术股份有限公司
511
PID USER
PR
NI
VIRT
RES
SHR S %CPU %MEM
TIME+
COMMAND
35184 gbase
20
0
822m 421m 128m S
0

执行initnodedatamap 命令初始化hashmap,然后将数据通过rebalance instance 命令
重分布到最新的distribution(Distribution ID: 2)上。
说明

按distribution 分布规则,此次rebalance 操作不会实际进行数据搬移,所
以会很快完成;

本次rebalance 操作后不要删掉旧版nodedatamap 和distribution。
操作步骤
步骤1 :
步骤1:初始化hashmap:

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
315
$ gccli -uroot
GBase client 9.5.3.17.117651. Copyright (c) 2004-2020, GBase.
All Rights
Reserved.
gbase> use vc vc1;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)
gbase> initnodedatamap;
Query OK, 0 rows affected, 5 warnings (Elapsed: 00:00:01.45)
步骤2:执行数据重分布:
gbase> rebalance instance;
Query OK, 3 rows affected (Elapsed: 00:00:05.60)
查看rebalance 状态:
gbase>
select
index_name,status,percentage,priority,host,distribution_id
from
gclusterdb.rebalancing_status;
+------------+-----------+------------+----------+---------------+-----------------+
| index_name | status
| percentage | priority | host
| distribution_id |
+------------+-----------+------------+----------+---------------+-----------------+
| demo.tt
| COMPLETED |
100 |
5 | 172.168.83.11 |
3 |
| demo.t
| COMPLETED |
100 |
5 | 172.168.83.11 |
3 |
| demo.ttt
| COMPLETED |
100 |
5 | 172.168.83.11 |
3 |
+------------+-----------+------------+----------+---------------+-----------------+
3 rows in set (Elapsed: 00:00:00.17)
gbase> quit
Bye

语法
./orato8a parameter_1 parameter_2 …… parameter_n
说明

parameter_1:orato8a 的参数,一个orato8a 后可以使用多个参数,参数可以使用全称
格式,也可以使用简称格式;

全称格式:--parameter_1=参数值,“=”两边不能有空格;

简称格式:-parameter_1 参数值,简写格式时,参数和参数值之间不能有空格;

执行orato8a 的用户,必须是可以访问oracle 数据库的用户。
示例

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
528
orato8a 工具如何从oracle 中抽取数据,在本示例中,首先登录oracle,然后写一条
查询SQL,该SQL 在库中查询表lineorder 中的10 条数据;退出oracle,使用orat
o8a 工具抽取查询SQL 的结果数据,以验证orato8a 抽取数据的功能,具体如下:
$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Thu Sep 26 16:37:41 2013
Copyright (c) 1982, 2009, Oracle.
All rights reserved.
SQL> conn ct1/ct1@//192.168.103.79/orcl
Connected.
SQL> CREATE TABLE lineorder_test (
2
lo_orderkey
number(18),
3
lo_linenumber
number(18)
4
);
Table created.
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(1,1);
1 row created.
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(1,2);
1 row created.
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(1,3);
1 row created.
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(2,1);
1 row created.
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(2,2);
1 row created.
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(2,3);
1 row created.

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
529
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(2,4);
1 row created.
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(3,1);
1 row created.
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(3,2);
1 row created.
SQL> INSERT INTO lineorder_test (lo_orderkey,lo_linenumber) VALUES(3,3);
1 row created.
SQL> COMMIT;
COMMIT complete.
SQL> SELECT LO_ORDERKEY, LO_LINENUMBER FROM lineorder_test;
LO_ORDERKEY LO_LINENUMBER
----------- -------------
1
1
1
2
1
3
2
1
2
2
2
3
2
4
3
1
3
2
3
3
10 rows selected.
然后退出oracle,使用orato8a 抽取上面查询的数据。
$ ./orato8a --user='ct1/ct1ct1@orcl' --query="select LO_ORDERKEY, LO_LINENUMBER
FROM lineorder_test" --file='/opt/orato8a_output/lineorder.txt ' --field=";" --format=3
export columns: 2
export rows: 10
export time: 0 sec
process ok!

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
530
$ cat /opt/orato8a_output/lineorder.txt
1;1
1;2
1;3
2;1
2;2
2;3
2;4
3;1
3;2
3;3
导出的数据文件中的内容与在oracle 系统中查询的结果一致。