达梦数据库 DM8 能跑就行

基于docker的安装脚本

#!/bin/bash

# docker 环境需自行安装 !!!

# docker 安装 DM8 官方手册:https://eco.dameng.com/document/dm/zh-cn/start/dm-install-docker.html

# 下载DM8 docker 镜像
wget https://download.dameng.com/eco/dm8/dm8_20230808_rev197096_x86_rh6_64_single.tar

# 创建 DM8 数据持久化目录
mkdir -p /data/dm8_test

# 导入 DM8 docker镜像
docker load -i dm8_20230808_rev197096_x86_rh6_64_single.tar

# 查看镜像列表
docker images

# 官方启动命令
#docker run -d -p 30236:5236 --restart=always --name dm8_test --privileged=true -e PAGE_SIZE=16 -e LD_LIBRARY_PATH=/opt/dmdbms/bin -e  EXTENT_SIZE=32 -e BLANK_PAD_MODE=1 -e LOG_SIZE=1024 -e UNICODE_FLAG=1 -e LENGTH_IN_CHAR=1 -e INSTANCE_NAME=dm8_test -v /data/dm8_test:/opt/dmdbms/data dm8_single:dm8_20230808_rev197096_x86_rh6_64

# 优化后的启动命令
docker run -d \
    -p 5236:5236 \
    --restart=always \
    --name dm8_test \
    --privileged=true \
    -e PAGE_SIZE=16 \
    -e LD_LIBRARY_PATH=/opt/dmdbms/bin \
    -e  EXTENT_SIZE=32 \
    -e BLANK_PAD_MODE=1 \
    -e LOG_SIZE=1024 \
    -e UNICODE_FLAG=1 \
    -e LENGTH_IN_CHAR=1 \
    -e INSTANCE_NAME=dm8_test \
    -v /data/dm8_test:/opt/dmdbms/data \
    dm8_single:dm8_20230808_rev197096_x86_rh6_64

# 查看启动过程是否有报错
docker logs dm8_test
sleep 3

# 连接信息
echo 'docker 容器中disql命令:/opt/dmdbms/bin/disql'
echo '默认用户名和密码是:SYSDBA/SYSDBA001'

echo '本地连接测试命令:'
echo 'docker exec -it dm8_test /opt/dmdbms/bin/disql SYSDBA/SYSDBA001'

安装日志

--2023-11-20 02:13:36--  https://download.dameng.com/eco/dm8/dm8_20230808_rev197096_x86_rh6_64_single.tar
Resolving download.dameng.com (download.dameng.com)... 112.25.25.154, 112.25.25.153, 112.25.25.156
Connecting to download.dameng.com (download.dameng.com)|112.25.25.154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 609584640 (581M) [application/octet-stream]
Saving to: ‘dm8_20230808_rev197096_x86_rh6_64_single.tar100%[=======================================================================================================>] 609,584,640 66.9MB/s   in 8.4s   

2023-11-20 02:13:45 (69.5 MB/s) - ‘dm8_20230808_rev197096_x86_rh6_64_single.tar’ saved [609584640/609584640]

644879075e24: Loading layer [==================================================>]  117.9MB/117.9MB
d7ff1dc646ba: Loading layer [==================================================>]  15.87kB/15.87kB
686245e78935: Loading layer [==================================================>]  14.85kB/14.85kB
d73dd9e65295: Loading layer [==================================================>]  5.632kB/5.632kB
2de391e51d73: Loading layer [==================================================>]  3.072kB/3.072kB
c709c635d729: Loading layer [==================================================>]  101.3MB/101.3MB
c853b6a23c2c: Loading layer [==================================================>]   2.56kB/2.56kB
3e10e7cfd329: Loading layer [==================================================>]  4.096kB/4.096kB
41e82b7aea0d: Loading layer [==================================================>]  153.6kB/153.6kB
3827eb1a7e43: Loading layer [==================================================>]  843.3kB/843.3kB
4f883f5c5226: Loading layer [==================================================>]  4.608kB/4.608kB
73412d6dfa0f: Loading layer [==================================================>]  389.2MB/389.2MB
52d551f8449b: Loading layer [==================================================>]   2.56kB/2.56kB
0b23aa5ba4bf: Loading layer [==================================================>]  4.608kB/4.608kB
b41227f2b3ed: Loading layer [==================================================>]   2.56kB/2.56kB
b5bd59020dd3: Loading layer [==================================================>]  4.096kB/4.096kB
33bfd86b40c4: Loading layer [==================================================>]  4.096kB/4.096kB
Loaded image: dm8_single:dm8_20230808_rev197096_x86_rh6_64
REPOSITORY   TAG                                 IMAGE ID       CREATED        SIZE
dm8_single   dm8_20230808_rev197096_x86_rh6_64   ab98e2f4a568   3 months ago   601MB
ff7d6daa5d3ec908cadce3dffb60987dc1eac7b250818992f6ab3277b6245667
Script start.
file dm.key not found, use default license!
License will expire on 2024-07-26
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL

 log file path: /opt/dmdbms/data/DAMENG/DAMENG01.log


 log file path: /opt/dmdbms/data/DAMENG/DAMENG02.log

write to dir [/opt/dmdbms/data/DAMENG].
docker 容器中disql命令:/opt/dmdbms/bin/disql
默认用户名和密码是:SYSDBA/SYSDBA001
本地连接测试命令:
docker exec -it dm8_test /opt/dmdbms/bin/disql SYSDBA/SYSDBA001

 一个快速初始化DM8环境的脚本(含导入备份的命令)

#!/bin/bash

docker kill dm8_test

docker rm -f dm8_test

rm -rf /data/dm8_test

mkdir /data/dm8_test

cp QZBG.dmp /data/dm8_test/

docker run -d \
        -p 5236:5236 \
        --restart=always \
        --name dm8_test \
        --privileged=true \
        -e PAGE_SIZE=16 \
        -e LD_LIBRARY_PATH=/opt/dmdbms/bin \
        -e  EXTENT_SIZE=32 \
        -e BLANK_PAD_MODE=1 \
        -e LOG_SIZE=1024 \
        -e UNICODE_FLAG=1 \
        -e LENGTH_IN_CHAR=1 \
        -e INSTANCE_NAME=dm8_test \
        -v /data/dm8_test:/opt/dmdbms/data \
        dm8_single:dm8_20230808_rev197096_x86_rh6_64

echo "docker exec -it dm8_test bash"
echo "cd /opt/dmdbms/data"
echo "/opt/dmdbms/bin/dimp USERID=SYSDBA/SYSDBA001 FILE=QZBG.dmp FULL=Y"

DM8导入数据库时,可能会提示如下错误:备份中关联的账号在目标数据库上不存在,提前创建出来就好了

[WARNING]Error Code:-2101,Invalid user name [QZBG] 

DM8 LENGTH_IN_CHAR 解释

 

posted @ 2023-11-20 15:26  三角形  阅读(130)  评论(0编辑  收藏  举报