返回首页

gbase数据、南大通用产品文档:GBase8acancel rebalance table

更新日期:2024年09月11日

命令说明
如果rebalance 对象处于STARTING、RUNNING、PAUSED 状态,可以使用cancel
rebalance 命令终止rebalance 操作。
如果cancel rebalance 命令返回影响行数为1,

rebalance 操作终止成功;如果返回影响行数为0,则终止操作失败。
注意

如果rebalance 操作的running 状态进度已经超过了90%,那么执行cancel
命令不起作用
语法格式
cancel rebalance


GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
359
rebalance_options:
Table [[vc_name.]database_name.]table_name
| Database [vc_name.]database_name
| instance
表4- 45 参数说明
参数名称


table
[[vc_name.]database_name.]table_name
如果指定表处于STARTING 、
RUNNING、PAUSED 状态,可以使用
cancel rebalance命令终止rebalance操作。
如果cancel rebalance 命令返回影响行数
为1,则rebalance 操作终止成功;如果
返回影响行数为0,则终止操作失败。
database [vc_name.]database_name
cancel rebalance database 终止指定数据
库下所有处于STARTING、RUNNING、
PAUSED 状态表的rebalance 操作。
cancel
rebalance database 命令返回的影响行数
是成功终止的rebalance 任务数。
instance
cancel rebalance instance 终止当前实例下
所有处于STARTING 、RUNNING 、
PAUSED 状态表的rebalance 操作。
cancel
rebalance instance 命令返回的影响行数
是成功终止的rebalance 任务数。
示例
示例1:
gbase> select index_name, status, percentage
from gclusterdb.rebalancin
g_status;
+--------------+--------+------------+
| index_name
| status | percentage |
+--------------+--------+------------+
| test.testdis | PAUSED | 10
|
+--------------+--------+------------+
1 row in set
gbase> cancel rebalance table testdis;
Query OK, 1 row affected
gbase> select index_name, status, percentage
from gclusterdb.rebalancin
g_status;
+--------------+----------+------------+
| index_name
| status
| percentage |
+--------------+----------+------------+

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
360
| test.testdis | CANCELED | 0
|
+--------------+----------+------------+
1 row in set
示例2:
gbase>
select
index_name,
status,
percentage
from
gclusterdb.rebalancing_status;
+---------------+---------+------------+
| index_name
| status
| percentage |
+---------------+---------+------------+
| test.testdis
| RUNNING | 10
|
| test.testrep
| RUNNING | 90
|
| test.testrand | STARTING| 0
|
+---------------+---------+------------+
3 rows in set
gbase> cancel rebalance database test ;
Query OK, 3 row affected
gbase>
select
index_name,
status,
percentage
from
gclusterdb.rebalancing_status;
+---------------+-----------+------------+
| index_name
| status
| percentage |
+---------------+-----------+------------+
| test.testdis
| CANCELED
| 0
|
| test.testrep
| COMPLETED | 100
|
| test.testrand | CANCELED
| 0
|
+---------------+-----------+------------+
3 rows in set
示例3:
gbase> cancel rebalance instance ;
Query OK, 4 rows affected
gbase>
select
index_name,
status,
percentage
from
gclusterdb.rebalancing_status;
+---------------+-----------+------------+
| index_name
| status
| percentage |
+---------------+-----------+------------+
| test.testrep
| COMPLETED | 100
|
| test.testdis
| CANCELED
| 0
|
| test.testrand | COMPLETED | 100
|
| test1.t1
| CANCELED
| 0
|
| test1.t3
| CANCELED
| 0
|
| test1.t2
| CANCELED
| 0
|
+---------------+-----------+------------+

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
361
6 rows in set

数据库服务器提供了四个 SQL 函数,
您可以从 SQL 语句中调用这些函数来导入和导出智
能大对象。下表显示智能大对象函数。
表 1. 智能大对象的 SQL 函数
函数名称
用途
FILETOBLOB()
将文件复制到 BLOB 列中
FILETOCLOB()
将文件复制到 CLOB 列中
LOCOPY()
将 BLOB 或 CLOB 数据复制的另一个 BLOB 或 CLOB 列中
LOTOFILE()
将 BLOB 或 CLOB 数据复制到文件中
有关智能大对象函数的详细信息和语法,请参阅《GBase 8s SQL 指南:语法》中的表达式
段。
可以在 SELECT UPDATE 和 INSERT 语句中使用该表显示的任何函数。有关如何在
INSERT 和 UPDATE 语句中使用上述函数的示例,请参阅修改数据。
假设您创建 inmate 和 fbi_list 表,如下图所示。
图: 创建 inmate 和 fbi_list 表
CREATE TABLE inmate
(
id_num INT,

GBase 8s SQL 指南:教程
南大通用数据技术股份有限公司 - 96 -

picture BLOB,
felony CLOB
);

CREATE TABLE fbi_list
(
id INTEGER,
mugshot BLOB
) PUT mugshot IN (sbspace1);
以下 SELECT 语句使用 LOTOFILE() 函数将数据从 felony 列复制到位于客户机上
的 felon_322.txt 文件中:
SELECT id_num, LOTOFILE(felony, 'felon_322.txt', 'client')
FROM inmate
WHERE id = 322;
LOTOFILE() 的第一个参数指定将从中导出数据的列的名称。
第二个参数指定要将数据复制
到其中的文件的名称。第三个参数指定目标文件是位于客户端计算机('client')或服务器计
算机('server')上。
根据源文件是驻留在客户机还是服务器计算机上,下列规则可用来指定函数参数中文件名
的路径:
如果源文件驻留在服务器计算机上,那么必须指定文件的全路径名(不是与当前工作目录
相对的路径名)。
如果源文件驻留在客户端计算机上,那么可以指定文件的全路径名或相对路径名。

gbase_get_proto_info ........................ 21