上一页 1 2 3 4 5 6 7 8 9 ··· 27 下一页
摘要: 本版本主要特性包括: 1、引入实验性特性oracle pl/sql存储过程兼容,兼容绝大部分oracle pl/sql一份代码可以同时运行于oracle和lightdb 2、lightdb jdbc支持autocommit=true时,fetchsize生效 3、lightdb优化器提示进一步完善, 阅读全文
posted @ 2022-07-21 17:07 zhjh256 阅读(114) 评论(0) 推荐(0)
摘要: 先postgresql的页结构、页物理布局 postgresql 记录(元祖)物理布局 源码定义如下: struct HeapTupleHeaderData { union { HeapTupleFields t_heap; DatumTupleFields t_datum; }t_choice; 阅读全文
posted @ 2022-07-20 12:08 zhjh256 阅读(916) 评论(0) 推荐(0)
摘要: 在postgresql中,函数有个不稳定性分类属性,它会影响优化器评估函数的可优化级别、同时也会影响postgresql中并行执行的可行性。 函数有三种类型:VOLATILE、STABLE以及IMMUTABLE。VOLATILE是函数默认类别,也就是优化器假设函数会修改数据库,不会做任何特定的优化。 阅读全文
posted @ 2022-07-09 16:31 zhjh256 阅读(269) 评论(0) 推荐(0)
摘要: lightdb原生支持uuid(), sys_guid()函数。lightdb@postgres=# create table test_uuid(uuid_t uuid); CREATE TABLE lightdb@postgres=# insert into test_uuid values(u 阅读全文
posted @ 2022-07-05 21:03 zhjh256 阅读(414) 评论(0) 推荐(0)
摘要: zjh@postgres=# alter user zjh password '123456';ALTER ROLE 阅读全文
posted @ 2022-07-01 21:07 zhjh256 阅读(73) 评论(0) 推荐(0)
摘要: create server oradb foreign data wrapper oracle_fdw options (dbserver '//10.20.30.199:1521/test');create user mapping for USER server oradb options (u 阅读全文
posted @ 2022-07-01 15:58 zhjh256 阅读(275) 评论(0) 推荐(0)
摘要: 1、在Linux下获取CPU核数 linux下可以通过linux系统提供的sysconf()来获取当前CPU个数,sysconf在头文件unistd.h中声明。 sysconf函数中输入参数_SC_NPROCESSORS_CONF和_SC_NPROCESSORS_ONLN均可以获取系统CPU个数。 阅读全文
posted @ 2022-06-25 18:29 zhjh256 阅读(1394) 评论(0) 推荐(0)
摘要: see https://dba.stackexchange.com/questions/239064/error-there-is-a-column-named-in-table-select-but-it-cannot-be-referenced and https://dba.stackexch 阅读全文
posted @ 2022-06-23 17:11 zhjh256 阅读(1071) 评论(0) 推荐(0)
摘要: https://github.com/hslightdb/ora2pg oracle到lightdb迁移手册:https://www.hs.net/lightdb/docs/Oracle%20%E8%BF%81%E7%A7%BBLightDB%E7%94%A8%E4%BE%8B.pdf 阅读全文
posted @ 2022-06-23 16:00 zhjh256 阅读(42) 评论(0) 推荐(0)
摘要: 迁移工具,lightdb增强版pgloader https://github.com/hslightdb/ltloader 修复了:1、convert varchar btree index to rum extension. 2、mysql auto_increment attribute mis 阅读全文
posted @ 2022-06-23 15:40 zhjh256 阅读(54) 评论(0) 推荐(0)
摘要: 查看当前数据库 postgres=# select current_database(); current_database postgres (1 row) 查看数据库用户列表 postgres=# select * from pg_roles; rolname | rolsuper | roli 阅读全文
posted @ 2022-06-18 20:44 zhjh256 阅读(96) 评论(0) 推荐(0)
摘要: json-c是最主流的json c库。[root@hs-10-20-30-193 build]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. -- The C compiler identification is GNU 4.8.5 -- Check for 阅读全文
posted @ 2022-06-18 20:36 zhjh256 阅读(211) 评论(0) 推荐(0)
摘要: lightdb内置函数可生成 [zjh@hs-10-20-30-193 data]$ ltsql -p9999 ltsql (13.3-22.2) Type "help" for help. zjh@postgres=# select round(random() * 10000000,2); ro 阅读全文
posted @ 2022-06-18 16:24 zhjh256 阅读(39) 评论(0) 推荐(0)
摘要: 有些时候,我们需要在测试时进行sleep,以便判断tps,oracle中如下: SELECT count(1) FROM scott.users; BEGIN DBMS_LOCK.sleep (1); END; / SELECT count(1) FROM scott.users; 需要sys登录先 阅读全文
posted @ 2022-06-18 16:19 zhjh256 阅读(250) 评论(0) 推荐(0)
摘要: 在lightdb/pg中,事务是自动提交的,也就是除非明确通过BEGIN;开启事务,否则任何语句都是独立事务。在ltsql客户端,可以通过\echo :AUTOCOMMIT查看自动提交模式,如下: [zjh@hs-10-20-30-193 ~]$ ltsql -p9999 ltsql (13.3-2 阅读全文
posted @ 2022-06-11 20:55 zhjh256 阅读(76) 评论(0) 推荐(0)
摘要: 先看postgresql中的匿名块do $$ declare i record; begin for i in 100000..300000 loop insert into scott.departments select 100000 + i, 'dept' || 100000 + i, now 阅读全文
posted @ 2022-06-04 15:57 zhjh256 阅读(109) 评论(0) 推荐(0)
摘要: 因为开发不规范,DBA和架构师们通常会制定各种开发规范。比如关键字不能作为标识符,必须包含主键、最后修改时间、创建时间等。虽然规范很多,但是执行的时候通常会大打折扣,因为有大量的客户端可以连接数据库,没有足够的保障机制和制度。为了确保规范的落地,lightdb内置了开发规范校验特性,对于不符合规范的 阅读全文
posted @ 2022-05-28 22:44 zhjh256 阅读(90) 评论(0) 推荐(0)
摘要: [lightdb@hs-10-20-30-199 ~]$ lt_initdb -p9876 -D lightdb22.1-data The files belonging to this database system will be owned by user "lightdb". This us 阅读全文
posted @ 2022-05-26 15:04 zhjh256 阅读(82) 评论(0) 推荐(0)
摘要: [zjh@hs-10-20-30-193 ~]$ lt_ctl -D lightdb-x-dev-server/data stop #停止 waiting for server to shut down............................... done server stopp 阅读全文
posted @ 2022-05-26 14:46 zhjh256 阅读(173) 评论(0) 推荐(0)
摘要: 1、sysbench可用于测试mysql和lightdb性能。首先安装lightdb,可参考https://www.cnblogs.com/zhjh256/p/15170255.html或https://www.hs.net/lightdb/docs/LightDB_Install_Manual.p 阅读全文
posted @ 2022-05-25 15:46 zhjh256 阅读(183) 评论(0) 推荐(0)
摘要: [root@hs-10-20-30-199 ~]# su - lightdb Last login: Wed May 25 13:16:32 CST 2022 from 10.188.120.129 on pts/10 [lightdb@hs-10-20-30-199 ~]$ ltsql ltsql 阅读全文
posted @ 2022-05-25 13:29 zhjh256 阅读(142) 评论(0) 推荐(0)
摘要: 0、LightDB是基于PostgreSQL最新版的企业发行版,类似于redhat与linux内核的关系。 1、首先从lightdb官网www.hs.net/lightdb下载对应操作系统和CPU架构的版本,比如centos x86或kylinv10 arm; 2、然后安装手册或快速入门安装ligh 阅读全文
posted @ 2022-05-25 13:02 zhjh256 阅读(150) 评论(0) 推荐(0)
摘要: [root@hs-10-20-30-199 bin]# pstack 48430 #0 0x00007fbd9375a62e in strcoll_l () from /lib64/libc.so.6 #1 0x000000000087bc82 in varstrfastcmp_locale (a1 阅读全文
posted @ 2022-05-24 17:36 zhjh256 阅读(347) 评论(0) 推荐(0)
摘要: 原本被寄予厚望的64位xid,因提交的patch多少不是非常完美,最后修订版的提交日期为5.13,考虑各种时间问题。该特性被推迟到16版本。 PostgreSQL 15 的第一个 beta 版本现已可供下载。公告指出,此版本包含 PostgreSQL 15 普遍可用时将提供的所有功能的预览,但该版本 阅读全文
posted @ 2022-05-21 19:08 zhjh256 阅读(353) 评论(0) 推荐(0)
摘要: PostgreSQL 全球开发组针对当前所有被支持版本发布了一次更新,版本包括:PostgreSQL 14.3、13.7、12.11、11.16 和 10.21。此次更新修复了一个安全漏洞并修复了过去三个月报告的 50 多个错误。 如果你在使用 ltree 数据类型的列上有任何 GiST 索引,你将 阅读全文
posted @ 2022-05-16 08:35 zhjh256 阅读(308) 评论(0) 推荐(0)
摘要: LightDB产品团队于近期更新了MySQL/mariadb到LightDB开发迁移指南,相比LightDB 21.3版本,迁移便利性大大增加。涵盖范围包括: 详细可参见https://www.hs.net/lightdb/docs/LightDB%20compare%20with%20MySQL( 阅读全文
posted @ 2022-05-14 21:28 zhjh256 阅读(66) 评论(0) 推荐(0)
摘要: 一、postgresql中的序列 1.1 场景需求 需要向下图一样,需要对产品编码编码设置一个序列。编码规则 SKU + 序列号: 1.2 序列 序列是基于bigint算法的,因此范围是不能超过一个八字节 整数的范围(-9223372036854775808 到 922337203685477580 阅读全文
posted @ 2022-05-14 21:20 zhjh256 阅读(120) 评论(0) 推荐(0)
摘要: void getCurrentDateTime(char* current_datetime) { time_t nowtime; struct tm* timeinfo; time(&nowtime); timeinfo = localtime(&nowtime); int xtn = timei 阅读全文
posted @ 2022-05-11 11:21 zhjh256 阅读(240) 评论(0) 推荐(0)
摘要: <dependency> <groupId>io.github.hslightdb</groupId> <artifactId>lightdb-jdbc</artifactId> <version>42.2.24</version> </dependency lightdb jdbc是专门为ligh 阅读全文
posted @ 2022-05-10 09:39 zhjh256 阅读(145) 评论(0) 推荐(0)
摘要: zjh@postgres=# show %enc%; name | setting | description + + client_encoding | UTF8 | Sets the client's character set encoding. server_encoding | UTF8 阅读全文
posted @ 2022-05-04 10:23 zhjh256 阅读(347) 评论(0) 推荐(0)
摘要: 如报错所示,很明显是字符集的问题。 设置如下: export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 重连即可 阅读全文
posted @ 2022-05-01 21:25 zhjh256 阅读(107) 评论(0) 推荐(0)
摘要: LightDB发行版内置了直接访问oracle的扩展oracle_fdw。只要lightdb所在服务器安装了oracle客户端/服务器或轻量客户端,并配置环境变量即可使用。如下: export ORACLE_HOME=/home/zjh/instantclient_21_6 export LD_LI 阅读全文
posted @ 2022-05-01 16:45 zhjh256 阅读(241) 评论(0) 推荐(0)
摘要: [lightdb@hs-10-20-30-199 ~]$ pstack 242677 #0 0x00007eff9d4585de in get_next_seq () from /lib64/libc.so.6 #1 0x00007eff9d4597a9 in strcoll_l () from / 阅读全文
posted @ 2022-04-29 10:07 zhjh256 阅读(136) 评论(0) 推荐(0)
摘要: Program terminated with signal 6, Aborted,有可能啥原因呢?其中一种原因就是事实上的OOM(虽然/var/log/message中没有标明操作系统kill了进行,应该是进程内部初始化已申请内存时报错了,因为malloc的申请会被OS尽可能延后的分配,所以很有可 阅读全文
posted @ 2022-04-23 16:58 zhjh256 阅读(1081) 评论(0) 推荐(0)
摘要: 正常情况下lightdb/postgresql进程被杀或--mode=immediate模式停止的时候,是会进行正常恢复的。如下: 2022-04-23 08:27:28.085797C [unknown] zjh@postgres ::1(51378) walsender 57P03[2022-0 阅读全文
posted @ 2022-04-23 16:55 zhjh256 阅读(380) 评论(0) 推荐(0)
摘要: 2022-04-22 05:30:48.790022C lt_recvlogical zjh@postgres [local] walsender idle 55006[2022-04-22 05:30:48 UTC] 0 [201020] ERROR: replication slot "test 阅读全文
posted @ 2022-04-22 13:56 zhjh256 阅读(484) 评论(0) 推荐(0)
摘要: lt_dump采用的是ddl和数据分开的方式导出(虽然数据也支持insert模式,但默认是copy模式,性能最佳,压缩率最高),支持串行和并行导出,并行的时候按照对象级级并发(所以采用lightdb部署模式会非常快,资源可以用完)。 如下: [zjh@hs-10-20-30-193 lt_dump_ 阅读全文
posted @ 2022-04-17 19:59 zhjh256 阅读(244) 评论(0) 推荐(0)
摘要: https://help.aliyun.com/document_detail/65637.html https://blog.51cto.com/13990437/2400940 https://www.modb.pro/db/15391 测试postgresql 阅读全文
posted @ 2022-04-16 20:30 zhjh256 阅读(53) 评论(0) 推荐(0)
摘要: 这个版本开始,LightDB正式升级为原生分布式版本并通过中国信通院分布式测试,表现出线性扩展性。 全文检索支持自定义stopword。 对Oracle、mysql的兼容性大大增强,尤其是语义级兼容性。 新增oracle优化器提示。 特性清单如下: E.1. Release 13.3-22.1 Re 阅读全文
posted @ 2022-04-12 21:43 zhjh256 阅读(107) 评论(0) 推荐(0)
摘要: 之所以有逻辑复制,是因为物理复制是基于数据块的复制,每个实例的数据块是自己维护的,无法做到全局,所以只能借助逻辑块复制,即使是内核集成的HTAP,在行存和列存之间同步时,也采用的是逻辑块复制。逻辑复制可用于很多场景,例如部分数据同步、DW集成、同步到大数据、ES、做流式计算、缓存更新等等,在这些场景 阅读全文
posted @ 2022-04-10 18:19 zhjh256 阅读(2515) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 27 下一页