关于Windows与Linux环境下的安装,有官方手册作:技术文档-DM安装与卸载,可供参考
实例创建完成后,就可以点开数据迁移工具,尝试做一个Mysql与DM的迁移示例
当然官方也有提供可供参考的技术文档-从MYSQL迁移到DM
urljdbc:mysql://49.235.78.6:3306/eshop?characterEncoding=UTF-8&useUnicode=true&useSSL=false&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
紧接着,我们进行Linux上的DM数据库安装:
当然也有:技术文档-DM数据库安装,可供参考
wget https://download.dameng.com/eco/adapter/DM8/202305/dm8_20230420_longson_kylin10_64_85661.zip
由于我的外网模拟的机子不是生产的国产CPU平台是普通的x86,所以我实际下载的是
wget https://download.dameng.com/eco/adapter/DM8/202304/dm8_20230418_x86_rh6_64.zip
bash[root@golovin-work evn]# wget https://download.dameng.com/eco/adapter/DM8/202305/dm8_20230420_longson_kylin10_64_85661.zip
--2023-07-12 15:46:13-- https://download.dameng.com/eco/adapter/DM8/202305/dm8_20230420_longson_kylin10_64_85661.zip
Resolving download.dameng.com (download.dameng.com)... 121.14.45.23, 121.14.45.21, 121.14.45.22, ...
Connecting to download.dameng.com (download.dameng.com)|121.14.45.23|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1192433603 (1.1G) [application/zip]
Saving to: ‘dm8_20230420_longson_kylin10_64_85661.zip’
dm8_20230420_longson_kylin10_64_85661.zip 100%[=============================================================================================================>] 1.11G 18.8MB/s in 63s
2023-07-12 15:47:20 (18.1 MB/s) - ‘dm8_20230420_longson_kylin10_64_85661.zip’ saved [1192433603/1192433603]
[root@golovin-work evn]# ls
dm8_20230420_longson_kylin10_64_85661.zip git-2.21.4 jdk minio-service mysql nacos redis
bash# 创建对应的用户组和权限
[root@golovin-work iso]# groupadd dinstall
[root@golovin-work iso]# useradd -g dinstall -m -d /home/ctm/evn/dmdba -s /bin/bash dmdba
useradd: warning: the home directory already exists. (仅是warn,这是由于之前已创建该目录了)
Not copying any file from skel directory into it.
[root@golovin-work iso]# passwd dmdba
Changing password for user dmdba.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
# 修改文件最大打开数
vi /etc/security/limits.conf
# 在最后添加上以下配置
dmdba hard nofile 65536
dmdba soft nofile 65536
dmdba hard stack 32768
dmdba soft stack 16384
# 查看配置是否生效,命令如下,切换到 dmdba 用户
su dmdba
ulimit -a
# 检查open files参数(65536)与stack size参数(16384)
[root@golovin-work-centos-s-2vcpu-4gb-sfo3-01 evn]# su dmdba
bash-4.4$ ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 14674
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 16384
cpu time (seconds, -t) unlimited
max user processes (-u) 14674
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
# 上传到软件文件夹,并解压
cd /home/ctm/software
wget https://download.dameng.com/eco/adapter/DM8/202305/dm8_20230420_longson_kylin10_64_85661.zip
# 解压到evn目录
mkdir -p /home/ctm/evn/dmdba && unzip /home/ctm/software/dm8_20230420_longson_kylin10_64_85661.zip -d /home/ctm/evn/dmdba
# 装载ISO文件(需要root用户)- 取消挂载可用 umount /home/ctm/evn/dmdba/iso
mkdir -p /home/ctm/evn/dmdba/iso && mount -o loop /home/ctm/evn/dmdba/dm8_20230420_longson_kylin10_64.iso /home/ctm/evn/dmdba/iso
# 装载完成后就可以在iso文件夹中看见如下两个文件,其中DMInstall.bin就是我们需要的安装文件
'DM8 Install.pdf' DMInstall.bin
# 安装DM数据库
cd /home/ctm/evn/dmdba/iso && ./DMInstall.bin -i
# 这时候可能会面临如下权限问题(这是未执行之前的用户配置会出现的问题)
[root@golovin-work iso]# cd /home/ctm/evn/dmdba/iso && ./DMInstall.bin -i
OS user dmdba is not detected, please check whether the OS user dmdba exist!
# 后续参见官方文档即可
https://eco.dameng.com/document/dm/zh-cn/pm/install-uninstall.html#2.2.2.2%20%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%AE%89%E8%A3%85
# 正常情况就会开始进入安装流程
[root@golovin-work-centos-s-2vcpu-4gb-sfo3-01 software]# cd /home/ctm/evn/dmdba/iso && ./DMInstall.bin -i
Please select the installer language (E/e:English C/c:Chinese) [E/e]:C
解压安装程序.........
欢迎使用达梦数据库安装程序
是否输入Key文件路径? (Y/y:是 N/n:否) [Y/y]:n
是否设置时区? (Y/y:是 N/n:否) [Y/y]:y
设置时区:
[ 1]: GTM-12=日界线西
[ 2]: GTM-11=萨摩亚群岛
[ 3]: GTM-10=夏威夷
[ 4]: GTM-09=阿拉斯加
[ 5]: GTM-08=太平洋时间(美国和加拿大)
[ 6]: GTM-07=亚利桑那
[ 7]: GTM-06=中部时间(美国和加拿大)
[ 8]: GTM-05=东部部时间(美国和加拿大)
[ 9]: GTM-04=大西洋时间(美国和加拿大)
[10]: GTM-03=巴西利亚
[11]: GTM-02=中大西洋
[12]: GTM-01=亚速尔群岛
[13]: GTM=格林威治标准时间
[14]: GTM+01=萨拉热窝
[15]: GTM+02=开罗
[16]: GTM+03=莫斯科
[17]: GTM+04=阿布扎比
[18]: GTM+05=伊斯兰堡
[19]: GTM+06=达卡
[20]: GTM+07=曼谷,河内
[21]: GTM+08=中国标准时间
[22]: GTM+09=汉城
[23]: GTM+10=关岛
[24]: GTM+11=所罗门群岛
[25]: GTM+12=斐济
[26]: GTM+13=努库阿勒法
[27]: GTM+14=基里巴斯
请选择设置时区 [21]:21
安装类型:
1 典型安装
2 服务器
3 客户端
4 自定义
请选择安装类型的数字序号 [1 典型安装]:4
1 服务器组件
2 客户端组件
2.1 DM管理工具
2.2 DM性能监视工具
2.3 DM数据迁移工具
2.4 DM控制台工具
2.5 DM审计分析工具
2.6 SQL交互式查询工具
3 驱动
4 用户手册
5 数据库服务
5.1 实时审计服务
5.2 作业服务
5.3 实例监控服务
5.4 辅助插件服务
请选择安装组件的序号 (使用空格间隔) [1 2 3 4 5]:1 2 3 4 5
所需空间: 1815M
请选择安装目录 [/opt/dmdbms]:/home/ctm/evn/dmdba/dmdbms
可用空间: 68G
是否确认安装路径(/home/ctm/evn/dmdba/dmdbms)? (Y/y:是 N/n:否) [Y/y]:y
安装前小结
安装位置: /home/ctm/evn/dmdba/dmdbms
所需空间: 1815M
可用空间: 68G
版本信息:
有效日期:
安装类型: 自定义
是否确认安装? (Y/y:是 N/n:否):y
2023-07-12 17:42:40
[INFO] 安装达梦数据库...
2023-07-12 17:42:40
[INFO] 安装 基础 模块...
2023-07-12 17:42:44
[INFO] 安装 服务器 模块...
2023-07-12 17:42:44
[INFO] 安装 客户端 模块...
2023-07-12 17:42:48
[INFO] 安装 驱动 模块...
2023-07-12 17:42:49
[INFO] 安装 手册 模块...
2023-07-12 17:42:49
[INFO] 安装 服务 模块...
2023-07-12 17:42:50
[INFO] 移动日志文件。
2023-07-12 17:42:50
[INFO] 安装达梦数据库完成。
安装结束
# 安装成功,查看一下安装的内容
cd /home/ctm/evn/dmdba/dmdbms && ll
[root@golovin-work dmdbms]# cd /home/ctm/evn/dmdba/dmdbms && ll
total 36
drwxr-xr-x. 10 dmdba dinstall 8192 Jul 12 17:42 bin
drwxr-xr-x. 2 dmdba dinstall 30 Jul 12 17:42 bin2
drwxr-xr-x. 3 dmdba dinstall 19 Jul 12 17:42 desktop
drwxr-xr-x. 2 dmdba dinstall 4096 Jul 12 17:42 doc
drwxr-xr-x. 14 dmdba dinstall 160 Jul 12 17:42 drivers
drwxr-xr-x. 2 dmdba dinstall 4096 Jul 12 17:42 include
drwxr-xr-x. 2 dmdba dinstall 94 Jul 12 17:42 jar
drwxr-xr-x. 7 dmdba dinstall 161 Jul 12 17:42 jdk
-rwxr-xr-x. 1 dmdba dinstall 1071 Jul 12 17:42 license_en.txt
-rwxr-xr-x. 1 dmdba dinstall 1146 Jul 12 17:42 license_zh.txt
drwxr-xr-x. 2 dmdba dinstall 77 Jul 12 17:42 log
drwxr-xr-x. 6 dmdba dinstall 92 Jul 12 17:42 samples
drwxr-xr-x. 3 dmdba dinstall 37 Jul 12 17:42 script
drwxr-xr-x. 8 dmdba dinstall 4096 Jul 12 17:42 tool
drwxr-xr-x. 3 dmdba dinstall 97 Jul 12 17:42 uninstall
-rwxr-xr-x. 1 dmdba dinstall 2208 Jul 12 17:42 uninstall.sh
drwxr-xr-x. 3 dmdba dinstall 102 Jul 12 17:42 web
bash# 创建实例文件夹和log文件夹
mkdir -p /home/ctm/evn/dmdba/dmdbms/dm8data && mkdir -p /home/ctm/evn/dmdba/dmdbms/dmlog
# 授权
chmod 777 /home/ctm/evn/dmdba/dmdbms/dm8data
chmod 777 /home/ctm/evn/dmdba/dmdbms/dmlog
bash# 进入安装目录的bin目录下,使用dminit进行初始化
cd /home/ctm/evn/dmdba/dmdbms/bin && ./dminit
# 配置内容如下
[root@golovin-work-centos-s-2vcpu-4gb-sfo3-01 bin]# cd /home/ctm/evn/dmdba/dmdbms/bin && ./dminit
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2024-04-17
input system dir: /home/ctm/evn/dmdba/dmdbms/dm8data
input db name: nacos
input port num: 5249
input page size(4, 8, 16, 32): 32
input extent size(16, 32, 64): 16
input sec priv mode(0, 1, 2, 3): 0
input global env label flag? ([Y]es, [N]o): 0
input time zone(-12:59,+14:00): input time zone(-12:59,+14:00): +8
string case sensitive? ([Y]es, [N]o): n
which charset to use? (0[GB18030], 1[UTF-8], 2[EUC-KR]): 1
length in char? ([Y]es, [N]o): y
enable database encrypt? ([Y]es, [N]o): n
input slice size(0, 512, 4096): 4096
page check mode? (0/1/2): 0
input elog path: /home/ctm/evn/dmdba/dmdbms/dmlog
only create huge table with delta? (0/1): 0
rlog generate for huge? (0/1): 0
pseg_mgr_flag (0/1): 0
auto_overwrite mode? (0/1/2): 0
CHARACTER type fixed storage ? ([Y]es/1, [N]o/0): 0
SQL log forbid ? ([Y]es/1, [N]o/0): 0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
log file path: /home/ctm/evn/dmdba/dmdbms/dm8data/nacos/nacos01.log
log file path: /home/ctm/evn/dmdba/dmdbms/dm8data/nacos/nacos02.log
write to dir [/home/ctm/evn/dmdba/dmdbms/dm8data/nacos].
create dm database success. 2023-07-12 17:54:09
相关参数释义如下:
初始化参数 | 含义 |
---|---|
input system dir | 数据文件存放路径 |
input db name | 数据库名 |
input port num | 端口号 |
input page size | 页大小 |
Input extent size | 簇大小 |
input sec priv mode | 安全特权模式 |
input time zone | 时区(东8区) |
string case sensitive? | 大小写敏感 |
which charset to use? | 字符集 |
| length in char? | 字符长度 | | enable database encrypt? | 是否加密 | | input slice size | 1 | | rlog generate for huge | $1 | | auto_overwrite mode | 自动覆盖模式 |
bash# 首先进入script目录下的root目录
cd /home/ctm/evn/dmdba/dmdbms/script/root
# 执行dm_service_installer.sh脚本(下述路径要和dminit时创建的实例路径对应)
./dm_service_installer.sh -t dmserver -p Nacos -dm_ini /home/ctm/evn/dmdba/dmdbms/dm8data/nacos/dm.ini
# 上述操作会创建DmServiceNacos服务(-t dmserver -p Nacos 由这两个参数拼接,根据需要对应修改)
# 若要删除该服务则执行删除脚本即可(./dm_service_uninstaller.sh -n DmServiceNacos)
# 创建服务完成后,则可以进行该服务的启动
service DmServiceNacos start
# 如果上述启动方式不行,可使用下述指令;或被系统拦截掉,检查下是否需要暂时禁用sudo setenforce 0
# 进入bin目录下,使用dmserver手动启动(路径更换为实际路径即可,&服务带上就是在后台运行)
cd /home/ctm/evn/dmdba/dmdbms/bin && ./dmserver /home/ctm/evn/dmdba/dmdbms/dm8data/nacos/dm.ini &
# 操作过程
[root@golovin-work root]# cd /home/ctm/evn/dmdba/dmdbms/script/root
[root@golovin-work root]# ./dm_service_installer.sh -t dmserver -p Nacos -dm_ini /home/ctm/evn/dmdba/dmdbms/dm8data/nacos/dm.ini
Created symlink /etc/systemd/system/multi-user.target.wants/DmServiceNacos.service → /usr/lib/systemd/system/DmServiceNacos.service.
创建服务(DmServiceNacos)完成
[root@golovin-work root]# service DmServiceNacos start
Redirecting to /bin/systemctl start DmServiceNacos.service
Job for DmServiceNacos.service failed because the control process exited with error code.
See "systemctl status DmServiceNacos.service" and "journalctl -xe" for details.
# 这里就能看到启动失败了,所以我们去手动启动(或者查看详情journalctl -xe去排查错误)
[root@golovin-work root]# cd /home/ctm/evn/dmdba/dmdbms/bin
[root@golovin-work bin]# ./dmserver /home/ctm/evn/dmdba/dmdbms/dm8data/nacos/dm.ini &
[1] 844458
[root@golovin-work-centos-s-2vcpu-4gb-sfo3-01 bin]# file dm.key not found, use default license!
version info: develop
DM Database Server 64 V8 03134284044-20230417-187846-20040 startup...
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
Database mode = 0, oguid = 0
License will expire on 2024-04-17
file lsn: 0
ndct db load finished
ndct second level fill fast pool finished
ndct third level fill fast pool finished
ndct second level fill fast pool finished
ndct third level fill fast pool finished
ndct fill fast pool finished
pseg_set_gtv_trxid_low next_trxid in mem:[1002]
pseg_collect_mgr_items, total collect 0 active_trxs, 0 cmt_trxs, 0 pre_cmt_trxs, 0 to_release_trxs, 0 active_pages, 0 cmt_pages, 0 pre_cmt_pages, 0 to_release_pages, 0 mgr pages, 0 mgr recs!
next_trxid in mem:[2004]
next_trxid = 3006.
pseg recv finished
nsvr_startup end.
aud sys init success.
aud rt sys init success.
trx: 3006 purged 1 pages
......
......
......
trx: 3025 purged 1 pages
systables desc init success.
ndct_db_load_info success.
nsvr_process_before_open begin.
nsvr_process_before_open success.
SYSTEM IS READY.
# 这里就能看到已经成功了,用工具连接看看或者查看进程、端口、状态都可
bash# 检查下状态是否正常,可以查看status 或者查看端口或者服务进程:
cd /home/ctm/evn/dmdba/dmdbms/bin && ./DmServiceDMSERVER status
netstat -ntlp
ps -ef|grep dmserver
Linux上的DM数据库安装配置启动完毕后,涉及到数据库迁移时,数据迁移ok,但使用起来会有各类报错,如关键字不一样,语法部分存在差异等等,这里以Mysql为例,我们可以对数据库实例的dm.ini
文件进行配置
bashCOMPATIBLE_MODE = 4
在
vim ./dm.ini
之后就可以进行搜索匹配:向下搜索关键字找到配置进行修改:
/COMPATIBLE_MODE
,或者向上搜索:
?COMPATIBLE_MODE
bash普通模式搜索:
/[关键词]:搜索关键词,并向下查找。
?[关键词]:搜索关键词,并向上查找。
例如,要查找 "example" 这个词,您可以在普通模式下输入 /example 然后按回车。
搜索结果之间的导航:
n:向下查找下一个匹配结果。
N:向上查找上一个匹配结果。
bashGROUP_OPT_FLAG = 1
bashEXECLUDE_RESERVED_WORDS = domain,verify,reference,limit,user,role,path,method,no,plan,date,number,scope,login,type
如图所示:
camunda流程引擎官方支持的数据库有:MySQL 、MariaDB 、Oracle 、DB2 、PostgreSQL 、SQL Server、H2。对于其他类型的数据库如何支持,尤其是国产数据库的支持,下面以达梦数据库为例进行介绍。对于其他国产数据库如人大金仓、神州通用等也是同样的修改方法,只是需要注意一下对应数据库的方言即可。
在maven工程的Resources目录下建lib目录,放入达梦数据库驱动包Dm7JdbcDriver18.jar,并配置maven为本地引用
dm.jdbc.driver.DmDriver
jdbc
system
${project.basedir}/src/main/resources/lib/Dm7JdbcDriver18.jar
url: jdbc:dm://127.0.0.1:5236
username: oa
password: 12345678aA
driver-class-name: dm.jdbc.driver.DmDriver
javaprotected static Properties getDefaultDatabaseTypeMappings() {
Properties databaseTypeMappings = new Properties();
databaseTypeMappings.setProperty("H2", "h2");
databaseTypeMappings.setProperty(MY_SQL_PRODUCT_NAME, "mysql");
databaseTypeMappings.setProperty(MARIA_DB_PRODUCT_NAME, "mariadb");
databaseTypeMappings.setProperty("Oracle", "oracle");
databaseTypeMappings.setProperty("PostgreSQL", "postgres");
databaseTypeMappings.setProperty("Microsoft SQL Server", "mssql");
databaseTypeMappings.setProperty("DB2", "db2");
databaseTypeMappings.setProperty("DB2", "db2");
databaseTypeMappings.setProperty("DB2/NT", "db2");
databaseTypeMappings.setProperty("DB2/NT64", "db2");
databaseTypeMappings.setProperty("DB2 UDP", "db2");
databaseTypeMappings.setProperty("DB2/LINUX", "db2");
databaseTypeMappings.setProperty("DB2/LINUX390", "db2");
databaseTypeMappings.setProperty("DB2/LINUXX8664", "db2");
databaseTypeMappings.setProperty("DB2/LINUXZ64", "db2");
databaseTypeMappings.setProperty("DB2/400 SQL", "db2");
databaseTypeMappings.setProperty("DB2/6000", "db2");
databaseTypeMappings.setProperty("DB2 UDB iSeries", "db2");
databaseTypeMappings.setProperty("DB2/AIX64", "db2");
databaseTypeMappings.setProperty("DB2/HPUX", "db2");
databaseTypeMappings.setProperty("DB2/HP64", "db2");
databaseTypeMappings.setProperty("DB2/SUN", "db2");
databaseTypeMappings.setProperty("DB2/SUN64", "db2");
databaseTypeMappings.setProperty("DB2/PTX", "db2");
databaseTypeMappings.setProperty("DB2/2", "db2");
// 适配达梦数据库
databaseTypeMappings.setProperty("DM DBMS", "dm");
return databaseTypeMappings;
}
javapublic class DbSqlSessionFactory implements SessionFactory {
public static final String MSSQL = "mssql";
public static final String DB2 = "db2";
public static final String ORACLE = "oracle";
public static final String H2 = "h2";
public static final String MYSQL = "mysql";
public static final String POSTGRES = "postgres";
public static final String MARIADB = "mariadb";
// 适配达梦数据库
public static final String DMDBMS = "dm";
// 适配达梦数据库
public static final String[] SUPPORTED_DATABASES = {DMDBMS, MSSQL, DB2, ORACLE, H2, MYSQL, POSTGRES, MARIADB};
static块
javadatabaseSpecificLimitBeforeStatements.put(DMDBMS, "select * from ( select a.*, ROWNUM rnum from (");
optimizeDatabaseSpecificLimitBeforeWithoutOffsetStatements.put(DMDBMS, "select * from ( select a.*, ROWNUM rnum from (");
databaseSpecificLimitAfterStatements.put(DMDBMS, " ) a where ROWNUM < #{lastRow}) where rnum >= #{firstRow}");
optimizeDatabaseSpecificLimitAfterWithoutOffsetStatements.put(DMDBMS, " ) a where ROWNUM <= #{maxResults})");
databaseSpecificLimitBeforeWithoutOffsetStatements.put(DMDBMS, "");
databaseSpecificLimitAfterWithoutOffsetStatements.put(DMDBMS, "AND ROWNUM <= #{maxResults}");
databaseSpecificInnerLimitAfterStatements.put(DMDBMS, databaseSpecificLimitAfterStatements.get(DMDBMS));
databaseSpecificLimitBetweenStatements.put(DMDBMS, "");
databaseSpecificLimitBetweenFilterStatements.put(DMDBMS, "");
databaseSpecificLimitBetweenAcquisitionStatements.put(DMDBMS, "");
databaseSpecificOrderByStatements.put(DMDBMS, defaultOrderBy);
databaseSpecificLimitBeforeNativeQueryStatements.put(DMDBMS, "");
databaseSpecificDistinct.put(DMDBMS, "distinct");
databaseSpecificNumericCast.put(DMDBMS, "");
databaseSpecificCountDistinctBeforeStart.put(DMDBMS, defaultDistinctCountBeforeStart);
databaseSpecificCountDistinctBeforeEnd.put(DMDBMS, defaultDistinctCountBeforeEnd);
databaseSpecificCountDistinctAfterEnd.put(DMDBMS, defaultDistinctCountAfterEnd);
databaseSpecificEscapeChar.put(DMDBMS, defaultEscapeChar);
databaseSpecificDummyTable.put(DMDBMS, "FROM DUAL");
databaseSpecificBitAnd1.put(DMDBMS, "BITAND(");
databaseSpecificBitAnd2.put(DMDBMS, ",");
databaseSpecificBitAnd3.put(DMDBMS, ")");
databaseSpecificDatepart1.put(DMDBMS, "to_number(to_char(");
databaseSpecificDatepart2.put(DMDBMS, ",");
databaseSpecificDatepart3.put(DMDBMS, "))");
databaseSpecificTrueConstant.put(DMDBMS, "1");
databaseSpecificFalseConstant.put(DMDBMS, "0");
databaseSpecificIfNull.put(DMDBMS, "NVL");
databaseSpecificDaysComparator.put(DMDBMS, "${date} <= #{currentTimestamp} - ${days}");
databaseSpecificCollationForCaseSensitivity.put(DMDBMS, "");
addDatabaseSpecificStatement(DMDBMS, "selectHistoricProcessInstanceDurationReport", "selectHistoricProcessInstanceDurationReport_oracle");
addDatabaseSpecificStatement(DMDBMS, "selectHistoricTaskInstanceDurationReport", "selectHistoricTaskInstanceDurationReport_oracle");
addDatabaseSpecificStatement(DMDBMS, "selectHistoricTaskInstanceCountByTaskNameReport", "selectHistoricTaskInstanceCountByTaskNameReport_oracle");
addDatabaseSpecificStatement(DMDBMS, "selectFilterByQueryCriteria", "selectFilterByQueryCriteria_oracleDb2");
addDatabaseSpecificStatement(DMDBMS, "selectHistoricProcessInstanceIdsForCleanup", "selectHistoricProcessInstanceIdsForCleanup_oracle");
addDatabaseSpecificStatement(DMDBMS, "selectHistoricDecisionInstanceIdsForCleanup", "selectHistoricDecisionInstanceIdsForCleanup_oracle");
addDatabaseSpecificStatement(DMDBMS, "selectHistoricCaseInstanceIdsForCleanup", "selectHistoricCaseInstanceIdsForCleanup_oracle");
addDatabaseSpecificStatement(DMDBMS, "selectHistoricBatchIdsForCleanup", "selectHistoricBatchIdsForCleanup_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteAttachmentsByRemovalTime", "deleteAttachmentsByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteCommentsByRemovalTime", "deleteCommentsByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricActivityInstancesByRemovalTime", "deleteHistoricActivityInstancesByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricDecisionInputInstancesByRemovalTime", "deleteHistoricDecisionInputInstancesByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricDecisionInstancesByRemovalTime", "deleteHistoricDecisionInstancesByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricDecisionOutputInstancesByRemovalTime", "deleteHistoricDecisionOutputInstancesByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricDetailsByRemovalTime", "deleteHistoricDetailsByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteExternalTaskLogByRemovalTime", "deleteExternalTaskLogByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricIdentityLinkLogByRemovalTime", "deleteHistoricIdentityLinkLogByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricIncidentsByRemovalTime", "deleteHistoricIncidentsByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteJobLogByRemovalTime", "deleteJobLogByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricProcessInstancesByRemovalTime", "deleteHistoricProcessInstancesByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricTaskInstancesByRemovalTime", "deleteHistoricTaskInstancesByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricVariableInstancesByRemovalTime", "deleteHistoricVariableInstancesByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteUserOperationLogByRemovalTime", "deleteUserOperationLogByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteByteArraysByRemovalTime", "deleteByteArraysByRemovalTime_oracle");
addDatabaseSpecificStatement(DMDBMS, "deleteHistoricBatchesByRemovalTime", "deleteHistoricBatchesByRemovalTime_oracle");
constants = new HashMap<String, String>();
constants.put("constant.event", "cast('event' as nvarchar2(255))");
constants.put("constant.op_message", "NEW_VALUE_ || '_|_' || PROPERTY_");
constants.put("constant_for_update", "for update");
constants.put("constant.datepart.quarter", "'Q'");
constants.put("constant.datepart.month", "'MM'");
constants.put("constant.datepart.minute", "'MI'");
constants.put("constant.null.startTime", "null START_TIME_");
constants.put("constant.varchar.cast", "'${key}'");
constants.put("constant.integer.cast", "NULL");
constants.put("constant.null.reporter", "NULL AS REPORTER_");
dbSpecificConstants.put(DMDBMS, constants);
xml<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
</dependency>
1、在使用达梦数据库时,需要添加相关的JDBC驱动依赖。但是,由于达梦数据库的驱动通常不在公开的Maven仓库中,你可能需要手动下载并安装到你的本地Maven仓库,或者上传到你的私有Maven仓库。
安装到本地Maven仓库的命令如下:
bashmvn install:install-file -Dfile=<path-to-your-jar> -DgroupId=com.dameng -DartifactId=DmJdbcDriver18 -Dversion=8.1.1.193 -Dpackaging=jar
在这里,<path-to-your-jar>
是你下载的JDBC驱动的JAR文件的路径。
2、然后,你可以在你的pom.xml
中添加这个依赖:
xml<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
<version>8.1.1.193</version>
</dependency>
注意,可能需要根据你的实际情况调整groupId
、artifactId
、version
等信息。
此外,如果使用的是Hibernate,可能还需要添加相应的依赖。例如:
xml<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmDialect-for-hibernate5.3</artifactId>
<version>8.1.2.192</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.3.17.Final</version>
</dependency>
同样,你可能需要根据你的实际情况调整版本号。
另外,由于达梦数据库可能有自己特定的SQL方言,你可能需要使用特定的JPA或Hibernate方言。你可以向达梦数据库的供应商询问是否提供了这样的方言,以及如何添加相应的依赖。
最后在项目配置yml文件中修改数据库配置为DM:
ymlspring:
datasource:
driver-class-name: dm.jdbc.driver.DmDriver
url: jdbc:dm://localhost:5236/your_database
username: your_username
password: your_password
hikari:
maximum-pool-size: 10
minimum-idle: 2
idle-timeout: 600000
pool-name: DMPool
max-lifetime: 1800000
connection-timeout: 30000
重写ProcessEngineConfigurationImpl时,可能会面临启动报错,这时候添加persistence-api架包引入工作流服务的pom即可
pom<dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> <version>1.0.2</version> </dependency>
本文作者:Golovin
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!