开启归档之后,使用热备时报错如下:
报错 [-718]:收集到的归档日志不连续
这个时候可以通过归档修复命令修复
1、先关闭数据库
systemctl stop DmServiceDMSERVER
2、使用dmrman
cd /dm8/bin ./dmrman
3、对database归档修复
RMAN> repair archivelog database '/dm8/data/DM01/dm.ini'; repair archivelog database '/dm8/data/DM01/dm.ini'; Database mode = 0, oguid = 0 Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL EP[0]'s cur_lsn[93970], file_lsn[93970] repair archive log successfully. repair time used: 171.185(ms)
此时如果报错,是因为达梦rman需要数据库离线时执行,停库后再修复归档,则修复成功
4、启动数据库
systemctl start DmServiceDMSERVER
5、重新执行备份命令
backup database ;
6、拷贝备份文件到异机
scp -R /dm8/backup/backupset1 root@node2:/dm8/backup
7、执行数据库文件重建命令
[dmdba@localhost ~]$ dmrman CTLSTMT="RESTORE DATABASE '/dm8/data/DM01/dm.ini' FROM BACKUPSET