目录
1、Linux环境准备
1.1. 虚拟主机环境规划
OS: rhel-server-6.5-x86_64,
主机名:dameng8
内存:4G
核心数:2核
硬盘:100G * 5 (OS, dmdbms, dmdata, dmarch, dmback)
IP: 192.168.6.12
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/dm8
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/dm8
export PATH=$DM_HOME/bin:$PATH:$HOME/bin
2、DM8数据库安装及服务创建
2.1 install
[root@dameng8 ~]# mount /dev/cdrom /mnt
su - dmdba
cd /mnt
./DMInstall.bin -i
2.2 create instance
dmdba:
cd /dm/dmdbms/dm8/bin
./dminit path=/dm/dmdata db_name=dmeigdb instance_name=dmeigdb port_num=5236 LOG_SIZE=256 SYSDBA_PWD=dameng0809 EXTENT_SIZE=16 PAGE_SIZE=8
root:
cd /dm/dmdbms/dm8/script/root
./dm_service_installer.sh -t dmserver -p dmeigdb -dm_ini /dm/dmdata/dmeigdb/dm.ini
[root@dameng8 root]# /etc/rc.d/init.d/DmServicedmeigdb start
or:
[dmdba@dameng8 ~]$ service DmServicedmeigdb start
/***********************************************/
这里dm_service_installer注册服务后,如果没有将相应服务移动到/etc/rc.d/init.d/下,那就还在安装目录的bin目录下边,此时在dmdba用户下直接执行“DmServicedmeigdb start”启动服务。
/***********************************************/
//uninstall
./dm_service_uninstaller.sh -n DmServicedmeigdb
rm -rf /dm/dmdata/dmeigdb/
2.3 check
[dmdba@dameng8 bin]$ disql
sysdba
dameng0809
SQL> select path from v$datafile;
行号 PATH
---------- -----------------------------
1 /dm/dmdata/dmeigdb/SYSTEM.DBF
2 /dm/dmdata/dmeigdb/ROLL.DBF
3 /dm/dmdata/dmeigdb/TEMP.DBF
4 /dm/dmdata/dmeigdb/MAIN.DBF
SQL> select status$ from v$database;
行号 STATUS$
---------- -----------
1 4
SQL> select * from v$version;
行号 BANNER
---------- -------------------------
1 DM Database Server 64 V8
2 DB Version: 0x7000c
SQL> select name,status$ from v$database;
行号 NAME STATUS$
---------- ------- -----------
1 dmeigdb 4
SQL>
更多达梦数据库解决方案,可访问如下地址: