环境:CentOS 7
数据库版本:V8.1.3.26
SQL> select id_code;
LINEID ID_CODE
---------- ------------------------------------------
1 --03134284058-20240821-240039-20046 Pack37
数据库信息:主备集群部署在同一台服务器
软件目录:/dm8
实例目录:
主:/dmdata/5236
备:/dmdata/5237
这里全库备份执行脱机的全备或联机全备都可以。
此处执行的是脱机的全备
停监视器
[dmdba@dba ~]$ DmMonitorServiceMONITOR stop
Stopping DmMonitorServiceMONITOR: [ OK ]
停备的守护:
[dmdba@dba ~]$ DmWatcherServiceDMSERVER02 stop
Stopping DmWatcherServiceDMSERVER02: [ OK ]
停主的守护:
[dmdba@dba ~]$ DmWatcherServiceDMSERVER01 stop
Stopping DmWatcherServiceDMSERVER01: [ OK ]
停主的数据库:
[dmdba@dba ~]$ DmServiceDMSERVER01 stop
Stopping DmServiceDMSERVER01: [ OK ]
停备的数据库:
[dmdba@dba ~]$ DmServiceDMSERVER02 stop
Stopping DmServiceDMSERVER02: [ OK ]
[dmdba@dba ~]$ dmrman
dmrman V8
RMAN> backup database '/dmdata/5236/DMDB/dm.ini' backupset '/home/dmdba/full.bak';
backup database '/dmdata/5236/DMDB/dm.ini' backupset '/home/dmdba/full.bak';
file dm.key not found, use default license!
Database mode = 1, oguid = 26180
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]'s cur_lsn[41419], file_lsn[41419]
Processing backupset /home/dmdba/full.bak
[Percent:81.94%][Speed:628.71M/s][Cost:00:00:02][Remaining:00:00:0 [Percent:98.71%][Speed:426.23M/s][Cost:00:00:02][Remaining:00:00:0 [Percent:100.00%][Speed:285.71M/s][Cost:00:00:02][Remaining:00:00: [Percent:100.00%][Speed:0.00M/s][Cost:00:00:02][Remaining:00:00:00 [Percent:100.00%][Speed:0.00M/s][Cost:00:00:02][Remaining:00:00:00 [Percent:100.00%][Speed:0.00M/s][Cost:00:00:02][Remaining:00:00:00]
backup successfully!
time used: 00:00:03.517
[dmdba@dba ~]$ cd /dmdata/5236/DMDB/
[dmdba@dba DMDB]$ ls
bak dm.ini.dmbak HMAIN
ctl_bak dminit20241025092424.log MAIN.DBF
dmarch.ini dmmal.ini ROLL.DBF
dm.ctl dmmonitor.ini sqllog.ini
DMDB01.log dmmonitor_noc.ini SYSTEM.DBF
DMDB02.log dm_service.prikey TEMP.DBF
dm.ini dmwatcher.ini trace
[dmdba@dba DMDB]$ cp dm.ini dm.ini.bak
[dmdba@dba DMDB]$ mv SYSTEM.DBF SYSTEM.DBF.BAK
启主库服务
[dmdba@dba DMDB]$ DmServiceDMSERVER01 start
Starting DmServiceDMSERVER01: [ FAILED ]
查看日志报错
注:此处需要重新拷贝回来一个system.dbf文件,否则在restore时提示,SYSTEM.DBF文件不存在。
将备库的system.dbf文件拷贝回来
[dmdba@dba ~]$ cd /dmdata/5237/DMDB/
[dmdba@dba DMDB]$ ls
bak dm.ini.dmbak HMAIN
ctl_bak dminit20241025093427.log MAIN.DBF
dmarch.ini dmmal.ini ROLL.DBF
dm.ctl dmmonitor.ini sqllog.ini
DMDB01.log dmmonitor_noc.ini SYSTEM.DBF
DMDB02.log dm_service.prikey TEMP.DBF
dm.ini dmwatcher.ini trace
[dmdba@dba DMDB]$ cp SYSTEM.DBF ../../5236/DMDB/
[dmdba@dba DMDB]$ dmrman
dmrman V8
RMAN> restore database '/dmdata/5236/DMDB/dm.ini' from backupset '/home/dmdba/full.bak';
restore database '/dmdata/5236/DMDB/dm.ini' from backupset '/home/dmdba/full.bak';
file dm.key not found, use default license!
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
[Percent:100.00%][Speed:1316.29M/s][Cost:00:00:02][Remaining:00:00 [Percent:100.00%][Speed:0.00M/s][Cost:00:00:02][Remaining:00:00:00 [Percent:100.00%][Speed:0.00M/s][Cost:00:00:02][Remaining:00:00:00 [Percent:100.00%][Speed:0.00M/s][Cost:00:00:02][Remaining:00:00:00]
restore successfully.
time used: 00:00:02.790
RMAN> recover database '/dmdata/5236/DMDB/dm.ini' from backupset '/home/dmdba/full.bak';
recover database '/dmdata/5236/DMDB/dm.ini' from backupset '/home/dmdba/full.bak';
Database mode = 2, oguid = 26180
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]'s cur_lsn[41419], file_lsn[41419]
recover successfully!
time used: 448.116(ms)
RMAN> recover database '/dmdata/5236/DMDB/dm.ini' update db_magic;
recover database '/dmdata/5236/DMDB/dm.ini' update db_magic;
Database mode = 2, oguid = 26180
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]'s cur_lsn[41419], file_lsn[41419]
recover successfully!
time used: 00:00:01.095
[dmdba@dba DMDB]$ DmServiceDMSERVER01 start
Starting DmServiceDMSERVER01: [ OK ]
[dmdba@dba DMDB]$ DmServiceDMSERVER02 start
Starting DmServiceDMSERVER02: [ OK ]
[dmdba@dba DMDB]$ DmWatcherServiceDMSERVER01 start
Starting DmWatcherServiceDMSERVER01: [ OK ]
[dmdba@dba DMDB]$ DmWatcherServiceDMSERVER02 start
Starting DmWatcherServiceDMSERVER02: [ OK ]
至此结束!
文章
阅读量
获赞