Case 7:
--Recovery with incremental backups
1) Establish an incremental backup
-------0-level backup using image backup as an incremental backup
rman> copy datafile 2 to '/disk1/rman/prod/users_%s.bak ';
2) Establish a level 2 differential backup
--------test Environment
08:05:52 sql> Conn Scott/tiger
Connected.
08:05:58 sql>
08:05:58 sql> INSERT INTO the EMP1 select * from EMP1;
4 rows created.
08:06:00 sql>/
8 rows created.
08:06:01 sql> commit;
Commit complete.
08:06:03 sql>
Rman> Backup Incremental Level 2 format '/disk1/rman/prod/users_2_%s.bak ' DataFile 2;
Rman> list Backup of DataFile 2;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion time
------- ---- -- ---------- ----------- ------------ ---------------
Notoginseng Incr 2 528.00K DISK 00:00:00 18-aug-11
BP key:37 status:available Compressed:no tag:tag20110818t080650
Piece Name:/disk1/rman/prod/users_2_42.bak
List of Datafiles in backup set 37
File LV Type Ckp SCN Ckp time Name
---- -- ---- ---------- --------- ----
2 2 Incr 1404665 18-aug-11/u01/app/oracle/oradata/prod/users01.dbf
3) Establish a Level 2 differential backup
08:06:03 sql> INSERT INTO the EMP1 select * from EMP1;
Rows created.
08:07:49 sql>/
Rows created.
08:07:51 sql> commit;
Commit complete.
08:07:53 sql>
Rman> Backup Incremental Level 2 format '/disk1/rman/prod/users_2_%s.bak ' DataFile 2;
4) Establish a cumulative incremental backup
08:07:53 sql> INSERT INTO the EMP1 select * from EMP1;
Created rows.
08:08:55 sql>/
128 rows created.
08:08:55 sql> commit;
Commit complete.
08:08:57 sql>
Rman> Backup Incremental Level 1 cumulative format '/disk1/rman/prod/users_1cu_%s.bak ' DataFile 2;
BS Key Type LV Size Device Type Elapsed Time Completion time
------- ---- -- ---------- ----------- ------------ ---------------
INCR 1 528.00K DISK 00:00:00 18-aug-11
BP key:41 status:available Compressed:no tag:tag20110818t080942
Piece Name:/disk1/rman/prod/users_1cu_46.bak
List of Datafiles in backup set 41
File LV Type Ckp SCN Ckp time Name
---- -- ---- ---------- --------- ----
2 1 Incr 1404815 18-aug-11/u01/app/oracle/oradata/prod/users01.dbf
--------------Recovery
1) test environment
08:08:57 sql> Select COUNT (*) from EMP1;
COUNT (*)
----------
256
08:10:33 sql> shutdown Abort
[Oracle@work ~]$ rm/u01/app/oracle/oradata/prod/users01.dbf
2) Start the database
08:10:52 sql> Startup