04.DM7环境部署搭建

目录

1、Linux环境准备... 1

1.1. 虚拟主机环境规划... 1

1.2. Linux主机安装后的磁盘存储配置... 1

1.3 dmdba用户创建及环境变量... 2

2、DM7数据库安装及服务创建... 3

2.1 install 3

2.2 create instance. 3

2.3 check. 3

1、Linux环境准备

1.1. 虚拟主机环境规划

OS: rhel-server-6.5-x86_64,

主机名:dameng

内存:4G

核心数:2核

硬盘:100G * 5 (OS, dmdbms, dmdata, dmarch, dmback)

IP: 192.168.6.11

1.2. Linux主机安装后的磁盘存储配置

硬盘:100G * 5 (OS, dmdbms, dmdata, dmarch, dmback)

【LVM】

[root@dameng ~]# fdisk -l | grep "/dev/sd"

Disk /dev/sda: 107.4 GB, 107374182400 bytes

/dev/sda1   *           1       12010    96467968   83  Linux

/dev/sda2           12010       13055     8388608   82  Linux swap / Solaris

Disk /dev/sdb: 107.4 GB, 107374182400 bytes

Disk /dev/sdc: 107.4 GB, 107374182400 bytes

Disk /dev/sdd: 107.4 GB, 107374182400 bytes

Disk /dev/sde: 107.4 GB, 107374182400 bytes

pvcreate /dev/sdb /dev/sdc /dev/sdd /dev/sde

vgcreate dmappvg /dev/sdb

vgcreate dmdatavg /dev/sdc

vgcreate dmlogvg /dev/sdd

vgcreate dmbakvg /dev/sde

lvcreate -n dmapplv -L 99G dmappvg

lvcreate -n dmdatalv -L 99G dmdatavg

lvcreate -n dmloglv -L 99G dmlogvg

lvcreate -n dmbaklv -L 99G dmbakvg

pvs

vgs

mkfs.ext4 /dev/dmappvg/dmapplv

mkfs.ext4 /dev/dmdatavg/dmdatalv

mkfs.ext4 /dev/dmlogvg/dmloglv

mkfs.ext4 /dev/dmbakvg/dmbaklv

mkdir -p /dm/dmdbms

mkdir -p /dm/dmdata

mkdir -p /dm/dmarch

mkdir -p /dm/dmback

mount /dev/dmappvg/dmapplv /dm/dmdbms

mount /dev/dmdatavg/dmdatalv /dm/dmdata

mount /dev/dmlogvg/dmloglv /dm/dmarch

mount /dev/dmbakvg/dmbaklv /dm/dmback

df -h

vi /etc/fstab                         //设置开机启动生效

/dev/dmappvg/dmapplv   /dm/dmdbms  ext4 defaults 0 0

/dev/dmdatavg/dmdatalv /dm/dmdata  ext4 defaults 0 0

/dev/dmlogvg/dmloglv   /dm/dmarch  ext4 defaults 0 0

/dev/dmbakvg/dmbaklv   /dm/dmback  ext4 defaults 0 0

1.3 dmdba用户创建及环境变量

创建用户

groupadd -g 66000 dinstall

useradd -u 66000 -g dinstall -m -d /home/dmdba -s /bin/bash dmdba

echo "dameng" |passwd  --stdin dmdba

mkdir /dm/dmdbms/dm7

chown -R dmdba:dinstall /dm

chmod -R 775 /dm

配置环境变量

su - dmdba

vi ~/.bash_profile

//添加

export LANG=zh_CN.UTF8

export DM_INSTALL_TMPDIR=/tmp

export DM_HOME=/dm/dmdbms/dm7

export PATH=$DM_HOME/bin:$PATH:$HOME/bin

2、DM7数据库安装及服务创建

2.1 install

dmdba:

cd /mnt

./DMInstall.bin -i

2.2 create instance

dmdba:

cd /dm/dmdbms/dm7/bin

./dminit path=/dm/dmdata db_name=dmsevdb instance_name=dmsevdb port_num=5236 LOG_SIZE=256 SYSDBA_PWD=dameng0809 EXTENT_SIZE=16 PAGE_SIZE=8

root:

cd /dm/dmdbms/dm7/script/root

./dm_service_installer.sh -t dmserver -p dmsevdb -i /dm/dmdata/dmsevdb/dm.ini

[root@dameng root]# /etc/rc.d/init.d/DmServicedmsevdb start

or:

[sysdba@dameng ~]$ service DmServicedmsevdb start

//uninstall

./dm_service_uninstaller.sh -n DmServicedmsevdb

rm -rf /dm/dmdata/dmsevdb/

2.3 check

[dmdba@dameng bin]$ disql

sysdba

dameng0809

SQL> select path from v$datafile;

行号     PATH                        

---------- -----------------------------

1          /dm/dmdata/dmsevdb/SYSTEM.DBF

2          /dm/dmdata/dmsevdb/ROLL.DBF

3          /dm/dmdata/dmsevdb/TEMP.DBF

4          /dm/dmdata/dmsevdb/MAIN.DBF

SQL> select status$ from v$database;

行号     STATUS$   

---------- -----------

1          4

SQL> select * from v$version;

行号     BANNER                                                       

---------- --------------------------------------------------------------

1          DM Database Server x64 V7.6.1.92-Build(2021.03.05-136011)ENT 

2          DB Version: 0x7000a

SQL> select name,status$ from v$database;

行号     NAME    STATUS$   

---------- ------- -----------

1          dmsevdb 4

SQL>

更多达梦数据库解决方案,可访问如下地址:

 http://eco.dameng.com

上一篇:centos7部署DM8


下一篇:达梦创建实例