linux系统dm数据库安装

dm数据库安装配置

在Linux操作系统上使用命令行方式安装达梦数据库。
[root@localhost ~]# vi /etc/sysctl.conf

sysctl settings are defined through files in

/usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.

Vendors settings live in /usr/lib/sysctl.d/.

To override a whole file, create a new file with the same in

/etc/sysctl.d/ and put new settings there. To override

only specific settings, add a file with a lexically later

name in /etc/sysctl.d/ and put new settings there.

For more information, see sysctl.conf(5) and sysctl.d(5).

vm.overcommit_memory=0

[root@localhost ~]# sysctl -p
vm.overcommit_memory = 0
[root@localhost ~]# ulimit -n65536
[root@localhost ~]# vi /etc/security/limits.conf

  • soft nofile 65536
  • hard nofile 65536
  • soft nproc 10240
  • hard nproc 10240
  • soft stack 16384
  • hard stack 32768

[root@localhost ~]# vi /etc/systemd/system.conf
DefaultLimitNOFILE=65535
[root@localhost ~]# vi /etc/security/limits.d/90-nproc.conf

  •   soft  nproc  65536
    

[root@localhost ~]# vi /etc/sysconfig/selinux
SELINUX=disabled

[root@localhost ~]# useradd -g 2000 dmdba -b /bin/bash -m -d /home/dmdba
[root@localhost ~]# unzip dm8_20210712_x86_rh6_64_ent.zip

[root@localhost ~]# unzip dm8_20210712_x86_rh6_64_ent.zip

[root@localhost ~]# chown -R dmdba:dinstall dm8_20210712_x86_rh6_64_ent

[root@localhost dm8_20210712_x86_rh6_64_ent]# ls
dm8_20210712_x86_rh6_64_ent_8.1.2.38_pack1.iso dm8_20210712_x86_rh6_64_ent_8.1.2.38_pack1.iso_SHA256.txt

[root@localhost dm8_20210712_x86_rh6_64_ent]# mount -o loop dm8_20210712_x86_rh6_64_ent_8.1.2.38_pack1.iso /media
mount: /dev/loop0 is write-protected, mounting read-only

[root@localhost opt]# fdisk -l

Disk /dev/sda: 16.1 GB, 16106127360 bytes, 31457280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d0c78

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 31457279 14679040 8e Linux LVM

Disk /dev/sdb: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@localhost opt]# mkfs.ext4 /dev/sdb
mke2fs 1.42.9 (28-Dec-2013)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
262144 inodes, 1048576 blocks
52428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[root@localhost opt]# blkid /dev/sdb
/dev/sdb: UUID=“ea6f518e-81a0-49df-a41e-40210559c25c” TYPE=“ext4”

[root@localhost opt]# vi /etc/fstab

/etc/fstab

Created by anaconda on Wed Sep 29 22:20:28 2021

Accessible filesystems, by reference, are maintained under ‘/dev/disk’

See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

/dev/mapper/centos-root / xfs defaults 0 0
UUID=17ffd2c4-e98b-43a3-8d6f-55f47c15a2ef /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
UUID=ea6f518e-81a0-49df-a41e-40210559c25c /dmdata ext4 defaults 0 0

[root@localhost opt]# mount -a
[root@localhost opt]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 974M 0 974M 0% /dev
tmpfs 991M 12K 991M 1% /dev/shm
tmpfs 991M 11M 980M 2% /run
tmpfs 991M 0 991M 0% /sys/fs/cgroup
/dev/mapper/centos-root 13G 8.2G 4.4G 66% /
/dev/sda1 1014M 171M 843M 17% /boot
tmpfs 199M 60K 198M 1% /run/user/0
/dev/loop0 727M 727M 0 100% /media
/dev/sdb 3.9G 16M 3.6G 1% /dmdata

[root@localhost opt]# mkdir dmdbms
[root@localhost opt]# chown -R dmdba:dinstall /opt/dmdbms
[root@localhost opt]# chown -R dmdba:dinstall /dmdata

[root@localhost dm8_20210712_x86_rh6_64_ent]# su - dmdba
[dmdba@localhost ~]$ cd /media
[dmdba@localhost media]$ ls
DM8 Install.pdf DMInstall.bin

[dmdba@localhost media]$ ./DMInstall.bin -i
Please select the installer’s 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]:

安装类型:
1 典型安装
2 服务器
3 客户端
4 自定义
请选择安装类型的数字序号 [1 典型安装]:
所需空间: 1181M
请选择安装目录 [/home/dmdba/dmdbms]:/opt/dmdbms
可用空间: 4G
是否确认安装路径(/opt/dmdbms)? (Y/y:是 N/n:否) [Y/y]:y

安装前小结
安装位置: /opt/dmdbms
所需空间: 1181M
可用空间: 4G
版本信息:
有效日期:
安装类型: 典型安装
是否确认安装? (Y/y:是 N/n:否):y
2021-09-30 11:47:42
[INFO] 安装达梦数据库…
2021-09-30 11:47:42
[INFO] 安装 基础 模块…
2021-09-30 11:47:47
[INFO] 安装 服务器 模块…
2021-09-30 11:47:49
[INFO] 安装 客户端 模块…
2021-09-30 11:47:56
[INFO] 安装 驱动 模块…
2021-09-30 11:47:57
[INFO] 安装 手册 模块…
2021-09-30 11:47:57
[INFO] 安装 服务 模块…
2021-09-30 11:47:58
[INFO] 移动日志文件。
2021-09-30 11:47:59
[INFO] 安装达梦数据库完成。

请以root系统用户执行命令:
/opt/dmdbms/script/root/root_installer.sh

安装结束

用root用户执行脚本
[root@localhost opt]# /opt/dmdbms/script/root/root_installer.sh
移动 /opt/dmdbms/bin/dm_svc.conf 到/etc目录
修改服务器权限
创建DmAPService服务
Created symlink from /etc/systemd/system/multi-user.target.wants/DmAPService.service to /usr/lib/systemd/system/DmAPService.service.
创建服务(DmAPService)完成
启动DmAPService服务

数据库库初始化:

[dmdba@localhost bin]$ ./dminit path=/dmdata page_size=32 log_size=512 case_sensitive=y length_in_char=y extent_size=16
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2022-07-09
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL

log file path: /dmdata/DAMENG/DAMENG01.log

log file path: /dmdata/DAMENG/DAMENG02.log

write to dir [/dmdata/DAMENG].
create dm database success. 2021-09-30 13:35:53

创建实例

[root@localhost root]# ./dm_service_installer.sh -t dmserver -p DMSERVER -dm_ini /dmdata/DAMENG/dm.ini
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDMSERVER.service to /usr/lib/systemd/system/DmServiceDMSERVER.service.
创建服务(DmServiceDMSERVER)完成

启动实例
[dmdba@localhost bin]$ ./DmServiceDMSERVER start
Starting DmServiceDMSERVER: [ OK ]

链接数据库
[dmdba@localhost bin]$ ./disql sysdba/admin1234
[-2501]:用户名或密码错误.
disql V8
用户名:
密码:

服务器[LOCALHOST:5236]:处于普通打开状态
登录使用时间 : 2.771(ms)
SQL>

开启数据库归档:

SQL> alter database mount;
操作已执行
已用时间: 368.779(毫秒). 执行号:0.
SQL> alter database archivelog;
操作已执行
已用时间: 16.367(毫秒). 执行号:0.
SQL>
SQL> alter database add archivelog ‘DEST=/dmdata/DAMENG/archlog,type=local,file_size=512,space_limit=2048’;
操作已执行
已用时间: 13.109(毫秒). 执行号:0.
SQL> alter database open;
SQL> select arch_mode from v$database;

行号 ARCH_MODE


1 Y

已用时间: 2.244(毫秒). 执行号:53302.
SQL>

更多资讯请上达梦技术社区了解:https://eco.dameng.com

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值