命令行方式在麒麟V10下部署达梦数据库DM8
1.登录操作系统,查看版本
用户名:root
密码:Yunbee123
[root@localhost ~]# uname -a
Linux localhost.localdomain 4.19.90-24.4.v2101.ky10.x86_64 #1 SMP Mon May 24 12:14:55 CST 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost etc]# cat /etc/kylin-release
Kylin Linux Advanced Server release V10 (Sword)
[root@localhost etc]# cat /proc/version
Linux
[root@localhost etc]# ldd --version
ldd (GNU libc) 2.28
Copyright (C) 2018 自由软件基金会。
这是一个自由软件;请见源代码的授权条款。本软件不含任何没有担保;甚至不保证适销性
或者适合某些特殊目的。
由 Roland McGrath 和 Ulrich Drepper 编写。
[root@localhost opt]# arch
[root@localhost opt]# lscpu
[root@localhost opt]# free -m
[root@localhost opt]# df -TH
2.准备安装包
2.1 找到dm8安装包
[root@localhost ~]# cd /opt
[root@localhost opt]# ll
总用量 949460
rw-r--r-- 1 root root 972244992 6月 21 10:27 dm8_20231109_x86_kylin10_64.iso
2.2 挂载DM8安装包镜像
[root@localhost opt]# mkdir /mnt/dm
[root@localhost opt]# mount dm8_20231109_x86_kylin10_64.iso /mnt/dm
mount: /mnt/dm: WARNING: source write-protected, mounted read-only.
[root@localhost opt]# cd /mnt/dm
[root@localhost dm]# ll
总用量 949396
-r-xr-xr-x 1 root root 2588819 11月 9 2023 'DM8 Install.pdf'
-r-xr-xr-x 1 root root 969591871 11月 9 2023 DMInstall.bin
3.创建用户
3.1 创建用户组
[root@localhost dm]# groupadd dinstall
3.2 创建用户
[root@localhost dm]# useradd -d /home/dmdba -g dinstall -m dmdba -s /bin/bash
[root@localhost dm]# id dmdba
用户id=1000(dmdba) 组id=1000(dinstall) 组=1000(dinstall)
3.3 设置用户密码
[root@localhost dm]# passwd dmdba
输入密码:Dameng123
4.创建目录
[root@localhost dm]# mkdir -p /dm8
5.分配权限
[root@localhost dm]# chown dmdba:dinstall -R /dm8
[root@localhost dm]# ls -ld /dm8
drwxr-xr-x 2 dmdba dinstall 6 9月 8 10:28 /dm8
6.命令行安装软件
6.1 找到安装软件
[root@localhost dm]# su - dmdba
[dmdba@localhost ~]$ cd /mnt/dm
[dmdba@localhost dm]$ ll
总用量 949396
-r-xr-xr-x 1 root root 2588819 11月 9 2023 'DM8 Install.pdf'
-r-xr-xr-x 1 root root 969591871 11月 9 2023 DMInstall.bin
6.2 命令行安装
[dmdba@localhost dm]$ ./DMInstall.bin -i
安装语言:
[1]: 简体中文
[2]: English
请选择安装语言 [1]:1
解压安装程序..........
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 26454
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 26454
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
可打开文件数过少,建议至少设置为65536或更多。
欢迎使用达梦数据库安装程序
是否输入Key文件路径? (Y/y:是 N/n:否) [Y/y]:n
是否设置时区? (Y/y:是 N/n:否) [Y/y]:
设置时区:
[ 1]: (GTM-12:00) 日界线西
[ 2]: (GTM-11:00) 萨摩亚群岛
[ 3]: (GTM-10:00) 夏威夷
[ 4]: (GTM-09:00) 阿拉斯加
[ 5]: (GTM-08:00) 太平洋时间(美国和加拿大)
[ 6]: (GTM-07:00) 亚利桑那
[ 7]: (GTM-06:00) 中部时间(美国和加拿大)
[ 8]: (GTM-05:00) 东部部时间(美国和加拿大)
[ 9]: (GTM-04:00) 大西洋时间(美国和加拿大)
[10]: (GTM-03:00) 巴西利亚
[11]: (GTM-02:00) 中大西洋
[12]: (GTM-01:00) 亚速尔群岛
[13]: (GTM) 格林威治标准时间
[14]: (GTM+01:00) 萨拉热窝
[15]: (GTM+02:00) 开罗
[16]: (GTM+03:00) 莫斯科
[17]: (GTM+04:00) 阿布扎比
[18]: (GTM+05:00) 伊斯兰堡
[19]: (GTM+06:00) 达卡
[20]: (GTM+07:00) 曼谷,河内
[21]: (GTM+08:00) 中国标准时间
[22]: (GTM+09:00) 首尔
[23]: (GTM+10:00) 关岛
[24]: (GTM+11:00) 所罗门群岛
[25]: (GTM+12:00) 斐济
[26]: (GTM+13:00) 努库阿勒法
[27]: (GTM+14:00) 基里巴斯
请选择时区 [21]:
安装类型:
1 典型安装
2 服务器
3 客户端
4 自定义
请选择安装类型的数字序号 [1 典型安装]:
所需空间: 2037M
请选择安装目录 [/home/dmdba/dmdbms]:/dm8
可用空间: 68G
是否确认安装路径(/dm8)? (Y/y:是 N/n:否) [Y/y]:
安装前小结
安装位置: /dm8
所需空间: 2037M
可用空间: 68G
版本信息:
有效日期:
安装类型: 典型安装
是否确认安装? (Y/y:是 N/n:否):y
2024-09-08 10:41:51
[INFO] 安装达梦数据库...
2024-09-08 10:41:52
[INFO] 安装 基础 模块...
2024-09-08 10:41:54
[INFO] 安装 服务器 模块...
2024-09-08 10:41:54
[INFO] 安装 客户端 模块...
2024-09-08 10:41:54
[INFO] 安装 驱动 模块...
2024-09-08 10:41:55
[INFO] 安装 手册 模块...
2024-09-08 10:41:55
[INFO] 安装 服务 模块...
2024-09-08 10:41:55
[INFO] 移动日志文件。
2024-09-08 10:41:55
[INFO] 安装达梦数据库完成。
请以root系统用户执行命令:
/dm8/script/root/root_installer.sh
安装结束
6.3 用root用户执行脚本
[root@localhost ~]# /dm8/script/root/root_installer.sh
移动 /dm8/bin/dm_svc.conf 到/etc目录
创建DmAPService服务
Created symlink /etc/systemd/system/multi-user.target.wants/DmAPService.service → /usr/lib/systemd/system/DmAPService.service.
创建服务(DmAPService)完成
启动DmAPService服务
[root@localhost ~]#
7.命令行建库
7.1 建库命令
[dmdba@localhost ~]$ cd /dm8/bin
[dmdba@localhost bin]$ ./dminit help
7.2 创建库
[dmdba@localhost bin]$ ./dminit path=/dm8/data db_name=YUNBEE instance_name=YUNBEE port_num=5236
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2024-11-08
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
log file path: /dm8/data/YUNBEE/YUNBEE01.log
log file path: /dm8/data/YUNBEE/YUNBEE02.log
write to dir [/dm8/data/YUNBEE].
create dm database success. 2024-09-08 10:53:12
8.注册数据库服务
8.1 创建服务(#root用户操作)
root@DMDCA01 root]# cd /dm8/script/root
root@DMDCA01 root]# ./dm_service_installer.sh -h
root@DMDCA01 root]# cd /dm8/script/root
[root@DMDCA01 root]# ./dm_service_installer.sh -t DMSERVER -p YUNBEE -dm_ini /dm8/data/YUNBEE/dm.ini
Created symlink /etc/systemd/system/multi-user.target.wants/DmServiceYUNBEE.service → /usr/lib/systemd/system/DmServiceYUNBEE.service.
创建服务(DmServiceYUNBEE)完成
8.2启动服务(#开机自启动)
[root@DMDCA01 root]# systemctl start DmServiceYUNBEE.service
8.3 查看服务
[root@DMDCA01 root]# systemctl -h
[root@DMDCA01 root]# systemctl status DmServiceyunbee.service
[root@DMDCA01 root]# systemctl list-unit-files --type=service
[root@DMDCA01 root]# systemctl list-unit-files --type=service |grep -i Dmservice
DmServiceYUNBEE.service enabled
9.连接数据库
[dmdba@localhost bin]$ ./disql sysdba/SYSDBA:5236
服务器[LOCALHOST:5236]:处于普通打开状态
登录使用时间 : 2.701(ms)
disql V8
SQL> select name from v$database;
行号 NAME
---------- ------
1 YUNBEE
已用时间: 0.551(毫秒). 执行号:60501.
文章
阅读量
获赞