mysql中的rman备份_RMAN备份学习笔记

讲到rman就要讲到catalog,也就是恢复目录,这个东东我觉得没有太大的用,如果数据库没有打到open状态,恢复目录数据库根本连接不上。我个人建议可以不使用catalog数据库,当然为了全面的了解rman,还是要简单了解下catalog数据库是用来做什么的,catalog数据库是专门供rman使用,用来存储备份信息(不是存储备份文件)及备份脚本的地方。

如果我们不用catalog的时候,备份信息就存放在控制文件当中,这些备份信息是做恢复的时候需要用到的信息。

情景一:使用catalog数据库

1.创建catalog表空间

create tablespace rman_ts

datafile ‘xxxxxxxx/rman_ts01.dbf’

size 10m;

2.创建rman用户

create user rman identified by rman

default tablespace rman_ts

temporary tablespace temp

quota unlimited on rman_ts

3.用户授权

grant recovery_catalog_owner to rman

grant resource,connect to rman

4.在目录数据库中创建恢复目录

rman catalog rman/rman

create catalog tablespace rman_ts

这个时候我们就可以正常使用catalog数据库了,可以做下测试

[Oracle@ora10 ~]$ rman target / catalog rman/rman

Recovery Manager: Release 10.2.0.4.0 - Production on Thu Mar 28 15:05:06 2013

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: QDYX (DBID=3280546065)

connected to recovery catalog database

情景二:不使用恢复目录

rman target /

做个全备份

run {

allocate channel n1 type disk;

allocate channel n2 type disk;

backup as compressed backupset database

format '/disk01/backup/ora10_%d_%s_%p';

release channel n1;

release channel n2;

}

做增量备份(差异增量)

run {

allocate channel c1 type disk;

backup incremental level 0

format '/disk01/backup/rmanbak/inc0_%u_%T'

database;

release channel c1;

}

备份数据文件

backup datafile 8;

备份表空间

backup tablespace users;

备份归档日志

backup archivelog all delete all input;

备份数据库同时备份归档日志,并删除归档日志

backup as compressed backupset database plus archivelog delete all input

format '/disk01/backup/ora10_%d_%s_%p';

注意:这里可以使用run{}生成一段代码,定制一些参数就行备份,也可以直接使用默认参数备份。在备份时如果不指定备份的路径,则默认保存在flash_recovery_area目录下。0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值