Greenplum 如何直连segment节点
2024-08-27 06:53:38
展开阅读全文
直连greenplum segment节点的方法, utility模式 :
使用这种方式,不与其他节点通讯,只操作当前节点。也没有数据分布的概念。
如果使用utility模式连接的是master节点,写入数据时,数据不会分布到segment,使用正常模式连接后,写入master的数据也查不出来。
$ PGOPTIONS='-c gp_session_role=utility' psql -p 40005
psql (8.2.15)
Type "help" for help.
postgres=# \dt
List of relations
Schema | Name | Type | Owner | Storage
--------+------+-------+----------+---------
public | t | table | digoal | heap
public | test | table | digoal | heap
(2 rows)
postgres=# select * from pg_locks;
locktype | database | relation | page | tuple | transactionid | classid | objid | objsubid | transaction | pid | mode | granted | mppsessionid | mppiswriter | gp_segment_id
---------------+----------+----------+------+-------+---------------+---------+-------+----------+-------------+--------+-----------------+---------+--------------+-------------+---------------
transactionid | | | | | 136604 | | | | 136604 | 130724 | ExclusiveLock | t | 6 | t | -1
relation | 10899 | 10333 | | | | | | | 136604 | 130724 | AccessShareLock | t | 6 | t | -1
(2 rows)
注意使用PGOPTIONS='-c gp_session_role=utility'后,只操作本地节点
$psql -p # master
psql (8.2.15)
Type "help" for help.
postgres=# select count(*) from test;
count
-------
0
(1 row)
postgres=# \q
$psql -p 40001 # segment
psql (8.2.15)
Type "help" for help.
postgres=# select count(*) from test;
count
---------
4166801
(1 row)
转载自:
最新文章
- HTML实现简单计算器
- C# GUID转换成16位字符串或19位数字并确保唯一
- 一种Docker image镜像的取代方案
- 【Alpha阶段】第十次Scrum例会
- random、面向对象编程
- .NET中的字符串你了解多少?
- sysfs->;sys简单介绍
- 119. Pascal's Triangle II
- ubuntu安装mysql后不能远程访问的方法
- Centos 6安装python3.5
- EAN-13 条码(又称GTIN-13 条码)
- TableView 多余分割线的处理
- Hibernate的Configuration对象的configure()方法
- Asp.net core 环境配置
- [转]java的异常处理最佳实践
- Linux学习笔记8
- 01二维矩阵中最大全为1的正方形maxSquare——经典DP问题(二维)
- (翻译)Angular 1.3中的验证器管道
- 谷歌旗下专业图片编辑Snapseed获重大更新
- Java中的内存处理机制和final、static、final static总结