日期:2014-05-16  浏览次数:20477 次

RMAN常用命令汇总

???? RMAN是Oracle数据库备份管理中必须用到的管理工具。它的操作方式有很多种,我整理了一些常用的操作命令,汇总起来,以方便工作。

?

(miki西游 @mikixiyou 文档,原文链接: http://mikixiyou.iteye.com/blog/1560754 )

1备份数据库操作命令

简洁版

? backup database plus archivelog format '/backup/rman/xx_%U.%T';

?

正规版

run {

allocate channel t1 type disk;

backup database format '/backup/rman/xx_%U.%T';

backup archivelog all delete input format '/backup/rman/xx_%U.%T';

sql 'alter system archive log current';

backup current controlfile format '/backup/rman/xx_%U.%T';

release channel t1;

}

?

加强版

?

run

{

delete noprompt obsolete;

allocate channel ch01 type disk rate 40M;

backup database filesperset 3 format '/backup/servdb_rman/db_%U.%T';

sql 'alter system archive log current';

backup archivelog like '+%' filesperset 20 format '/backup/servdb_rman/archivelog_%U.%T';

delete noprompt archivelog until time 'sysdate -1';

backup current controlfile format '/backup/servdb_rman/ctl_%U.%T' ;

release channel ch01;

}

?

2归档日志单独备份操作命令

?

不删除归档日志文件

run {

allocate channel t1 type disk;

backup archivelog all format '/backup/servdb_rman/archivelog_%U.%T';

release channel t1;

}

?

删除归档日志文件