首先清除原来的备份
rman > delete backupset;
接下来开始进行备份
rman > run{
rman > CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
rman > BACKUP OPTIMIZATION ON;
rman > CONTROLFILE AUTOBACKUP ON;
rman > CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'd:/rman_backup/%F';
rman > allocate channel d1 type disk format 'd:/rman_backup/%U;
rman > allocate channel d2 type disk format 'd:/rman_backup|%U;
rman > backup incremental level 0 database filesperset 3 plus archivelog filesperset 10
rman > delete all input;
rman > release channel d1;
rman > release channel d2;
rman >}
这样备份完成,好了接下来对相关的数据进行一些修改,修改后进行下一步,进行一个增量差异备份:
rman > run{
rman > CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
rman > BACKUP OPTIMIZATION ON;
rman > CONTROLFILE AUTOBACKUP ON;
rman > CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'd:/rman_backup/%F';
rman > allocate channel d1 type disk format 'd:/rman_backup/%U;
rman > allocate channel d2 type disk format 'd:/rman_backup|%U;
rman > backup incremental level 1 database filesperset 3 plus archivelog filesperset 10
rman > delete all input;
rman > release channel d1;
rman > release channel d2;
rman >}
备份完成了,shutdown数据库,然后delete掉所有的数据文件,控制文件和redo先保留
sqlplus / as sysdba
SQL > startup mount
C:/Documents and Settings/Administrator>rman nocatalog target /
恢复管理器: Release 10.2.0.1.0 - Production on 星期二 4月 13 22:14:35 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
已连接到目标数据库: LEARN (DBID=2605952657, 未打开)
使用目标数据库控制文件替代恢复目录
RMAN> restore database;
RMAN> recover database;
RMAN> alter database open;
总的来说相当的简单。实验完成