[转帖]金仓数据库KingbaseES分区表 -- 声明式创建分区表
https://www.modb.pro/db/638045
1. 创建分区表同时创建分区
1.1 准备环境
# 创建分区表同时创建分区
create table tb1(id bigint,stat date,no bigint,pdate date,info varchar2(50)) partition by range(pdate) INTERVAL ('1 MONTH'::INTERVAL)
(
PARTITION tb1_p1 VALUES LESS THAN ('2019-01-01'),
PARTITION tb1_p2 VALUES LESS THAN ('2019-02-01'),
PARTITION tb1_p3 VALUES LESS THAN ('2019-03-01'),
PARTITION tb1_p4 VALUES LESS THAN ('2019-04-01')
);
# 查看分区表父表
test=# \d+ tb1
Partitioned table "public.tb1"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition key: RANGE (pdate)
Range interval: INTERVAL ('0-1'::pg_catalog.interval)
Partitions: tb1_tb1_p1 FOR VALUES FROM (MINVALUE) TO ('2019-01-01 00:00:00'),
tb1_tb1_p2 FOR VALUES FROM ('2019-01-01 00:00:00') TO ('2019-02-01 00:00:00'),
tb1_tb1_p3 FOR VALUES FROM ('2019-02-01 00:00:00') TO ('2019-03-01 00:00:00'),
tb1_tb1_p4 FOR VALUES FROM ('2019-03-01 00:00:00') TO ('2019-04-01 00:00:00')
# 查看分区表子表
test=# \d+ tb1_tb1_p1
Table "public.tb1_tb1_p1"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition of: tb1 FOR VALUES FROM (MINVALUE) TO ('2019-01-01 00:00:00')
Partition constraint: ((pdate IS NOT NULL) AND ((pdate)::timestamp without time zone < '2019-01-01 00:00:00'::date))
Access method: heap
1.2 对分区表添加主键
# 分区表添加主键
test=# alter table tb1 add constraint tb1_pk primary key(id);
ALTER TABLE
# 查看分区表父表
test=# \d+ tb1
Partitioned table "public.tb1"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition key: RANGE (pdate)
Range interval: INTERVAL ('0-1'::pg_catalog.interval)
Indexes:
"tb1_pk" PRIMARY KEY, btree (id) INCLUDE (tableoid) GLOBAL
Partitions: tb1_tb1_p1 FOR VALUES FROM (MINVALUE) TO ('2019-01-01 00:00:00'),
tb1_tb1_p2 FOR VALUES FROM ('2019-01-01 00:00:00') TO ('2019-02-01 00:00:00'),
tb1_tb1_p3 FOR VALUES FROM ('2019-02-01 00:00:00') TO ('2019-03-01 00:00:00'),
tb1_tb1_p4 FOR VALUES FROM ('2019-03-01 00:00:00') TO ('2019-04-01 00:00:00')
# 查看分区表子表
test=# \d+ tb1_tb1_p1
Table "public.tb1_tb1_p1"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition of: tb1 FOR VALUES FROM (MINVALUE) TO ('2019-01-01 00:00:00')
Partition constraint: ((pdate IS NOT NULL) AND ((pdate)::timestamp without time zone < '2019-01-01 00:00:00'::date))
Access method: heap
# 查询user_indexes视图tb1_pk索引
test=# select index_name,index_type,table_name,table_type,uniqueness,compression from user_indexes where index_name =upper('tb1_pk');
index_name | index_type | table_name | table_type | uniqueness | compression
------------+------------+------------+------------+------------+-------------
TB1_PK | BTREE | TB1 | TABLE | UNIQUE | DISABLED
(1 row)
分区表添加主键:
添加主键的同时会创建主键列(字段)唯一索引(但是有唯一索引的列不一定是主键)。
主键字段不允许空值,添加主键过程中会自动添加not null非空约束,保证主键列值的唯一性。
分区表添加主键同时创建的索引(索引有GLOBAL)是全局索引。
分区表会在主键列创建一个全局(global)索引,默认为添加主键列的同时创建全局索引。
分区表唯一约束必须包含分区键。
1.3 对分区表创建索引
# 分区表创建索引
create index on tb1 (no) local;
CREATE INDEX
create index on tb1 (id,no) global;
CREATE INDEX
# 查看tb1表信息
test=# \d+ tb1
Partitioned table "public.tb1"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition key: RANGE (pdate)
Range interval: INTERVAL ('0-1'::pg_catalog.interval)
Indexes:
"tb1_pk" PRIMARY KEY, btree (id) INCLUDE (tableoid) GLOBAL
"tb1_id_no_idx" btree (id, no)
"tb1_no_idx" btree (no)
Partitions: tb1_tb1_p1 FOR VALUES FROM (MINVALUE) TO ('2019-01-01 00:00:00'),
tb1_tb1_p2 FOR VALUES FROM ('2019-01-01 00:00:00') TO ('2019-02-01 00:00:00'),
tb1_tb1_p3 FOR VALUES FROM ('2019-02-01 00:00:00') TO ('2019-03-01 00:00:00'),
tb1_tb1_p4 FOR VALUES FROM ('2019-03-01 00:00:00') TO ('2019-04-01 00:00:00')
# 查看分区表tb1子表信息
test=# \d+ tb1_tb1_p2
Table "public.tb1_tb1_p2"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition of: tb1 FOR VALUES FROM ('2019-01-01 00:00:00') TO ('2019-02-01 00:00:00')
Partition constraint: (((pdate IS NULL) OR ((pdate)::timestamp without time zone >= '2019-01-01 00:00:00'::date)) AND ((pdate IS NOT NULL) AND ((pdate)::timestamp without time zone < '2019-02-01 00:00:00'::date)))
Indexes:
"tb1_tb1_p2_id_no_idx" btree (id, no)
"tb1_tb1_p2_no_idx" btree (no)
Access method: heap
分区表创建索引:
在分区表创建本地索引,会自动在每个分区上创建一个本地索引。
分区表只能在主键列创建一个全局(global)索引,默认为添加主键列创建的索引。
分区表创建全局索引必须满足条件:索引类型是唯一索引(unique)并且不包含分区键 。
分区表父表不支持CONCURRENTLY、parallel_workers选项,子分区支持CONCURRENTLY、parallel_workers选项。
1.4 使用ATTACH PARTITION将普通表转换为分区表子分区
# 创建普通表
test=# create table tb1_tb1_p5(id bigint,stat date,no bigint,pdate date,info varchar2(50));
CREATE TABLE
test=# \d+ tb1_tb1_p5
Table "public.tb1_tb1_p5"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Access method: heap
# 使用ATTACH PARTITION将普通表转换为分区表子分区
test=# alter table tb1 ATTACH PARTITION tb1_tb1_p5 for VALUES FROM('2019-05-01') TO ('2019-05-31');
ERROR: column "id" in child table must be marked NOT NULL
# 创建的普通表,表结构、约束必须跟分区表一致
test=# alter table tb1_tb1_p5 alter id set not null;
ALTER TABLE
test=# \d+ tb1_tb1_p5
Table "public.tb1_tb1_p5"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Access method: heap
test=# alter table tb1 ATTACH PARTITION tb1_tb1_p5 for VALUES FROM('2019-05-01') TO ('2019-05-31');
ALTER TABLE
# 查看ATTACH后的分区表
test=# \d+ tb1
Partitioned table "public.tb1"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition key: RANGE (pdate)
Range interval: INTERVAL ('0-1'::pg_catalog.interval)
Indexes:
"tb1_pk" PRIMARY KEY, btree (id) INCLUDE (tableoid) GLOBAL
"tb1_id_no_idx" btree (id, no)
"tb1_no_idx" btree (no)
Partitions: tb1_tb1_p1 FOR VALUES FROM (MINVALUE) TO ('2019-01-01 00:00:00'),
tb1_tb1_p2 FOR VALUES FROM ('2019-01-01 00:00:00') TO ('2019-02-01 00:00:00'),
tb1_tb1_p3 FOR VALUES FROM ('2019-02-01 00:00:00') TO ('2019-03-01 00:00:00'),
tb1_tb1_p4 FOR VALUES FROM ('2019-03-01 00:00:00') TO ('2019-04-01 00:00:00'),
tb1_tb1_p5 FOR VALUES FROM ('2019-05-01 00:00:00') TO ('2019-05-31 00:00:00')
test=# \d+ tb1_tb1_p5
Table "public.tb1_tb1_p5"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition of: tb1 FOR VALUES FROM ('2019-05-01 00:00:00') TO ('2019-05-31 00:00:00')
Partition constraint: (((pdate IS NULL) OR ((pdate)::timestamp without time zone >= '2019-05-01 00:00:00'::date)) AND ((pdate IS NOT NULL) AND ((pdate)::timestamp without time zone < '2019-05-31 00:00:00'::date)))
Indexes:
"tb1_tb1_p5_id_no_idx" btree (id, no)
"tb1_tb1_p5_no_idx" btree (no)
Access method: heap
ATTACH PARTITION将普通表转换为分区表子分区:
1 ATTACH普通表、分区表的列、字段类型、长度、约束必须一致。
2 分区表的unique和primary key约束将被应用在ATTACH新的子分区。
3 ATTACH过程中如果普通表有数据,会使用全表扫描检查数据是否违反分区约束(可以在ATTACH前使用约束筛选复合条件的数据)。
4 ATTACH外部表,不需要验证外部表中的数据符合分区约束。
5 如果ATTACH的表有跟分区不一致的索引,分区表会应用ATTACH表的索引。
2. 使用Create Table为分区表添加子分区
使用Create Table语句创建分区表子分区也会自动添加约束及索引。
# 使用Create Table语句创建分区表子分区
test=# CREATE TABLE tb1_tb1_p5 PARTITION OF tb1 FOR VALUES FROM ('2019-04-01') TO ('2019-04-30');
CREATE TABLE
test=# \d+ tb1
Partitioned table "public.tb1"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition key: RANGE (pdate)
Range interval: INTERVAL ('0-1'::pg_catalog.interval)
Indexes:
"tb1_pk" PRIMARY KEY, btree (id) INCLUDE (tableoid) GLOBAL
"tb1_id_no_idx" btree (id, no)
"tb1_no_idx" btree (no)
Partitions: tb1_tb1_p1 FOR VALUES FROM (MINVALUE) TO ('2019-01-01 00:00:00'),
tb1_tb1_p2 FOR VALUES FROM ('2019-01-01 00:00:00') TO ('2019-02-01 00:00:00'),
tb1_tb1_p3 FOR VALUES FROM ('2019-02-01 00:00:00') TO ('2019-03-01 00:00:00'),
tb1_tb1_p4 FOR VALUES FROM ('2019-03-01 00:00:00') TO ('2019-04-01 00:00:00'),
tb1_tb1_p5 FOR VALUES FROM ('2019-04-01 00:00:00') TO ('2019-04-30 00:00:00')
test=# \d+ tb1_tb1_p5
Table "public.tb1_tb1_p5"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition of: tb1 FOR VALUES FROM ('2019-04-01 00:00:00') TO ('2019-04-30 00:00:00')
Partition constraint: (((pdate IS NULL) OR ((pdate)::timestamp without time zone >= '2019-04-01 00:00:00'::date)) AND ((pdate IS NOT NULL) AND ((pdate)::timestamp without time zone < '2019-04-30 00:00:00'::date)))
Indexes:
"tb1_tb1_p5_id_no_idx" btree (id, no)
"tb1_tb1_p5_no_idx" btree (no)
Access method: heap
3. 申明式创建分区总结
声明式分区,子分区和分区表列、类型、约束必须一致。
在申明式创建的分区表上创建索引,会自动将索引应用于所有的子分区。
分区表惟一约束必须包括分区键。
不能创建包含所有子分区的排除约束,只能每个子分区单独创建。
在分区表创建索引时(不可使用CONCURRENTLY),可使用on only在分区表创建标记失效的索引,避免大表创建索引耗时太久(子分区不会自动应用该索引),然后在所有子分区单独创建索引(可使用CONCURRENTLY),最后使用ALTER INDEX … ATTACH PARTITION附加到到父索引,所有子分区索引附加到父索引后会自动标记为有效。
# 分区表不支持使用CONCURRENTLY在父表创建索引
test=# create index CONCURRENTLY on tb1(info);
ERROR: cannot create index on partitioned table "tb1" concurrently
Time: 0.519 ms
# 使用on only在分区表创建索引
test=# create index on only tb1(info);
CREATE INDEX
Time: 1.845 ms
# 查看分区表tb1信息,tb1_info_idx标记为无效invalid
test=# \d+ tb1
Partitioned table "public.tb1"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition key: RANGE (pdate)
Range interval: INTERVAL ('0-1'::pg_catalog.interval)
Indexes:
"tb1_pk" PRIMARY KEY, btree (id) INCLUDE (tableoid) GLOBAL
"tb1_id_no_idx" btree (id, no)
"tb1_info_idx" btree (info) INVALID
"tb1_no_idx" btree (no)
Partitions: tb1_tb1_p1 FOR VALUES FROM (MINVALUE) TO ('2019-01-01 00:00:00'),
tb1_tb1_p2 FOR VALUES FROM ('2019-01-01 00:00:00') TO ('2019-02-01 00:00:00'),
tb1_tb1_p3 FOR VALUES FROM ('2019-02-01 00:00:00') TO ('2019-03-01 00:00:00'),
tb1_tb1_p4 FOR VALUES FROM ('2019-03-01 00:00:00') TO ('2019-04-01 00:00:00'),
tb1_tb1_p5 FOR VALUES FROM ('2019-04-01 00:00:00') TO ('2019-04-30 00:00:00')
# 单独创建所有子分区索引
test=# create index tb1_tb1_p1_info_idx on tb1_tb1_p1(info);
CREATE INDEX
test=# create index tb1_tb1_p2_info_idx on tb1_tb1_p2(info);
CREATE INDEX
test=# create index tb1_tb1_p3_info_idx on tb1_tb1_p3(info);
CREATE INDEX
test=# create index tb1_tb1_p4_info_idx on tb1_tb1_p4(info);
CREATE INDEX
test=# create index tb1_tb1_p5_info_idx on tb1_tb1_p5(info);
CREATE INDEX
# 使用attach partition将所有子分区索引附加到父表
test=# alter index tb1_info_idx attach partition tb1_tb1_p1_info_idx;
ALTER INDEX
test=# alter index tb1_info_idx attach partition tb1_tb1_p2_info_idx;
ALTER INDEX
test=# alter index tb1_info_idx attach partition tb1_tb1_p3_info_idx;
ALTER INDEX
test=# alter index tb1_info_idx attach partition tb1_tb1_p4_info_idx;
ALTER INDEX
test=# alter index tb1_info_idx attach partition tb1_tb1_p5_info_idx;
ALTER INDEX
# 查看分区表tb1信息,tb1_info_idx自动标记为有效
test=# \d+ tb1
Partitioned table "public.tb1"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+----------------------------+-----------+----------+---------+----------+--------------+-------------
id | bigint | | not null | | plain | |
stat | date | | | | plain | |
no | bigint | | | | plain | |
pdate | date | | | | plain | |
info | character varying(50 char) | | | | extended | |
Partition key: RANGE (pdate)
Range interval: INTERVAL ('0-1'::pg_catalog.interval)
Indexes:
"tb1_pk" PRIMARY KEY, btree (id) INCLUDE (tableoid) GLOBAL
"tb1_id_no_idx" btree (id, no)
"tb1_info_idx" btree (info)
"tb1_no_idx" btree (no)
Partitions: tb1_tb1_p1 FOR VALUES FROM (MINVALUE) TO ('2019-01-01 00:00:00'),
tb1_tb1_p2 FOR VALUES FROM ('2019-01-01 00:00:00') TO ('2019-02-01 00:00:00'),
tb1_tb1_p3 FOR VALUES FROM ('2019-02-01 00:00:00') TO ('2019-03-01 00:00:00'),
tb1_tb1_p4 FOR VALUES FROM ('2019-03-01 00:00:00') TO ('2019-04-01 00:00:00'),
tb1_tb1_p5 FOR VALUES FROM ('2019-04-01 00:00:00') TO ('2019-04-30 00:00:00')
[转帖]金仓数据库KingbaseES分区表 -- 声明式创建分区表的更多相关文章
- 通过ODBC接口访问人大金仓数据库
国产化软件和国产化芯片的窘境一样,一方面市场已经存在性能优越的同类软件,成本很低,但小众的国产化软件不仅需要高价买入版权,并且软件开发维护成本高:另一方面,国产软件目前普遍难用,性能不稳定,Bug ...
- QT 之 ODBC连接人大金仓数据库
QT 之 使用 ODBC 驱动连接人大金仓数据库 获取数据库驱动和依赖动态库 此操作可在人大金仓官网下载与系统匹配的接口动态库,或者从架构数据库的源码中获取驱动和依赖动态库 分别为: 驱动动态库:kd ...
- 通过jmeter连接人大金仓数据库
某项目用的人大金仓数据库,做性能测试,需要用jmeter来连接数据库处理一批数据.jmeter连接人大金仓,做个记录. 1. 概要 在"配置元件"中添加"JDBC Con ...
- SQL Server 2005中的分区表(一):什么是分区表?为什么要用分区表?如何创建分区表?(转)
如果你的数据库中某一个表中的数据满足以下几个条件,那么你就要考虑创建分区表了. 1.数据库中某个表中的数据很多.很多是什么概念?一万条?两万条?还是十万条.一百万条?这个,我觉得是仁者见仁.智者见 ...
- linux安装国产数据库(金仓数据库,达梦数据库,南大通用数据库)
今天在公司做的任务是,在Linux的环境下安装三种数据库,结果一种数据库也没有安装好,首先遇到的问题是安装南大通用数据库遇到安装的第五步,就出现问题了,问题是Gbase SDK没有安装成功,以及Gba ...
- Rocky4.2下安装金仓v7数据库(KingbaseES)
1.准备操作系统 1.1 系统登录界面 1.2 操作系统版本信息 jdbh:~ # uname -ra Linux jdbh -x86_64 # SMP Fri Dec :: CST x86_64 G ...
- 润乾配置连接kingbase(金仓)数据库
问题背景 客户根据项目的不同,使用润乾连接的数据库类型各种各样,此文针对前几日使用润乾设计器连接kingbase金仓数据库做一个说明. kingbase金仓数据库是一款国产数据库,操作方式和配置 ...
- 金仓Kingbase数据库网页数据维护分析工具
金仓Kingbase是优秀的国产数据库产品,在能源,政务,国防等领域广泛使用, 现在TreeSoft数据库管理系统已支持Kingbase了,直接在浏览器中就可以操作查看Kingbase数据了,十分方便 ...
- DBeaver连接达梦|虚谷|人大金仓等国产数据库
前言 工作中有些项目可能会接触到「达梦.虚谷.人大金仓」等国产数据库,但通常这些数据库自带的连接工具使用并不方便,所以这篇文章记录一下 DBeaver 连接国产数据库的通用模版,下文以达梦为例(其他国 ...
- 教你10分钟对接人大金仓EF Core 6.x
前言 目前.NET Core中据我了解到除了官方的EF Core外,还用的比较多的ORM框架(恕我孤陋寡闻哈,可能还有别的)有FreeSql.SqlSugar(排名不分先后).FreeSql和SqlS ...
随机推荐
- 前端系列:正则表达式RegExp详解
目录 正则创建 匹配方法 元字符 字符集合 边界 分组 数量词汇 匹配模式 RegExp 方法特性 正则创建 字面量创建 const str = 'asdf123sds3234' const rege ...
- 2023-08-18:用go写算法。你会得到一个字符串 text, 你应该把它分成 k 个子字符串 (subtext1, subtext2,…, subtextk)。 要求满足: subtexti 是
2023-08-18:用go写算法.你会得到一个字符串 text, 你应该把它分成 k 个子字符串 (subtext1, subtext2,-, subtextk). 要求满足: subtexti 是 ...
- 完美解决Python词云库wordcloud不显示中文问题
你的Python词云库wordcloud显示的都是方框吗?别担心,我有一个妙招让你的中文词云变得美观又清晰! 背景: wordcloud是一个基于python的词云生成库,它可以让你用简单的代码创建出 ...
- 2种GaussDB(DWS)查看作业运行信息方式
摘要:提供以作业基本单位的作业统计视图pgxc_session_wlmstat,便于用户观察运行作业和排队作业信息. 本文分享自华为云社区<GaussDB(DWS)如何查看作业运行信息>, ...
- 释放千行百业数据价值,华为云DAYU有一套
摘要:结合数字化转型中行业面临的挑战及产品解决方案解读数据使能服务DAYU. 大禹(DAYU)治水是一个有美好寓意的故事,大禹汲取了父亲治水的经验教训,总结出一套行之有效的治水方法,对洪水进行治理疏导 ...
- linux 只查看 java 进程
top $(ps -e | grep java | awk '{print $1}' | sed 's/^/-p/')
- Java SpringBoot FTP 上传下载文件
POM 添加依赖 <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all< ...
- docker-compose部署SpringCloud
1.安装 docker-compose 将 docker-compose-Linux-x86_64 传到 /usr/local/bin 目录下,并改名为 docker-compose 2.设置权限 ...
- Spring Boot Admin 查看 Client 日志
日志配置如下:如何将不同业务模块产生的日志 分多文件记录 此时 Spring Boot Admin 中看不了 Client 的日志 Logfile ViewerBy default the logfi ...
- pyshorteners 长短链接转换
import requests import pyshorteners as psn def long_to_short(url): url = psn.Shortener().chilpit.sho ...