目录
1.数据初始化
2. 开始恢复
3. 查询数据
4.测试
5.常用视图
备份集有全量备份、增量备份这2种备份集的时候,要使用增量备份的目录进行还原指定
在一次全备份后,insert一条数据后,开始1级增量备份
[dmdba@sec dmbackup]$ [dmdba@sec dmbackup]$ disql suys/'"suys1234#$"'@192.168.56.101:5236 Server[192.168.56.101:5236]:mode is normal, state is open login used time: 2.811(ms) disql V7.6.0.104-Build(2018.10.24-98376)ENT Connected to: DM 7.1.7.144 SQL> SQL> SQL> insert into suys2021 values ('434'); affect rows 1 used time: 0.648(ms). Execute id is 800. SQL> SQL> commit; executed successfully used time: 0.424(ms). Execute id is 801. SQL> SQL> exit [dmdba@sec dmbackup]$ disql sysdba/dameng123@192.168.56.101:5236 Server[192.168.56.101:5236]:mode is normal, state is open login used time: 2.279(ms) disql V7.6.0.104-Build(2018.10.24-98376)ENT Connected to: DM 7.1.7.144 SQL> SQL> SQL> SQL> SQL> BACKUP DATABASE INCREMENT WITH BACKUPDIR '/dm8/dmbackup' BACKUPSET '/dm8/dmbackup/db_increment_bak_AAA_01'; executed successfully used time: 00:00:01.044. Execute id is 900. SQL> SQL> exit |
使用增量备份集合开始还原。
[dmdba@sec dmbackup]$ [dmdba@sec dmbackup]$ DmServicePROD stop Stopping DmServicePROD: [ OK ] [dmdba@sec dmbackup]$ cd /dm8/ arch/ backup/ dmbackup/ dmdbms/ log/ [dmdba@sec dmbackup]$ cd /home/dmdba/dmdbms/bin [dmdba@sec bin]$ [dmdba@sec bin]$ dmrman dmrman V8 RMAN> RMAN> RMAN> RMAN> RESTORE DATABASE '/dm8/dmdbms/data/PROD/dm.ini' FROM BACKUPSET '/dm8/dmbackup/backup_full_AA'; RESTORE DATABASE '/dm8/dmdbms/data/PROD/dm.ini' FROM BACKUPSET '/dm8/dmbackup/backup_full_AA'; file dm.key not found, use default license! [Percent:100.00%][Speed:0.00M/s][Cost:00:00:00][Remaining:00:00:00] restore successfully. time used: 341.027(ms) RMAN> RMAN> recover DATABASE '/dm8/dmdbms/data/PROD/dm.ini' FROM BACKUPSET '/dm8/dmbackup/backup_full_AA'; recover DATABASE '/dm8/dmdbms/data/PROD/dm.ini' FROM BACKUPSET '/dm8/dmbackup/backup_full_AA'; Database mode = 0, oguid = 0 EP[0]'s cur_lsn[58821] EP:0 total 1 pkgs applied, percent: 20% EP:0 total 2 pkgs applied, percent: 40% EP:0 total 3 pkgs applied, percent: 60% EP:0 total 4 pkgs applied, percent: 80% EP:0 total 5 pkgs applied, percent: 100% recover successfully! time used: 248.431(ms) RMAN> RMAN> recover DATABASE '/dm8/dmdbms/data/PROD/dm.ini' update db_magic; recover DATABASE '/dm8/dmdbms/data/PROD/dm.ini' update db_magic; Database mode = 0, oguid = 0 EP[0]'s cur_lsn[58829] recover successfully! time used: 976.682(ms) RMAN> RMAN> exit time used: 0.003(ms) [dmdba@sec bin]$ DmServicePROD start Starting DmServicePROD: [ OK ] [dmdba@sec bin]$ [dmdba@sec bin]$ |
可以看到全备后,新增的那条434数据,已经还原了。
使用增量备份还原的时候,全量备份给删除的情况
[dmdba@sec bin]$ [dmdba@sec bin]$ [dmdba@sec bin]$ dmrman dmrman V8 RMAN> RMAN> RESTORE DATABASE '/dm8/dmdbms/data/PROD/dm.ini' FROM BACKUPSET '/dm8/dmbackup/db_increment_bak_AAA_01'; RESTORE DATABASE '/dm8/dmdbms/data/PROD/dm.ini' FROM BACKUPSET '/dm8/dmbackup/db_increment_bak_AAA_01'; file dm.key not found, use default license! [Percent:0.00%][Speed:0.00M/s][Cost:00:00:01][Remaining:00:00:00] [-8036]:No base backup or no base backup matched RMAN> RMAN> |
可以看到系统已经提示,缺少备份集了。
备份管理相关系统过程与函数总结如下:
备份管理相关动态视图总结如下:
达梦数据库 - 新一代大型通用关系型数据库 | 达梦云适配中心达梦数据库产品体验站,DM8在线试玩,达梦数据库全系列产品免费下载,官方权威的快速上手文档和产品手册,最活跃的达梦技术社区,面向全行业ISV厂商免费的云适配服务。https://eco.dameng.com/