做一个简单的采用批命令方式备份数据库。
连接到RMAN中:
[oracle@LabOracle ~]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on ÐÇÆÚÈý 3ÔÂ 2 20:16:08 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到目标数据库:
RMAN> connect target /
connected to target database: ORCL (DBID=1267670310)
批命令对数据库进行备份:
RMAN> run{
2> allocate channel cha1 type disk;
3> backup format '/oracle/flash_recovery_area/ORCL/backupset/full_%t'
4> tag full_backup_bat
5> database;
6> release channel cha1;
7> }
其中allocate是定义备份通道,release 是释放备份通道,此处主要做的是全局数据库备份。
一个典型的增量备份案例如下:
星期天晚上 -level 0 backup performed
星期一晚上 -level 2 backup performed
星期二晚上 -level 2 backup performed
星期三晚上 -level 1 backup performed
星期四晚上 -level 2 backup performed
星期五晚上 -level 2 backup performed
星期六晚上 -level 2 backup performed
备份脚本: