达梦数据库的物理备份

1.物理备份-冷备

 冷备只支持库级别的备份

冷备不用开启归档,需要开启DmAP服务,需要关闭数据库实例 

1.console工具备份

      1.在备份之前,首先建立一个备份文件目录backup

                mkdir –p /dm/dmdbms/backup

      2.确认开启DmAP服务

                cd /opt/dm/dmdbms/bin

                ./DmAPService status

                DmAPService (pid 1548) is running.

       3.关闭数据库服务

        ./DMServiceDMServer stop

        4.打开console工具

        [dmdba@localhost tool]$ ./console

      

5.点击备份还原

6.点击新建备份

7.输入信息点击确定,备份成功

2.dmrman工具备份支持冷备

        1.确认开启DmAP服务

            cd /opt/dm/dmdbms/bin

           ./DmAPService status

           DmAPService (pid 1548) is running.

        2.关闭数据库服务

        ./DMServiceDMServer stop

        打开dmrman工具

        ./dmrman

        3.输入备份语句

 backup database '/opt/dm/dmdbms/data/DAMENG/dm.ini' backupset '/opt/dm/dmdbms/backup1';

2.物理备份热备

热备需要开启归档,需要开启DmAP服务,需要数据库联机

1.manager工具备份

        1.开启归档

        alter database mount;

        alter database archivelog;

        alter database add archivelog         'type=local,dest=/opt/dm/dmdbms/arch,file_size=1024,space_limit=2048';

        alter database open;

        select name,arch_mode from v$database

        2.打开manager新建备份

        3.进行库的增量备份,记得填写基备份集目录,里面选择你是基于哪个备份的备份集

        4.对表空间、表、归档日志,方法是一样的

                1.disql工具备份

                ./disql SYSDBA/SYSDAB

                        1.整库备份

                        SQL> backup database full backupset '/opt/dm/dmdbms/backup2'

                        2.库的增量备份

                backup database increment base on backupset '/opt/dm/dmdbms/backup2/ DB_DAMENG_FULL_2022_04_06_09_42_41' to "DB_DAMENG_INCRE_2022_04_06_18_50_26" backupset 'DB_DAMENG_INCRE_2022_04_06_18_50_26'

3.表空间、表、归档日志备份同理

达梦数据库的物理还原

      还原之前先用dmrman检查备份集的有效性

      RMAN> check backupset '/opt/dm/dmdbms/backup2';

      check backupset '/opt/dm/dmdbms/backup2';

      check backupset successfully.

      time used: 135.009(ms)

1.console工具还原

        1.关闭数据库服务

        ./DmServiceDMSERVER stop

        2.还原

        3.恢复

        4.更新db_magic

注意:数据库在整库还原后需要更新魔数,数据克隆也会用到

        5.表空间同理,但是不需要更新魔数

dmrman工具还原

restore database ’dm.ini’ from backupset ‘备份路径

recover database ‘dm.ini’ from backupset ‘备份路径

recover database ‘dm.ini’ update db_magic

达梦数据库 - 新一代大型通用关系型数据库 | 达梦云适配中心

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐