主机类型 | 实例名 | 业务IP | 心跳IP | 数据库版本 | 操作系统 |
---|---|---|---|---|---|
主库 | DW_01 | 10.15.1.200 | 192.168.148.12 | 1-3-162-2024.07.03-234060-20108-ENT | CentOS X86_64 |
备库 | DW_02 | 10.15.1.201 | 192.168.148.13 | 1-3-162-2024.07.03-234060-20108-ENT | CentOS X86_64 |
监视器 | - | - | 192.168.148.14 | - | CentOS X86_64 |
|集群规划|DW_01(主库)| DW_02(备库)|
| - |-| - | -
|实例端口 |5236| 5236|
|MAL端口 |5336|5336 |
|MAL守护进程端口 |5436|5436 |
|守护进程端口 |5536| 5536|
|OGUID |45331|
|守护组|GDW1||
[dmdba@~]#/home/dmdba/dmdbms/bin/dminit PATH=/data/dmdata PAGE_SIZE=32 EXTENT_SIZE=32 LOG_SIZE=2048 INSTANCE_NAME=DW_01
启动数据库:
/home/dmdba/dmdbms/bin/dmserver /data/dmdata/DAMENG/dm.ini
修改参数:
ALTER DATABASE MOUNT;
SP_SET_PARA_VALUE (2,'DW_INACTIVE_INTERVAL',60);
SP_SET_PARA_VALUE (2,'RLOG_SEND_APPLY_MON',64);
SP_SET_PARA_VALUE (2,'ALTER_MODE_STATUS',0);
SP_SET_PARA_VALUE (2,'ENABLE_OFFLINE_TS',2);
SP_SET_PARA_VALUE (2,'MAL_INI',1);
SP_SET_PARA_VALUE (2,'ARCH_INI',1);
ALTER DATABASE OPEN;
然后关闭数据库:
shutdown immediate;
[dmdba@~]# vi /data/dmdata/DAMENG/dmarch.ini
[ARCHIVE_LOCAL]
ARCH_TYPE = LOCAL #本地归档类型
ARCH_DEST = /data/dmarch #本地归档存放路径
ARCH_FILE_SIZE = 1024 #单个归档大小,单位MB
ARCH_SPACE_LIMIT = 10240 #归档上限,单位MB
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME #实时归档类型
ARCH_DEST = DW_02 #实时归档目标实例名
[dmdba@~]# vi /data/dmdata/DAMENG/dmmal.ini
MAL_CHECK_INTERVAL = 30 #MAL链路检测时间间隔,默认30
MAL_CONN_FAIL_INTERVAL = 30 #判定MAL链路断开的时间,默认10
[MAL_INST1]
MAL_INST_NAME = DW_01 #实例名,和 dm.ini的INSTANCE_NAME一致
MAL_HOST = 192.168.148.12 #MAL系统监听TCP连接的IP地址
MAL_PORT = 5336 #MAL系统监听TCP连接的端口
MAL_INST_HOST = 10.15.1.200 #实例的对外服务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 = DW_02
MAL_HOST = 192.168.148.13
MAL_PORT = 5336
MAL_INST_HOST = 10.15.1.201
MAL_INST_PORT = 5236
MAL_DW_PORT = 5436
MAL_INST_DW_PORT = 5536
[dmdba@~]# vi /data/dmdata/DAMENG/dmwatcher.ini
[GDW1]
DW_TYPE = GLOBAL #全局守护类型
DW_MODE = AUTO #故障自动切换模式
DW_ERROR_TIME = 30 #远程守护进程故障认定时间,默认15
INST_ERROR_TIME = 30 #本地实例故障认定时间,默认15
INST_RECOVER_TIME = 60 #主库守护进程启动恢复的间隔时间,默认60
INST_OGUID = 45331 #守护系统唯一OGUID值
INST_INI = /data/dmdata/DAMENG/dm.ini #dm.ini文件路径
INST_AUTO_RESTART = 1 #打开实例的自动启动功能
INST_STARTUP_CMD = /home/dmdba/dmdbms/bin/DmServiceDMS01 start #命令行方式启动
RLOG_SEND_THRESHOLD = 0 #指定主库发送日志到备库的时间阈值,默认关闭
RLOG_APPLY_THRESHOLD = 0 #指定备库重演日志的时间阈值,默认关闭
备注:INST_STARTUP_CMD 必须配置为服务名
/home/dmdba/dmdbms/bin/dmrman
RMAN>BACKUP DATABASE '/data/dmdata/DAMENG/dm.ini' full backupset '/data/dmdata/DAMENG/bak/BACKUP_FILE';
scp -r /data/dmdata/DAMENG dmdba@192.168.148.13:/data/dmdata
/home/dmdba/dmdbms/script/root/dm_service_installer.sh -t dmserver -p DMS01 -dm_ini /data/dmdata/DAMENG/dm.ini -m mount
/home/dmdba/dmdbms/script/root/dm_service_installer.sh -t dmwatcher -p DW01 -watcher_ini /data/dmdata/DAMENG/dmwatcher.ini
vi /data/dmdata/DAMENG/dm.ini
INSTANCE_NAME = DW_02 #数据库实例名
[dmdba@~]# vi /data/dmdata/DAMENG/dmarch.ini
[ARCHIVE_LOCAL]
ARCH_TYPE = LOCAL #本地归档类型
ARCH_DEST = /data/dmarch #本地归档存放路径
ARCH_FILE_SIZE = 1024 #单个归档大小,单位MB
ARCH_SPACE_LIMIT = 10240 #归档上限,单位MB
[ARCHIVE_REALTIME]
ARCH_TYPE = REALTIME #实时归档类型
ARCH_DEST = DW_01 #实时归档目标实例名
[dmdba@~]# vi /data/dmdata/DAMENG/dmwatcher.ini
[GDW1]
DW_TYPE = GLOBAL #全局守护类型
DW_MODE = AUTO #故障自动切换模式
DW_ERROR_TIME = 30 #远程守护进程故障认定时间,默认15
INST_ERROR_TIME = 30 #本地实例故障认定时间,默认15
INST_RECOVER_TIME = 60 #主库守护进程启动恢复的间隔时间,默认60
INST_OGUID = 45331 #守护系统唯一OGUID值
INST_INI = /data/dmdata/DAMENG/dm.ini #dm.ini文件路径
INST_AUTO_RESTART = 1 #打开实例的自动启动功能
INST_STARTUP_CMD = /home/dmdba/dmdbms/bin/DmServiceDMS02 start #命令行方式启动
RLOG_SEND_THRESHOLD = 0 #指定主库发送日志到备库的时间阈值,默认关闭
RLOG_APPLY_THRESHOLD = 0 #指定备库重演日志的时间阈值,默认关闭
备注:INST_STARTUP_CMD 必须配置为服务名
./dmrman CTLSTMT="RESTORE DATABASE '/data/dmdata/DAMENG/dm.ini' FROM BACKUPSET '/data/dmdata/DAMENG/bak/BACKUP_FILE'"
./dmrman CTLSTMT="RECOVER DATABASE '/data/dmdata/DAMENG/dm.ini' FROM BACKUPSET '/data/dmdata/DAMENG/bak/BACKUP_FILE'"
./dmrman CTLSTMT="RECOVER DATABASE '/data/dmdata/DAMENG/dm.ini' UPDATE DB_MAGIC"
/home/dmdba/dmdbms/script/root/dm_service_installer.sh -t dmserver -p DMS02 -dm_ini /data/dmdata/DAMENG/dm.ini -m mount
/home/dmdba/dmdbms/script/root/dm_service_installer.sh -t dmwatcher -p DW02 -watcher_ini /data/dmdata/DAMENG/dmwatcher.ini
[dmdba@~]# vi /data/dmmonitor.ini
MON_DW_CONFIRM = 1 #0为非确认,1为确认
MON_LOG_PATH = /home/dmdba/log #监视器日志文件存放路径
MON_LOG_INTERVAL = 60 #每隔 60s 定时记录系统信息到日志文件
MON_LOG_FILE_SIZE = 512 #单个日志大小,单位MB
MON_LOG_SPACE_LIMIT = 2048 #日志上限,单位MB
[GDW1]
MON_INST_OGUID = 45331 #组GDW1的唯一OGUID 值
MON_DW_IP = 192.168.148.12:5436
MON_DW_IP = 192.168.148.13:5436
/home/dmdba/dmdbms/script/root/dm_service_installer.sh -t dmmonitor -p DWM -monitor_ini /data/dmmonitor.ini
/home/dmdba/dmdbms/bin/dmserver /data/dmdata/DAMENG/dm.ini mount
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
sp_set_oguid(45331);
alter database primary;
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);
/home/dmdba/dmdbms/bin/dmserver /data/dmdata/DAMENG/dm.ini mount
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
sp_set_oguid(45331);
alter database standby;
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);
/home/dmdba/dmdbms/bin/dmwatcher /data/dmdata/DAMENG/dmwatcher.ini
/home/dmdba/dmdbms/bin/dmmonitor /data/dmdata/DAMENG/dmmonitor.ini
vim /etc/dm_svc.conf
TIME_ZONE=(+480)
LANGUAGE=(cn)
DMDW=(10.15.1.200:5236,10.15.1.201:5236)
[DMDW]
LOGIN_MODE=(1)
SWITCH_TIMES=(200)
SWITCH_INTERVAL=(1000)
文章
阅读量
获赞