###(一)安装前准备
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost100 ~]# cd /opt/
[root@localhost opt]# ll
total 1069596
-rw-r--r--. 1 root root 1095266304 Jun 13 21:48 dm8_20230418_x86_rh6_64.iso
drwxr-xr-x. 2 root root 6 Oct 30 2018 rh
[root@localhost opt]#
[root@localhost opt]# ll
total 1069596
-rw-r--r--. 1 root root 1095266304 Jun 13 21:48 dm8_20230418_x86_rh6_64.iso
drwxr-xr-x. 2 root root 6 Oct 30 2018 rh
[root@localhost opt]# mkdir dm
[root@localhost opt]# ll
total 1069596
drwxr-xr-x. 2 root root 6 Jun 13 22:14 dm
-rw-r--r--. 1 root root 1095266304 Jun 13 21:48 dm8_20230418_x86_rh6_64.iso
drwxr-xr-x. 2 root root 6 Oct 30 2018 rh
[root@localhost opt]# mount dm8_20230418_x86_rh6_64.iso dm
mount: /dev/loop0 is write-protected, mounting read-only
[root@localhost opt]# cd dm/
[root@localhost dm]# ll
total 1069534
-r-xr-xr-x. 1 root root 2909114 Apr 17 22:20 DM8 Install.pdf
-r-xr-xr-x. 1 root root 1092293558 Apr 17 22:23 DMInstall.bin
mount: /dev/loop0 写保护,将以只读方式挂载
[root@localhost100 ~]# groupadd dinstall
创建用户
[root@localhost100 ~]# useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
-g, --gid GROUP 新账户主组的名称或 ID
-m, --create-home 创建用户的主目录
-d, --home-dir HOME_DIR 新账户的主目录
-s, --shell SHELL 新账户的登录 shell
或者
[root@localhost dm]# cd /home/
[root@localhost home]# ll
total 0
drwx------. 3 admin admin 78 Jun 13 00:13 admin
[root@localhost home]# groupadd dinstall
[root@localhost home]# useradd dmdba -g dinstall
[root@localhost home]# ll
total 0
drwx------. 3 admin admin 78 Jun 13 00:13 admin
drwx------. 3 dmdba dinstall 78 Jun 13 22:18 dmdba
[root@localhost100 ~]# passwd dmdba
更改用户 dmdba 的密码 。
新的 密码:123456
无效的密码: 密码少于 8 个字符
重新输入新的 密码:123456
passwd:所有的身份验证令牌已经成功更新。
su - dmdba
将root 的 环境变量复制到dmdba用户
将DM安装文件复制到dmdba目录下
解除挂载
[root@localhost opt]# umount dm/
[root@localhost opt]# cd dm/
[root@localhost dm]# ll
total 0
[root@localhost dm]# cd ..
[root@localhost opt]# ll
total 1069596
drwxr-xr-x. 2 root root 6 Jun 13 22:05 dm
-rw-r--r--. 1 root root 1095266304 Jun 13 21:48 dm8_20230418_x86_rh6_64.iso
drwxr-xr-x. 2 root root 6 Oct 30 2018 rh
[root@localhost ~]# cd /home/dmdba/
[root@localhost dmdba]# ll
total 1066696
-r-xr-xr-x. 1 root root 1092293558 Jun 13 22:21 DMInstall.bin
[root@localhost dmdba]# chown -R dmdba:dinstall DMInstall.bin
[root@localhost dmdba]# ll
total 1066696
-r-xr-xr-x. 1 dmdba dinstall 1092293558 Jun 13 22:21 DMInstall.bin
[root@localhost dmdba]# chmod 755 DMInstall.bin
[root@localhost dmdba]# ll
total 1066696
-rwxr-xr-x. 1 dmdba dinstall 1092293558 Jun 13 22:21 DMInstall.bin
vi /etc/security/limits.conf
dmdba soft core unlimited
dmdba hard core unlimited
dmdba soft nofile 102400
dmdba hard nofile 102400
dmdba soft nproc 102400
dmdba hard nproc 102400
dmdba soft stack 102400
dmdba hard stack 102400
切换 dmdba 用户
切换至 dmdba 用户下,在目录下使用命令行安装数据库程序
root@localhost100 DM]# su dmdba
执行安装命令
[dmdba@localhost100 DM]$ ./DMInstall.bin -i
选择安装程序的语言 c/C 为中文,e/E 为英文。
提示是否安装 key 文件,输入 N 跳过。
选择时区,21 即东 8 区。
选择安装类型,默认典型安装(包含所有内容)
3.安装完成后
切换 root 用户
执行上图中的命令,会自动创建 DmAPService,否则会影响数据库备份。
[dmdba@localhost ~]$ su root
Password:
[root@localhost dmdba]# /home/dmdba/dmdbms/script/root/root_installer.sh
移动 /home/dmdba/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)完成
二、主库
./dminit PATH=/home/dmdba/dmdbms/data page_size=32 extent_size=32 LOG_SIZE=2048 CHARSET=0 CASE_SENSITIVE=Y LENGTH_IN_CHAR=Y
[dmdba@localhost bin]$ su root
Password:
[root@localhost bin]# cd /home/dmdba/dmdbms/script/root/
[root@localhost root]# ll
total 44
-rwxr-xr-x. 1 dmdba dinstall 25373 Jun 14 00:44 dm_service_installer.sh
-rwxr-xr-x. 1 dmdba dinstall 9179 Jun 14 00:44 dm_service_uninstaller.sh
-rwxr-xr-x. 1 dmdba dinstall 490 Jun 14 00:44 root_installer.sh
注册服务命令:
[root@localhost root]# ./dm_service_installer.sh -t dmserver -p DMSERVER -dm_ini /home/dmdba/dmdbms/data/DAMENG/dm.ini -auto true
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDMSERVER.service to /usr/lib/systemd/system/DmServiceDMSERVER.service.
创建服务(DmServiceDMSERVER)完成
卸载服务:
[root@localhost root]# ./dm_service_uninstaller.sh -n DmServiceDMSERVER
是否删除服务(DmServiceDMSERVER)?(Y/y:是 N/n:否): y
Removed symlink /etc/systemd/system/multi-user.target.wants/DmServiceDMSERVER.service.
删除服务文件(/usr/lib/systemd/system/DmServiceDMSERVER.service)完成
删除服务(DmServiceDMSERVER)完成
查看帮助文档命令:
./dm_service_installer.sh -h
启动数据库
开启归档
SQL> ALTER DATABASE MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE ADD ARCHIVELOG 'DEST=/home/dmdba/dmdbms/data/DAMENG/arch, TYPE=LOCAL, FILE_SIZE=1024, SPACE_LIMIT=51200';
SQL> ALTER DATABASE OPEN;
[dmdba@localhost bin]$ ./disql SYSDBA/[email protected]:5236
服务器[192.168.113.130:5236]:处于普通打开状态
登录使用时间 : 10.903(ms)
disql V8
SQL> ALTER DATABASE MOUNT;
操作已执行
已用时间: 19.744(毫秒). 执行号:0.
SQL> ALTER DATABASE ARCHIVELOG;
操作已执行
已用时间: 15.715(毫秒). 执行号:0.
SQL> ALTER DATABASE ADD ARCHIVELOG 'DEST=/home/dmdba/dmdbms/data/DAMENG/arch, TYPE=LOCAL, FILE_SIZE=1024, SPACE_LIMIT=51200';
操作已执行
已用时间: 8.725(毫秒). 执行号:0.
SQL> ALTER DATABASE OPEN;
操作已执行
已用时间: 17.144(毫秒). 执行号:0.
SQL> BACKUP DATABASE BACKUPSET '/home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE';
SQL> SP_SET_PARA_VALUE (2,'PORT_NUM',5236);
SQL> SP_SET_PARA_VALUE (2,'DW_INACTIVE_INTERVAL',60);
SQL> SP_SET_PARA_VALUE (2,'ALTER_MODE_STATUS',0);
SQL> SP_SET_PARA_VALUE (2,'ENABLE_OFFLINE_TS',2);
SQL> SP_SET_PARA_VALUE (2,'MAL_INI',1);
SQL> SP_SET_PARA_VALUE (2,'RLOG_SEND_APPLY_MON',64);
INSTANCE_NAME = GRP1_RWW_02
PORT_NUM = 5236 #数据库实例监听端口
DW_INACTIVE_INTERVAL = 60 #接收守护进程消息超时时间
ALTER_MODE_STATUS = 0 #不允许手工方式修改实例模式/状态/OGUID
ENABLE_OFFLINE_TS = 2 #不允许备库 OFFLINE 表空间
MAL_INI = 1 #打开 MAL 系统
ARCH_INI = 1 #打开归档配置
RLOG_SEND_APPLY_MON = 64 #统计最近 64 次的日志重演信息
ARCH_WAIT_APPLY = 0
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /home/dmdba/dmdbms/data/DAMENG/arch
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 51200
ARCH_FLUSH_BUF_SIZE = 0
ARCH_HANG_FLAG = 1
[ARCHIVE_TIMELY1]
ARCH_TYPE = TIMELY #即时归档类型
ARCH_DEST = GRP1_RWW_02 #即时归档目标实例名
[ARCHIVE_TIMELY2]
ARCH_TYPE = TIMELY #即时归档类型
ARCH_DEST = GRP1_RWW_03 #即时归档目标实例名
L_CHECK_INTERVAL = 10 #MAL 链路检测时间间隔
MAL_CONN_FAIL_INTERVAL = 10 #判定 MAL 链路断开的时间
MAL_TEMP_PATH = /opt/dmdbms/data/malpath/ #临时文件目录
MAL_BUF_SIZE = 512 #单个 MAL 缓存大小,单位 MB
L_CHECK_INTERVAL = 10 #MAL 链路检测时间间隔
MAL_CONN_FAIL_INTERVAL = 10 #判定 MAL 链路断开的时间
MAL_SYS_BUF_SIZE = 2048 #MAL 总大小限制,单位 MB
MAL_COMPRESS_LEVEL = 0 #MAL 消息压缩等级,0 表示不压缩
[MAL_INST1]
MAL_INST_NAME = GRP1_RWW_01 #实例名,和 dm.ini 的 INSTANCE_NAME 一致
MAL_HOST = 192.168.113.128 #MAL 系统监听 TCP 连接的 IP 地址
MAL_PORT = 5336 #MAL 系统监听 TCP 连接的端口
MAL_INST_HOST = 192.168.113.128 #实例的对外服务 IP 地址
MAL_INST_PORT = 5236 #实例对外服务端口,和 dm.ini 的 PORT_NUM 一致
MAL_DW_PORT = 5436 #实例对应的守护进程监听 TCP 连接的端口
MAL_INST_DW_PORT = 5536 #实例监听守护进程 TCP 连接的端口
[MAL_INST2]
MAL_INST_NAME = GRP1_RWW_02
MAL_HOST = 192.168.113.130
MAL_PORT = 5336
MAL_INST_HOST = 192.168.113.130
MAL_INST_PORT = 5236
MAL_DW_PORT = 5436
MAL_INST_DW_PORT = 5536
[MAL_INST3]
MAL_INST_NAME = GRP1_RWW_03
MAL_HOST = 192.168.113.131
MAL_PORT = 5336
MAL_INST_HOST = 192.168.113.131
MAL_INST_PORT = 5236
MAL_DW_PORT = 5436
MAL_INST_DW_PORT = 5536
[GRP1]
DW_TYPE = GLOBAL #全局守护类型
DW_MODE = MANUAL #MANUAL:故障手切 AUTO:故障自切
DW_ERROR_TIME = 20 #远程守护进程故障认定时间
INST_ERROR_TIME = 20 #本地实例故障认定时间
INST_RECOVER_TIME = 60 #主库守护进程启动恢复的间隔时间
INST_OGUID = 45331 #守护系统唯一 OGUID 值
INST_INI = /home/dmdba/dmdbms/data/DAMENG/dm.ini #dm.ini 文件路径
INST_AUTO_RESTART = 1 #打开实例的自动启动功能
INST_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver #命令行方式启动
RLOG_SEND_THRESHOLD = 0 #指定主库发送日志到备库的时间阈值,默认关闭
RLOG_APPLY_THRESHOLD = 0 #指定备库重演日志的时间阈值,默认关闭
拷贝备份文件到备库
8. [dmdba@~]$ scp -r /home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE [email protected]:/home/dmdba/dmdbms/data/DAMENG/bak
[root@localhost DAMENG]# scp -r /home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE [email protected]:/home/dmdba/dmdbms/data/DAMENG/bak
The authenticity of host '192.168.113.130 (192.168.113.130)' can't be established.
ECDSA key fingerprint is SHA256:WKnHCP+cvAahhVM4zsPnBxoowL1gz30ZRxtm+IWz8fA.
ECDSA key fingerprint is MD5:a1:0d:36:3d:ca:52:94:74:01:96:3e:1f:03:c3:94:1e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.113.130' (ECDSA) to the list of known hosts.
[email protected]'s password:
BACKUP_FILE.bak 100% 22MB 9.4MB/s 00:02
BACKUP_FILE_1.bak 100% 35KB 4.8MB/s 00:00
BACKUP_FILE.meta
[root@localhost DAMENG]# scp -r /home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE [email protected]:/home/dmdba/dmdbms/data/DAMENG/bak
[email protected]'s password:
BACKUP_FILE.bak 100% 22MB 22.4MB/s 00:01
BACKUP_FILE_1.bak 100% 35KB 5.3MB/s 00:00
BACKUP_FILE.meta
注册服务
用root用户
[root@localhost root]# cd /home/dmdba/dmdbms/script/root
[root@localhost root]# ll
total 44
-rwxr-xr-x. 1 dmdba dinstall 25373 Jun 14 02:00 dm_service_installer.sh
-rwxr-xr-x. 1 dmdba dinstall 9179 Jun 14 02:00 dm_service_uninstaller.sh
-rwxr-xr-x. 1 dmdba dinstall 490 Jun 14 02:00 root_installer.sh
[root@localhost root]# ./dm_service_installer.sh -t dmserver -p GRP1_RWW_01 -dm_ini /home/dmdba/dmdbms/data/DAMENG/dm.ini -m mount
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceGRP1_RWW_01.service to /usr/lib/systemd/system/DmServiceGRP1_RWW_01.service.
创建服务(DmServiceGRP1_RWW_01)完成
[root@localhost root]# ./dm_service_installer.sh -t dmwatcher -p GRP1_RWW_01 -watcher_ini /home/dmdba/dmdbms/data/DAMENG/dmwatcher.ini
Created symlink from /etc/systemd/system/multi-user.target.wants/DmWatcherServiceGRP1_RWW_01.service to /usr/lib/systemd/system/DmWatcherServiceGRP1_RWW_01.service.
创建服务(DmWatcherServiceGRP1_RWW_01)完成
1. [dmdba@~]$ ./dmrman CTLSTMT="RESTORE DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' FROM BACKUPSET '/home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE'"
[dmdba@~]$ ./dmrman CTLSTMT="RECOVER DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' FROM BACKUPSET '/home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE'"
[dmdba@~]$ ./dmrman CTLSTMT="RECOVER DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' UPDATE DB_MAGIC"
[dmdba@localhost bin]$ ./dmrman CTLSTMT="RESTORE DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' FROM BACKUPSET '/home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE'"
dmrman V8
RESTORE DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' FROM BACKUPSET '/home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE'
file dm.key not found, use default license!
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
[Percent:100.00%][Speed:0.00M/s][Cost:00:00:03][Remaining:00:00:00]
restore successfully.
time used: 00:00:03.475
[dmdba@localhost bin]$ ./dmrman CTLSTMT="RECOVER DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' FROM BACKUPSET '/home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE'"
dmrman V8
RECOVER DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' FROM BACKUPSET '/home/dmdba/dmdbms/data/DAMENG/bak/BACKUP_FILE'
file dm.key not found, use default license!
Database mode = 2, oguid = 0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]'s cur_lsn[37913], file_lsn[37913]
[Percent:100.00%][Speed:0.00PKG/s][Cost:00:00:00][Remaining:00:00:00]
recover successfully!
time used: 00:00:02.734
[dmdba@localhost bin]$ ./dmrman CTLSTMT="RECOVER DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' UPDATE DB_MAGIC"
dmrman V8
RECOVER DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' UPDATE DB_MAGIC
file dm.key not found, use default license!
Database mode = 2, oguid = 0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]'s cur_lsn[38121], file_lsn[38121]
recover successfully!
time used: 00:00:01.156
开启归档
SQL> ALTER DATABASE MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE ADD ARCHIVELOG 'DEST=/home/dmdba/dmdbms/data/DAMENG/arch, TYPE=LOCAL, FILE_SIZE=1024, SPACE_LIMIT=51200';
SQL> ALTER DATABASE OPEN;
#DaMeng Database Archive Configuration file
#this is comments
ARCH_WAIT_APPLY = 0
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /home/dmdba/dmdbms/data/DAMENG/arch
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 51200
ARCH_FLUSH_BUF_SIZE = 0
ARCH_HANG_FLAG = 1
[ARCHIVE_TIMELY1]
ARCH_TYPE = TIMELY #即时归档类型
ARCH_DEST = GRP1_RWW_01 #即时归档目标实例名
[ARCHIVE_TIMELY2]
ARCH_TYPE = TIMELY #即时归档类型
ARCH_DEST = GRP1_RWW_03 #即时归档目标实例名
配置 dm.ini
在 B 机器上配置备库的实例名为 GRP1_RWW_02,dm.ini 参数修改如下:
INSTANCE_NAME = GRP1_RWW_02
PORT_NUM = 5236 #数据库实例监听端口
DW_INACTIVE_INTERVAL = 60 #接收守护进程消息超时时间
ALTER_MODE_STATUS = 0 #不允许手工方式修改实例模式/状态/OGUID
ENABLE_OFFLINE_TS = 2 #不允许备库 OFFLINE 表空间
MAL_INI = 1 #打开 MAL 系统
ARCH_INI = 1 #打开归档配置
RLOG_SEND_APPLY_MON = 64 #统计最近 64 次的日志重演信息
B 机器里 dmmal.ini、dmwatcher.ini 与 A 机器 GRP1_RWW_01 的 dmmal.ini、dmwatcher.ini 相同,参照 A 机器 dmmal.ini、dmwatcher.ini 文件进行配置。
切换root用户
./dm_service_installer.sh -t dmserver -p GRP1_RWW_02 -dm_ini /home/dmdba/dmdbms/data/DAMENG/dm.ini -m mount
./dm_service_installer.sh -t dmwatcher -p GRP1_RWW_02 -watcher_ini /home/dmdba/dmdbms/data/DAMENG/dmwatcher.ini
[dmdba@localhost root]$ su root
Password:
[root@localhost root]# ./dm_service_installer.sh -t dmserver -p GRP1_RWW_02 -dm_ini /home/dmdba/dmdbms/data/DAMENG/dm.ini -m mount
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceGRP1_RWW_02.service to /usr/lib/systemd/system/DmServiceGRP1_RWW_02.service.
创建服务(DmServiceGRP1_RWW_02)完成
[root@localhost root]# ./dm_service_installer.sh -t dmwatcher -p GRP1_RWW_02 -watcher_ini /home/dmdba/dmdbms/data/DAMENG/dmwatcher.ini
Created symlink from /etc/systemd/system/multi-user.target.wants/DmWatcherServiceGRP1_RWW_02.service to /usr/lib/systemd/system/DmWatcherServiceGRP1_RWW_02.service.
创建服务(DmWatcherServiceGRP1_RWW_02)完成
[root@localhost root]#
1.安装数据库,把此两个文件放在 bin 下
2.配置监视器(配置业务 IP)
(1)配置 dmmonitor_auto(放在 bin 下即可)确认监视器
MON_DW_CONFIRM = 1 #0:非确认(故障手切) 1:确认(故障自切)
MON_LOG_PATH = ../log #监视器日志文件存放路径
MON_LOG_INTERVAL = 60 #每隔 60s 定时记录系统信息到日志文件
MON_LOG_FILE_SIZE = 512 #单个日志大小,单位 MB
MON_LOG_SPACE_LIMIT = 2048 #日志上限,单位 MB
[GRP1]
MON_INST_OGUID = 45331 #组 GRP1 的唯一 OGUID 值
MON_DW_IP = 192.168.113.128:5436 #IP 对应 MAL_HOST,PORT 对应 MAL_DW_PORT
MON_DW_IP = 192.168.113.130:5436
MON_DW_IP = 192.168.113.131:5436
(2)配置 dmmonitor_manual(放在 bin 下即可)普通监视器
MON_DW_CONFIRM = 0 #0:非确认(故障手切) 1:确认(故障自切)
MON_LOG_PATH = ../log #监视器日志文件存放路径
MON_LOG_INTERVAL = 60 #每隔 60s 定时记录系统信息到日志文件
MON_LOG_FILE_SIZE = 512 #单个日志大小,单位 MB
MON_LOG_SPACE_LIMIT = 2048 #日志上限,单位 MB
[GRP1]
MON_INST_OGUID = 45331 #组 GRP1 的唯一 OGUID 值
MON_DW_IP = 192.168.113.128:5436 #IP 对应 MAL_HOST,PORT 对应 MAL_DW_PORT
MON_DW_IP = 192.168.113.130:5436
MON_DW_IP = 192.168.113.131:5436
3.注册监视器守护服务(下面为一行)
[root@~]#./dm_service_installer.sh -t dmmonitor -p Monitor -monitor_ini /home/dmdba/dmdbms/bin/dmmonitor.ini
/home/dmdba/dmdbms/bin/dmmonitor_auto.ini
搭建完成
四、启动数据库方式(备注:输入前三字母 Tab 补齐)
1.在数据库服务器分别:
起主服务 ./DmS (tab 补全) start, 备 ./DmS (tab 补全) start,主 ./DmW (tab 补全) start,备 ./DmW (tab 补全) start
即:先启动主库实例服务,然后启动备库实例服务;再启动主库守护进程,然后启动备库守护服务
或者:
启动数据守护服务
先主./DmW (tab 补全) start,./DmWatcherServiceGRP1_RWW_01 restart
再备./DmW (tab 补全) start,./DmWatcherServiceGRP1_RWW_02 restart
等待守护服务自动拉起实例服务,查询实例服务是否启动 (约1分钟)
ps -eflgrep dmserver
2.在监视器服务器:起确认监视器 ./DmM (tab 补全) start./DmMonitorServiceRWW start
3.查看状态,通过普通监视器(路径为 dmmonitor_manual.ini 的路径)
./dmmonitor /路径/bin/dmmonitor_manual.ini
例如:
./dmmonitor /home/dmdba/dmdbms/data/TEST/dmmonitor_manual.ini
五、停数据库方式(备注:输入前三字母 Tab 补齐)
先停确认监视器,再停备库守护,再停备库实例服务,最后再停主库守护,再停主库实例服务
关闭确认监视器:./DmMonitorServiceRWW stop
关闭备库守护服务:/DmWatcherServiceGRP1_RWW_03 stop
关闭备库实例服务:/DmServiceGRP1_RWW_03 stop
备库关闭完之后关闭主库守护服务和实例服务
end
之前备份还原命令:
./dmrman CTLSTMT="BACKUP DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' FULL TO BACKUP_FILE1 BACKUPSET '/home/dmdba/dmdbms/data/BACKUP_FILE_01' COMPRESSED"
./dmrman CTLSTMT="RESTORE DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' FROM BACKUPSET '/home/dmdba/dmdbms/data/BACKUP_FILE_01'"
./dmrman CTLSTMT="RECOVER DATABASE '/home/dmdba/dmdbms/data/DAMENG/dm.ini' UPDATE DB_MAGIC"