date
ntpdate time.nist.gov
hostnamectl
hostnamectl set-hostname node3
su root
groupadd dinstall -g 2001
useradd -G dinstall -m -d /home/dmdba -s /bin/bash -u 2001 dmdba
passwd dmdba
vi /etc/security/limits.conf
dmdba soft nice 0
dmdba hard nice 0
dmdba soft as unlimited
dmdba hard as unlimited
dmdba soft fsize unlimited
dmdba hard fsize unlimited
dmdba soft nproc 65536
dmdba hard nproc 65536
dmdba soft nofile 65536
dmdba hard nofile 65536
dmdba soft core unlimited
dmdba hard core unlimited
dmdba soft data unlimited
dmdba hard data unlimited
reboot
su - dmdba
ulimit -a
su - dmdba
ulimit -n 65536
ulimit -u 65536
exit
mkdir -p /dmdata/data
mkdir -p /dmdata/arch
mkdir -p /dmdata/dmbak
chown -R dmdba:dinstall /dmdata/data
chown -R dmdba:dinstall /dmdata/arch
chown -R dmdba:dinstall /dmdata/dmbak
chmod -R 755 /dmdata/data
chmod -R 755 /dmdata/arch
chmod -R 755 /dmdata/dmbak
ll /dmdata/
cd /root/dm8/install
mount -o loop dm8_20240408_x86_rh6_64.iso /mnt
cp /root/dm8/key/dm3001108295.key /home/dmdba/dm.key
su - dmdba
cd /mnt
./DMInstall.bin -i
exit
sh /home/dmdba/dmdbms/script/root/root_installer.sh
su - dmdba
cd /home/dmdba/dmdbms/bin
./dminit help
./dminit path=/dmdata/data
exit
cd /home/dmdba/dmdbms/script/root/
./dm_service_installer.sh -t dmserver -dm_ini /dmdata/data/DAMENG/dm.ini -p DAMENG
cd /home/dmdba/dmdbms/bin
ls | grep DAMENG
su - dmdba
cd /home/dmdba/dmdbms/bin
./DmServiceDAMENG start
./DmServiceDAMENG stop
./DmServiceDAMENG restart
./DmServiceDAMENG status
exit
systemctl stop iptables
systemctl disable iptables
systemctl stop firewalld
systemctl disable firewalld
su - dmdba
vi /dmdata/data/DAMENG/dm.ini
ENABLE_ENCRYPT = 0
cd /home/dmdba/dmdbms/bin && ./DmServiceDAMENG restart
su - dmdba
cd
vi .bashrc
export PATH=/home/dmdba/dmdbms/bin:$PATH
export LD_LIBRARY_PATH=/home/dmdba/dmdbms/bin:$LD_LIBRARY_PATH
source .bashrc
disql
vi /dmdata/data/DAMENG/dmarch.ini
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dmdata/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 0
ARCH_FLUSH_BUF_SIZE = 0
ARCH_HANG_FLAG = 1
disql SYSDBA/SYSDBA@127.0.0.1:5236
-- SQL命令
alter database mount;
alter database add archivelog 'DEST=/dmdata/arch,TYPE=local, FILE_SIZE=128,space_limit=0';
-- 如果有错误 Archive config not exist. 先自己建一个文件(后面的命令也会自动创建)
alter database archivelog;
alter database open;
select arch_mode from v$database;
DmServiceDAMENG stop
dmrman CTLSTMT="BACKUP DATABASE '/dmdata/data/DAMENG/dm.ini' FULL TO BACKUP_FILE1 BACKUPSET '/dmdata/dmbak/BACKUP_FILE_01'"
ll /dmdata/dmbak/BACKUP_FILE_01/
disql SYSDBA/SYSDBA@127.0.0.1:5236
SQL> backup database full backupset '/dmdata/dmbak/BACKUP_FILE_01';
vi /dmdata/data/DAMENG/dm.ini
INSTANCE_NAME = DMSERVER_PRI
ALTER_MODE_STATUS = 0
ENABLE_OFFLINE_TS = 2
MAL_INI = 1
ARCH_INI = 1
vi /dmdata/data/DAMENG/dmmal.ini
MAL_CHECK_INTERVAL = 5
MAL_COMBIN_BUF_SIZE = 0
MAL_SEND_THRESHOLD = 2048
MAL_CONN_FAIL_INTERVAL = 5
MAL_LOGIN_TIMEOUT = 15
MAL_BUF_SIZE = 100
MAL_SYS_BUF_SIZE = 0
MAL_VPOOL_SIZE = 128
MAL_COMPRESS_LEVEL = 0
MAL_TEMP_PATH =
[MAL_INST1]
MAL_INST_NAME = DMSERVER_PRI
MAL_HOST = 10.20.35.123
MAL_PORT = 5238
MAL_INST_HOST = 10.20.35.123
MAL_INST_PORT = 5236
MAL_INST_DW_PORT = 5237
MAL_DW_PORT = 5239
[MAL_INST2]
MAL_INST_NAME=DMSERVER_STANDBY
MAL_HOST = 10.20.35.122
MAL_PORT = 5238
MAL_INST_HOST = 10.20.35.122
MAL_INST_PORT = 5236
MAL_INST_DW_PORT = 5237
MAL_DW_PORT = 5239
vi /dmdata/data/DAMENG/dmarch.ini
ARCH_WAIT_APPLY = 0
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dmdata/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 0
ARCH_FLUSH_BUF_SIZE = 0
ARCH_HANG_FLAG = 1
[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME
ARCH_DEST = DMSERVER_STANDBY
WAIT_APPLY = 0
ARCH_FAILOVER = 0
DmServiceDAMENG start mount
disql SYSDBA/SYSDBA@127.0.0.1:5236
--SQL命令
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
sp_set_oguid(20220607);
ALTER DATABASE PRIMARY;
sp_set_oguid(20220607);
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);
exit
disql SYSDBA/SYSDBA@127.0.0.1:5236
-- SQL 处于mount状态
select STATUS$ from v$instance;
exit
DmServiceDAMENG stop
DmServiceDAMENG start
vi /dmdata/data/DAMENG/dmwatcher.ini
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = MANUAL
DW_ERROR_TIME = 10
INST_RECOVER_TIME = 60
INST_ERROR_TIME = 10
INST_OGUID = 20220607
INST_INI = /dmdata/data/DAMENG/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver
RLOG_SEND_THRESHOLD = 0
RLOG_APPLY_THRESHOLD = 0
dmctlcvt TYPE=1 SRC=/dmdata/data/DAMENG/dm.ctl DEST=/dmdata/data/DAMENG/dmctl.txt
cd /dmdata/data/DAMENG
nohup dmwatcher /dmdata/data/DAMENG/dmwatcher.ini > w-nohup.out 2>&1 &
disql SYSDBA/SYSDBA@127.0.0.1:5236
-- SQL 处于open状态
select STATUS$ from v$instance;
su - dmdba
scp -r ./BACKUP_FILE_01 dmdba@10.20.35.122:/dmdata/dmbak/
su - dmdba
DmServiceDAMENG stop
dmrman CTLSTMT="RESTORE DATABASE '/dmdata/data/DAMENG/dm.ini' FROM BACKUPSET '/dmdata/dmbak/BACKUP_FILE_01'"
dmrman CTLSTMT="RECOVER DATABASE '/dmdata/data/DAMENG/dm.ini' FROM BACKUPSET '/dmdata/dmbak/BACKUP_FILE_01'"
dmrman CTLSTMT="RECOVER DATABASE '/dmdata/data/DAMENG/dm.ini' UPDATE DB_MAGIC"
vi /dmdata/data/DAMENG/dm.ini
INSTANCE_NAME = DMSERVER_STANDBY
ALTER_MODE_STATUS = 0
ENABLE_OFFLINE_TS = 2
MAL_INI = 1
ARCH_INI = 1
vi /dmdata/data/DAMENG/dmmal.ini
MAL_CHECK_INTERVAL = 5
MAL_COMBIN_BUF_SIZE = 0
MAL_SEND_THRESHOLD = 2048
MAL_CONN_FAIL_INTERVAL = 5
MAL_LOGIN_TIMEOUT = 15
MAL_BUF_SIZE = 100
MAL_SYS_BUF_SIZE = 0
MAL_VPOOL_SIZE = 128
MAL_COMPRESS_LEVEL = 0
MAL_TEMP_PATH =
[MAL_INST1]
MAL_INST_NAME = DMSERVER_PRI
MAL_HOST = 10.20.35.123
MAL_PORT = 5238
MAL_INST_HOST = 10.20.35.123
MAL_INST_PORT = 5236
MAL_INST_DW_PORT = 5237
MAL_DW_PORT = 5239
[MAL_INST2]
MAL_INST_NAME=DMSERVER_STANDBY
MAL_HOST = 10.20.35.122
MAL_PORT = 5238
MAL_INST_HOST = 10.20.35.122
MAL_INST_PORT = 5236
MAL_INST_DW_PORT = 5237
MAL_DW_PORT = 5239
vi /dmdata/data/DAMENG/dmarch.ini
ARCH_WAIT_APPLY = 0
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dmdata/arch
ARCH_FILE_SIZE = 128
ARCH_SPACE_LIMIT = 0
ARCH_FLUSH_BUF_SIZE = 0
ARCH_HANG_FLAG = 1
[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME
ARCH_DEST = DMSERVER_PRI
WAIT_APPLY = 0
ARCH_FAILOVER = 0
DmServiceDAMENG start mount
disql SYSDBA/SYSDBA@127.0.0.1:5236
--SQL命令
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 1);
sp_set_oguid(20220607);
ALTER DATABASE STANDBY;
SP_SET_PARA_VALUE(1, 'ALTER_MODE_STATUS', 0);
exit
disql SYSDBA/SYSDBA@127.0.0.1:5236
-- SQL 备库 处于mount状态
select STATUS$ from v$instance;
exit
DmServiceDAMENG stop
DmServiceDAMENG start
vi /dmdata/data/DAMENG/dmwatcher.ini
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = MANUAL
DW_ERROR_TIME = 10
INST_RECOVER_TIME = 60
INST_ERROR_TIME = 10
INST_OGUID = 20220607
INST_INI = /dmdata/data/DAMENG/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /home/dmdba/dmdbms/bin/dmserver
RLOG_SEND_THRESHOLD = 0
RLOG_APPLY_THRESHOLD = 0
dmctlcvt TYPE=1 SRC=/dmdata/data/DAMENG/dm.ctl DEST=/dmdata/data/DAMENG/dmctl.txt
cd /dmdata/data/DAMENG
nohup dmwatcher /dmdata/data/DAMENG/dmwatcher.ini > w-nohup.out 2>&1 &
disql SYSDBA/SYSDBA@127.0.0.1:5236
-- SQL 处于open状态
select STATUS$ from v$instance;
su - dmdba
mkdir -p /dmdata/data/monitor-log
vi /dmdata/data/DAMENG/dmmonitor.ini
MON_DW_CONFIRM = 1
MON_LOG_PATH = /dmdata/data/monitor-log/
MON_LOG_INTERVAL = 60
MON_LOG_FILE_SIZE = 32
MON_LOG_SPACE_LIMIT = 0
[GRP1]
MON_INST_OGUID = 20220607
MON_DW_IP = 10.20.35.123:5239
MON_DW_IP = 10.20.35.122:5239
cd /dmdata/data/DAMENG
nohup dmmonitor /dmdata/data/DAMENG/dmmonitor.ini > m-nohup.out 2>&1 &
disql SYSDBA/SYSDBA@127.0.0.1:5236
CREATE TABLE TAB_FOR_RECOVER(C1 INT,create_time datetime);
INSERT INTO TAB_FOR_RECOVER VALUES(1,sysdate);
INSERT INTO TAB_FOR_RECOVER VALUES(2,sysdate);
INSERT INTO TAB_FOR_RECOVER VALUES(3,sysdate);
commit;
--需要提交事务后才会同步到备节点
disql SYSDBA/SYSDBA@127.0.0.1:5236
select * from TAB_FOR_RECOVER;
su - dmdba
mkdir -p /dmdata/data/monitor-log-look
vi /dmdata/data/DAMENG/dmmonitor_look.ini
MON_DW_CONFIRM = 0
MON_LOG_PATH = /dmdata/data/monitor-log/
MON_LOG_INTERVAL = 60
MON_LOG_FILE_SIZE = 32
MON_LOG_SPACE_LIMIT = 0
[GRP1]
MON_INST_OGUID = 20220607
MON_DW_IP = 10.20.35.123:5239
MON_DW_IP = 10.20.35.122:5239
cd /dmdata/data/DAMENG
dmmonitor /dmdata/data/DAMENG/dmmonitor_look.ini
vi /dmdata/data/DAMENG/dm.ini
SORT_BUF_SIZE = 512
SORT_BLK_SIZE = 2
SORT_BUF_GLOBAL_SIZE = 5120