本文描述的环境如下:
操作系统:Kylin Linux Advanced Server V10 (Sword)
数据库版本:DM Database Server 64 V8
[dmdba@dmnode1 bin]$ cd /dm8/bin
[dmdba@dmnode1 bin]$ ./DmServiceDMSERVER stop
Stopping DmServiceDMSERVER: [ OK ]
[dmdba@dmnode1 bin]$ ./dmrman
dmrman V8
RMAN>backup database '/dm8/data/DAMENG/dm.ini' backupset '/dm8/bak';
[dmdba@dmnode1 bin]$ cd /dm8/bak
[dmdba@dmnode1 bak]$ ls
bak.bak bak.meta
[dmdba@dmnode1 bak]$ scp bak.* dmdba@192.168.183.102:/dm8/bak
[dmdba@dmnode1 DAMENG]$ pwd
/dm8/data/DAMENG
[dmdba@dmnode1 DAMENG]$ cat dmmal.ini
MAL_CHECK_INTERVAL= 5
MAL_CONN_FAIL_INTERVAL = 5
[MAL_INST1]
MAL_INST_NAME =DMSERVER
MAL_HOST = 192.168.183.101
MAL_PORT = 15236
MAL_INST_HOST = 192.168.183.101
MAL_INST_PORT = 5236
MAL_DW_PORT = 65101
MAL_INST_DW_PORT = 45101
[MAL_INST2]
MAL_INST_NAME = DMSERVER2
MAL_HOST = 192.168.183.102
MAL_PORT = 15236
MAL_INST_HOST = 192.168.183.102
MAL_INST_PORT = 5236
MAL_DW_PORT = 65101
MAL_INST_DW_PORT =45101
[dmdba@dmnode1 DAMENG]$ cat dmarch.ini
#DaMeng Database Archive Configuration file
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME
ARCH_DEST = DMSERVER2
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm8/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 0
[dmdba@dmnode1 DAMENG]$ cat dmwatcher.ini
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = AUTO
DW_ERROR_TIME = 10
INST_RECOVER_TIME = 60
INST_ERROR_TIME = 10
INST_OGUID = 8888
INST_INI = /dm8/data/DAMENG/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /dm8/bin/dmserver
RLOG_SEND_THRESHOLD = 0
RLOG_APPLY_THRESHOLD = 0
MAL_INI = 1
ARCH_INI = 1
ALTER_MODE_STATUS= 0
ENABLE_OFFLINE_TS= 2
[dmdba@dmnode1 DAMENG]$ cd /dm8/bin
[dmdba@dmnode1 bin]$ ./dmserver /dm8/data/DAMENG/dm.ini mount
[dmdba@dmnode2 bin]$ ./dminit db_name=DAMENG instance_name=DMSERVER2 path=/dm8/data SYSDBA_PWD=Dameng123 SYSAUDITOR_PWD=Dameng123
[dmdba@dmnode2 bin]$ ./dmrman
dmrman V8
RMAN> restore database '/dm8/data/DAMENG/dm.ini' from backupset '/dm8/bak';
RMAN> recover database '/dm8/data/DAMENG/dm.ini' from backupset '/dm8/bak';
RMAN> recover database '/dm8/data/DAMENG/dm.ini' update db_magic;
[dmdba@dmnode2 DAMENG]$ pwd
/dm8/data/DAMENG
[dmdba@dmnode2 DAMENG]$ cat dmmal.ini
MAL_CHECK_INTERVAL= 5
MAL_CONN_FAIL_INTERVAL = 5
[MAL_INST1]
MAL_INST_NAME =DMSERVER
MAL_HOST = 192.168.183.101
MAL_PORT = 15236
MAL_INST_HOST = 192.168.183.101
MAL_INST_PORT = 5236
MAL_DW_PORT = 65101
MAL_INST_DW_PORT = 45101
[MAL_INST2]
MAL_INST_NAME = DMSERVER2
MAL_HOST = 192.168.183.102
MAL_PORT = 15236
MAL_INST_HOST = 192.168.183.102
MAL_INST_PORT = 5236
MAL_DW_PORT = 65101
MAL_INST_DW_PORT =45101
[dmdba@dmnode2 DAMENG]$ cat dmarch.ini
#DaMeng Database Archive Configuration file
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME
ARCH_DEST = DMSERVER
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dm8/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 0
[dmdba@dmnode2 DAMENG]$ cat dmwatcher.ini
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = AUTO
DW_ERROR_TIME = 10
INST_RECOVER_TIME = 60
INST_ERROR_TIME = 10
INST_OGUID = 8888
INST_INI = /dm8/data/DAMENG/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /dm8/bin/dmserver
RLOG_SEND_THRESHOLD = 0
RLOG_APPLY_THRESHOLD = 0
MAL_INI = 1
ARCH_INI = 1
ALTER_MODE_STATUS= 0
ENABLE_OFFLINE_TS= 2
[dmdba@dmnode2 DAMENG]$ cd /dm8/bin
[dmdba@dmnode2 bin]$ ./dmserver /dm8/data/DAMENG/dm.ini mount
[dmdba@dmnode1 bin]$ ./disql sysdba/Dameng123
SQL> sp_set_oguid(8888);
SQL> alter database primary;
[dmdba@dmnode2 bin]$ ./disql sysdba/Dameng123
SQL> sp_set_oguid(8888);
SQL> alter database standby;
[dmdba@dmnode1 bin]$ ./dmwatcher /dm8/data/DAMENG/dmwatcher.ini
[dmdba@dmnode2 bin]$ ./dmwatcher /dm8/data/DAMENG/dmwatcher.ini
[dmdba@dmmonitor data]$ pwd
/dm8/data
[dmdba@dmmonitor data]$ cat dmmonitor.ini
MON_DW_CONFIRM = 0
MON_LOG_PATH = /dm8/data/log
MON_LOG_INTERVAL = 60
MON_LOG_FILE_SIZE = 32
MON_LOG_SPACE_LIMIT = 0
[GRP1]
MON_INST_OGUID= 8888
MON_DW_IP = 192.168.183.101:65101
MON_DW_IP = 192.168.183.102:65101
[dmdba@dmmonitor data]$ ./dmmonitor /dm8/data/dmmonitor.ini
login
用户名:sysdba
密码:
show
以root用户执行:
[root@dmnode2 ~]# cd /dm8/script/root/
[root@dmnode2 root]# ./dm_service_installer.sh -t dmserver -p DMSERVER2 -dm_ini /dm8/data/DAMENG/dm.ini
[root@dmnode1 ~]# cd /dm8/script/root/
[root@dmnode1 root]# ./dm_service_installer.sh -t dmwatcher -p DMSERVER -watcher_ini /dm8/data/DAMENG/dmwatcher.ini
[root@dmnode2 ~]# cd /dm8/script/root/
[root@dmnode2 root]# ./dm_service_installer.sh -t dmwatcher -p DMSERVER2 -watcher_ini /dm8/data/DAMENG/dmwatcher.ini
[root@dmmonitor ~]# cd /dm8/script/root/
[root@dmmonitor root]# ./dm_service_installer.sh -t dmmonitor -p MONITOR -monitor_ini /dm8/data/dmmonitor.ini
至此完成达梦数据守护集群的搭建!
文章
阅读量
获赞