1、达梦数据库官网下载DM7(Linux版本),官网地址:www.dameng.com
解压后之后的内容:
2、关闭firewalld防火墙和Selinux
#查看firwalld的状态
systemctl status firewalld
#停止firewalld
systemctl stop firewalld
#禁用firewalld
systemctl disable firewalld
#查看Selinux状态
getenforce
#关闭Selinux
vim /etc/selinux/config
SELINUX=disabled
3、修改操作系统参数
#查看操作系统参数限制,一般来说【open files】这个参数默认为1024
ulimit -a
#修改参数
vim /etc/security/limits.conf
将去掉soft和hard前面的#,将value改成65536,并wq保存
soft nofile 65536
hard nofile 65536
#重启服务器、立即生效配置
reboot
4、创建DM安装用户和安装用户组并初始化用户密码
#添加组和用户并修改密码
groupadd dinstall
useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
passwd dmdba
#规划存储dm数据库文件的目录,我放在/home/dm/目录下
mkdir -p /home/dm/dmdbms
mkdir -p /home/dm/dmarch
mkdir -p /home/dm/dmbak
chown -R dmdba:dinstall /home/dm/
chmod -R 775 /home/dm/
5、配置环境变量
#配置好环境变量
echo export PATH=$PATH:/home/dm/dmdbms/bin >> /etc/profile
source /etc/profile
6、安装
#安装包DMInstall.bin我放在home下面
cd /home
#赋权
chmod 777 DMInstall.bin
#安装
./DMInstall.bin -i
1)Please select the installer's language (E/e:English C/c:Chinese) [E/e]:
选择语言,默认使用英语安装,直接回车
2)Whether to input the path of Key File? (Y/y:Yes N/n:No) [Y/y]:N
验证Key文件:用户可以选择是否输入 Key 文件路径。不输入则进入下一步安装,输入 Key 文件路径,安装程序将显示 Key 文件的详细信息,如果是合法的 Key 文件且在有效期内,用户可以继续安装。
3)Whether to Set The TimeZone? (Y/y:Yes N/n:No) [Y/y]:y
Please Select the TimeZone [21]:21
选择21([21]: GTM+08=China)
4)Please Input the number of the Installation Type [1 Typical]:1
5)Please Input the install path [/opt/dmdbms]:/home/dm/dmdbms
6)Please Confirm the install path(/home/dm/dmdbms)? (Y/y:Yes N/n:No) [Y/y]:y
7)Pre-Installation Summary
Installation Location: /home/dm/dmdbms
Require Space: 963M
Available Space: 88G
Version Information:
Expire Date:
Installation Type: Typical
Confirm to Install? (Y/y:Yes N/n:No):y
8)等待安装完毕
7、创建DM数据库实例,这里直接用root装的
#跳到安装路径
cd /home/dm/dmdbms/bin
#安装,dminit支持很多参数,比如监听端口、字符集等等,具体自行百度
./dminit PATH=/home/dm/dmdbms/data DB_NAME=testdb INSTANCE_NAME=dmsrv
代表成功
8、创建数据库服务
#跳到安装脚本路径下
cd /home/dm/dmdbms/script/root
#创建,
./dm_service_installer.sh -t dmserver -i /home/dm/dmdbms/data/testdb/dm.ini -p dmsrv
代表成功
9、启动服务
service DmServicedmsrv start
10、验证是否成功
#查看监听状态
netstat -an |grep 5236
#查看进程
ps aux|grep dmserver
#启动:systemctl start DmServicedmsrv.service
或 service DmServicedmsrv start
或 DmServicedmsrv start //该方式依赖于环境变量配置
#关闭:systemctl stop DmServicedmsrv.service
或 service DmServicedmsrv stop
或 DmServicedmsrv stop //该方式依赖于环境变量配置
#状态:systemctl status DmServicedmsrv.service
或 service DmServicedmsrv status
或 DmServicedmsrv status //该方式依赖于环境变量配置
11、登录
#跳到disql
cd /home/dm/dmdbms/bin
#登录,密码默认是SYSDBA
disql SYSDBA/SYSDBA
#修改密码
ALTER USER "用户名“ IDNENTIFIED BY "密码";
注:如果disql命令未找到,请检查环境变量是否修改是否生效