一、准备两台服务器
192.168.0.89
192.168.0.76
二、两节点进行数据库安装
1)创建dmdba用户和安装组dinstall
2)修改最大文件打开数 ulimit -n 65536
3)数据库安装目录:/home/dmdba/dmdbms
三、裸设备绑定
1)新增一块共享磁盘20G
2)对该磁盘分区,大小为200M,200M,4G,剩余全部;
3)绑定裸设备
vi /etc/udev/rules.d/90-raw.rules
ACTION=="add",KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",KERNEL=="sdb2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",KERNEL=="sdb3",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add",KERNEL=="sdb4",RUN+="/bin/raw /dev/raw/raw4 %N"
KERNEL=="raw[1-4]", OWNER="dmdba", GROUP="dinstall", MODE="660"
4) 执行以下命令,使 udev 生效
udevadm trigger --type=devices --action=change
ll /dev/raw/raw* #查看是否生效,没有生效重新启动再次查看;
四、参数文件配置
1)配置dmdcr_cfg.ini 配置文件放到/home/dmdba/data 目录(89节点)
DCR_N_GRP = 3
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 63635
[GRP]
DCR_GRP_TYPE = CSS
DCR_GRP_NAME = CSS
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 192.168.0.89
DCR_EP_PORT = 9341
[CSS]
DCR_EP_NAME = CSS2
DCR_EP_HOST = 192.168.0.76
DCR_EP_PORT = 9341
[GRP]
DCR_GRP_TYPE = ASM
DCR_GRP_NAME = ASM
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[ASM]
DCR_EP_NAME = ASM1
DCR_EP_SHM_KEY = 93360
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 192.168.0.89
DCR_EP_PORT = 9351
DCR_EP_ASM_LOAD_PATH = /dev/raw
[ASM]
DCR_EP_NAME = ASM2
DCR_EP_SHM_KEY = 93361
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 192.168.0.76
DCR_EP_PORT = 9351
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = DSC
2)使用 DMASMCMD 工具初始化(89节点)
./dmasmcmd(在安装目录的bin目录下)
create dcrdisk ‘/dev/raw/raw1‘ ‘dcr‘
create votedisk ‘/dev/raw/raw2‘ ‘vote‘
create asmdisk ‘/dev/raw/raw3‘ ‘LOG0‘
create asmdisk ‘/dev/raw/raw4‘ ‘DATA0‘
init dcrdisk ‘/dev/raw/raw1‘ from ‘/home/dmdba/data/dmdcr_cfg.ini‘ identified by ‘abcd‘
init votedisk ‘/dev/raw/raw2‘ from ‘/home/dmdba/data/dmdcr_cfg.ini‘
3)准备 DMASM 的 MAL 配置文件(命名为 dmasvrmal.ini),使用 DMASM 的所有节点都要配置,内容完全一样,保存到/home/dmdba/data 目录下
[MAL_INST1]
MAL_INST_NAME = ASM1
MAL_HOST = 192.168.0.89
MAL_PORT = 7236
[MAL_INST2]
MAL_INST_NAME = ASM2
MAL_HOST = 192.168.0.76
MAL_PORT = 7237
4)准备 dmdcr.ini 配置文件,保存到/home/dmdba/data 目录下面
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH =/home/dmdba/data/dmasvrmal.ini #dmasmsvr 使用的 MAL 配置文件路径
DMDCR_SEQNO = 0
#ASM 重启参数,命令行方式启动
DMDCR_ASM_RESTART_INTERVAL = 0
DMDCR_ASM_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmasmsvr dcr_ini=/home/dmdba/data/dmdcr.ini
#DB 重启参数,命令行方式启动
DMDCR_DB_RESTART_INTERVAL = 0
DMDCR_DB_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver path=/home/dmdba/data/dsc0_config/dm.ini dcr_ini=/home/dmdba/data/dmdcr.ini
5)发送dmasvrmal.ini,dmdcr.ini到另一个节点,并修改相应参数;
在另一节点修改dmdcr.ini的DMDCR_SEQNO = 1即可
五、初始化两节点实例
1)两节点分别启动 DMCSS、DMASM 服务程序
./dmcss DCR_INI=/home/data/dmdcr.ini
./dmasmsvr DCR_INI=/home/data/dmdcr.ini
2)启动后不要退出,复制会话在89节点使用 dmasmtool 工具创建 DMASM 磁盘组
./dmasmtool DCR_INI=/home/data/dmdcr.ini
#创建日志磁盘组
create diskgroup ‘DMLOG’ asmdisk ‘/dev/raw/raw3’
#创建数据磁盘组
create diskgroup ‘DMDATA’ asmdisk ‘/dev/raw/raw4’
3)准备 dminit.ini 配置文件,保存到/home/dmdba/data 目录(初始化库)
db_name = DSC
system_path = +DMDATA/data
system = +DMDATA/data/dsc/system.dbf
system_size = 128
roll = +DMDATA/data/dsc/roll.dbf
roll_size = 128
main = +DMDATA/data/dsc/main.dbf
main_size = 128
ctl_path = +DMDATA/data/dsc/dm.ctl
ctl_size = 8
log_size = 100
dcr_path = /dev/raw/raw1 #dcr 磁盘路径,目前不支持 asm,只能是裸设备
dcr_seqno = 0
auto_overwrite = 1
[DSC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /home/dmdba/data/dsc1
port_num = 5236
mal_host = 192.168.0.89
mal_port = 9236
log_path = +DMLOG/log/DSC1_log01.log
log_path = +DMLOG/log/DSC1_log02.log
[DSC2] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /home/dmdba/data/dsc2
port_num = 5236
mal_host = 192.168.0.76
mal_port = 9236
log_path = +DMLOG/log/DSC2_log01.log
log_path = +DMLOG/log/DSC2_log02.log
4)./dminit control=/home/dmdba/data/dminit.ini
dsc2目录拷贝到76节点的/home/dmdba/data目录下
scp -r dsc2 196.168.0.76:/home/dmdba/data
5)启动数据库服务:(两节点都需要启动)
./dmserver /home/dmdba/data/dsc1/dm.ini dcr_ini=/home/dmdba/data/dmdcr.ini
6)登录disql,查询select * from V$dsc_ep_info;可以查看到两个节点
7)注册服务(每个节点注册三个服务)
在安装目录的script/root下执行注册服务的脚本
./dm_service_installer.sh -t dmcss -dcr_ini /home/dmdba/data/dmdcr.ini -p DM1
./dm_service_installer.sh -t dmasmsvr -p DM1 -dcr_ini /home/dmdba/data/dmdcr.ini -y DmCSSServiceDM1.service
./dm_service_installer.sh -t dmserver -dcr_ini /home/dmdba/data/dmdcr.ini -dm_ini /home/dmdba/data/dsc1/dm.ini -p DM1 -y DmASMSvrServiceDM1.service
8)**生产环境还需要设置归档和备份**