ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RMAN Manager

RMAN Manager

原创 Linux操作系统 作者:ygzhou518 时间:2011-12-14 11:17:50 0 删除 编辑

oracle rman备份数据库(File system)

1、备份整个数据库

backup database format '/home/oracle/backup/rmandatabase_%U.bak';

2、备份表空间

backup tablespace abc format '/home/oracle/backuprmantablespace_%U.bak';

3、备份数据文件

1backup datafile 5 format '/home/oracle/backup/rmandatafile_%U.bak';

2backup datafile '/u01/app/oracle/oradata/ygzhou/ygzhou01.dbf' format '/home/oracle/backup/rmanddatafile_%U.bak';

4、备份控制文件

backup current controlfile format '/home/oracle/backup/rmancontrolfile_%U.ctl';

5、备份数据文件同时备份控制文件

backup datafile 5 format '/home/oracle/backup/rmandatafile_controlfile_%U.bak' include current controlfile;

6、备份spfile文件

backup spfile format '/home/oracle/backup/rmanspfile_%U.sp';

7、备份日志文件

backup archivelog sequence between 38 and 41 format '/home/oracle/backup/rmanarchivelog_%U.log’ delete all input;(可选项,表示备份日志文件后,删除原来日志文件)

8、备份数据库和日志文件

backup database plus archivelog format '/home/oracle/backup/rmandatafile_archivelog_%U.bak' delete all input;

9copy功能(相当于用户管理备份)

backup as copy database format '/home/oracle/backup/rmandatabase_%U.cy';

copy datafile 5 to '/home/oracle/backup/rmandatafile_%U.cy';

 

【NOTE】

  • backup as copy可以备份整个数据库
  • copy只能备份current controlfiledatafiletablespace等,这个数据库不支持

oracle rman备份数据库(ASM)

 

发现11.2.0.2的物理备库无法删除过期日志,删除脚本如下

[oracle@]$ more /home/oracle/monitor/deletearchivelog.sh

. /home/oracle/.bash_profile

rman target / @/home/oracle/monitor/deletearchivelog > /home/oracle/monitor/deletearchivelog.log

 

[oracle@report-db01 ~]$ more /home/oracle/monitor/deletearchivelog

crosscheck archivelog all;

delete noprompt force archivelog until time 'sysdate-1/4';

delete noprompt force archivelog all;

 

其中报错日志为

RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process

 

此为11gbug,需要在delete后加上force关键字,metalink上有记载

 


Applies To:11gR1-11gR2

RMAN is unable to delete archive logs from database even though they are not needed by CAPTURE process anymore.

Changes

Cause

In 11g, RMAN looks at MIN_REQUIRED_CAPTURE_CHANGE# in v$database and not at DBA_CAPTURE. By default this value is updated every 6 hours. So by default the value in v$database will be six hours behind the current value.

Solution

Since changing frequency of update to MIN_REQUIRED_CAPTURE_CHANGE# in v$database can not be controlled, following workaround can be used:

Archive log which are not needed by capture process can be deleted using:


delete noprompt force archivelog all completed before 'sysdate-10/1440';

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24867586/viewspace-713280/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Oracle *names
下一篇: Rman backup step
请登录后发表评论 登录
全部评论

注册时间:2011-02-11

  • 博文量
    167
  • 访问量
    360381