返回首页

gbase数据、南大通用产品文档:GBase8sdrop tempsbspace to storagepool 参数:从

更新日期:2024年09月11日

空的临时 sbspace 归还空间到存储池
(SQL 管
理 API)
随同 admin() 或 task() 函数,使用 drop tempsbspace to storagepool 参数来从空的
临时 sbspace 归还空间到存储池。
语法

元素
描述
关键考虑
tempsbspace
空的临时 sbspace 名称。

示例
下列命令删除名为 tempsbspace3 的空的临时 sbspace,并将所有释放的空间添加到存储
池。
EXECUTE FUNCTION task("drop tempsbspace to storagepool", "tempsbspace3");

参数说明:
设置列存表在进行局部排序中,
在开始写入临时磁盘文件之前使用的内存大
小。带partial cluster key 的表、带索引的表插入、创建表索引、删除表和更新表都会用到。
该参数属于USERSET 类型参数,请参考表15-1 中对应设置方法进行设置。
须知:同样,多个正在运行的会话可能会同时进行表的局部排序操作。因此,
使用的总内存可能是psort_work_mem 的几倍。
取值范围:整型64~2147483647,单位为KB。
默认值:512MB

GBase 8c V5 开发者手册
南大通用数据技术股份有限公司
1180

示例
使用系统表查看审计日志。
$ gccli -uroot -p
Enter password:
GBase client 9.5.3.17.117651. Copyright (c) 2004-2020, GBase.
All Rights
Reserved.
gbase> SET long_query_time = 0;
Query OK, 0 rows affected
gbase> SET GLOBAL audit_log = 1;
Query OK, 0 rows affected
gbase>CREATE AUDIT POLICY audit_policy_1 ( Enable = 'Y' );
Query OK, 0 rows affected
gbase> SET GLOBAL log_output = 'table';
Query OK, 0 rows affected
gbase> CREATE USER u_sj identified by 'u_sj';
Query OK, 0 rows affected
gbase> GRANT ALL ON *.* TO u_sj;
Query OK, 0 rows affected

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
368
gbase> CREATE DATABASE testSJ;
Query OK, 1 row affected
gbase> USE testSJ;
Query OK, 0 rows affected
gbase> CREATE TABLE t1(i int);
Query OK, 0 rows affected
gbase> INSERT INTO t1 VALUES (1),(2);
Query OK, 2 rows affected
gbase> SELECT start_time,user_host,query_time,rows,LEFT(sql_text, 30),
conn_type FROM gbase.audit_log;
+---------------------+----------------------------------+
| start_time
| user_host
|
+---------------------+----------------------------------+
| 2021-06-16 10:40:24 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:24 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:24 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:24 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:24 | root[root] @ localhost []
|
| 2021-06-16 10:40:33 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:33 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:33 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:32 | root[root] @ localhost []
|
| 2021-06-16 10:40:44 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:44 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:44 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:44 | root[root] @ localhost []
|
| 2021-06-16 10:40:48 | gbase[gbase] @
[192.168.146.24] |
| 2021-06-16 10:40:49 | gbase[gbase] @
[192.168.146.24] |
| 2021-06-16 10:40:49 | gbase[gbase] @
[192.168.146.24] |
| 2021-06-16 10:40:57 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:57 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:57 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:57 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:40:57 | root[root] @ localhost []
|
| 2021-06-16 10:41:05 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:05 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:05 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:05 | root[root] @ localhost []
|
| 2021-06-16 10:41:17 | gbase[gbase] @
[192.168.146.24] |
| 2021-06-16 10:41:17 | gbase[gbase] @
[192.168.146.24] |
| 2021-06-16 10:41:17 | gbase[gbase] @
[192.168.146.24] |
| 2021-06-16 10:41:17 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:17 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:17 | root[root] @
[192.168.146.24]
|

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
369
| 2021-06-16 10:41:17 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:17 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:17 | root[root] @ localhost []
|
| 2021-06-16 10:41:29 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:29 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:29 | root[root] @
[192.168.146.24]
|
| 2021-06-16 10:41:29 | root[root] @ localhost []
|
| 2021-06-16 10:41:43 | root[root] @ localhost []
|
+---------------------+----------------------------------+
+-----------------+------+--------------------------------+-----------+
| query_time
| rows | LEFT(sql_text, 30)
| conn_type |
+-----------------+------+--------------------------------+-----------+
| 00:00:00.000012 |
0 | Ping
| CAPI
|
| 00:00:00.000115 |
0 | SET NAMES utf8mb4
| CAPI
|
| 00:00:00.000164 |
0 | SET SELF SCN = 0
| CAPI
|
| 00:00:00.000094 |
0 | SET
SELF GLOBAL log_output =
| CAPI
|
| 00:00:00.239863 |
0 | SET GLOBAL log_output = 'table | ODBC
|
| 00:00:00.000009 |
0 | Ping
| CAPI
|
| 00:00:00.000143 |
0 | SET SELF SCN = 0
| CAPI
|
| 00:00:01.149579 |
0 | CREATE GCLUSTER_LOCAL USER "u_ | CAPI
|
| 00:00:04.376179 |
0 | CREATE USER u_sj identified by | ODBC
|
| 00:00:00.000019 |
0 | Ping
| CAPI
|
| 00:00:00.000207 |
0 | SET SELF SCN = 0
| CAPI
|
| 00:00:00.057846 |
0 | GRANT /*+vcid*/ GCLUSTER_LOCAL | CAPI
|
| 00:00:00.266514 |
0 | GRANT ALL ON *.* TO u_sj
| ODBC
|
| 00:00:00.001372 |
0 | Connect
| CAPI
|
| 00:00:00.000005 |
0 | Ping
| CAPI
|
| 00:00:00.000002 |
0 | Quit
| CAPI
|
| 00:00:00.000008 |
0 | Ping
| CAPI
|
| 00:00:00.000090 |
0 | SET NAMES utf8
| CAPI
|
| 00:00:00.000147 |
0 | SET SELF SCN = 9259
| CAPI
|
| 00:00:00.261615 |
0 | CREATE GCLUSTER_LOCAL DATABASE | CAPI |
| 00:00:00.965256 |
0 | CREATE DATABASE testSJ
| ODBC
|
| 00:00:00.000018 |
0 | Ping
| CAPI
|
| 00:00:00.000042 |
0 | Init VC Name
| CAPI
|
| 00:00:00.000058 |
0 | Init DB
| CAPI
|
| 00:00:00.014822 |
0 | USE testSJ
| ODBC
|
| 00:00:00.004341 |
0 | Connect
| CAPI
|
| 00:00:00.032791 |
0 | select table_id from informati | CAPI
|
| 00:00:00.000003 |
0 | Quit
| CAPI
|
| 00:00:00.000038 |
0 | Ping
| CAPI
|
| 00:00:00.000046 |
0 | Init VC Name
| CAPI
|

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
370
| 00:00:00.000070 |
0 | Init DB
| CAPI
|
| 00:00:00.000547 |
0 | SET SELF SCN = 9260
| CAPI
|
| 00:00:00.781898 |
0 | CREATE
GCLUSTER_LOCAL
TABLE
| CAPI |
| 00:00:02.731924 |
0 | CREATE TABLE t1(i int)
| ODBC
|
| 00:00:00.000132 |
0 | commit
| CAPI
|
| 00:00:00.000614 |
0 | set autocommit=1
| CAPI
|
| 00:00:00.000175 |
0 | set autocommit=1
| CAPI
|
| 00:00:00.200714 |
2 | INSERT INTO t1 VALUES (1),(2)
| ODBC
|
| 00:00:00.000530 |
38 | SELECT start_time,user_host,qu | ODBC
|
+-----------------+------+--------------------------------+-----------+
39 rows in set (Elapsed: 00:00:00.00)
gbase> INSERT INTO t1 SELECT * FROM t1;
Query OK, 2 rows affected
gbase> UPDATE t1 SET i = 3;
Query OK, 4 rows affected
gbase> DELETE FROM t1;
Query OK, 4 rows affected
gbase> SELECT start_time,user_host,query_time,rows, LEFT(sql_text, 30),
conn_type FROM gbase.audit_log;
+---------------------+--------------------------------+
| start_time
| user_host
|
+---------------------+--------------------------------+
| 2021-06-16 11:17:18 | root[root] @ localhost []
|
| 2021-06-16 11:18:09 | root[root] @ localhost []
|
| 2021-06-16 11:18:21 | root[root] @
[192.168.146.24] |
| 2021-06-16 11:18:21 | root[root] @
[192.168.146.24] |
| 2021-06-16 11:18:21 | root[root] @
[192.168.146.24] |
| 2021-06-16 11:18:20 | root[root] @ localhost []
|
| 2021-06-16 11:18:29 | root[root] @
[192.168.146.24] |
| 2021-06-16 11:18:29 | root[root] @
[192.168.146.24] |
| 2021-06-16 11:18:29 | root[root] @
[192.168.146.24] |
| 2021-06-16 11:18:28 | root[root] @ localhost []
|
+---------------------+--------------------------------+
+-----------------+------+--------------------------------+-----------+
| query_time
| rows | LEFT(sql_text, 30)
| conn_type |
+-----------------+------+--------------------------------+-----------+
| 00:00:00.003119 |
0 | truncate self table gbase.audi | ODBC
|
| 00:00:02.090188 |
2 | INSERT INTO t1 SELECT * FROM t | ODBC
|
| 00:00:00.000095 |
0 | commit
| CAPI
|
| 00:00:00.000272 |
0 | set autocommit=1
| CAPI
|
| 00:00:00.000416 |
0 | set autocommit=1
| CAPI
|
| 00:00:01.108768 |
4 | UPDATE t1 SET i = 3
| ODBC
|

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
371
| 00:00:00.000057 |
0 | commit
| CAPI
|
| 00:00:00.000198 |
0 | set autocommit=1
| CAPI
|
| 00:00:00.000899 |
0 | set autocommit=1
| CAPI
|
| 00:00:00.396723 |
4 | DELETE FROM t1
| ODBC
|
+-----------------+------+--------------------------------+-----------+
10 rows in set (Elapsed: 00:00:00.00)