To back up a data file:
Sql> Select file_id, file_name from Dba_data_files; Backup: Standby (Backup) datafile: Data file backup tablespace: Backing up table Space Backup database: backing up databases
rman> backup DataFile 4;
Rman> backup DataFile 4, 5;
rman> backup datafile '/u01/app/oracle/oradata/orcl/users01.dbf ';
rman> backup tablespace users;
Rman> Backup tablespace users, example; Comma delimited
rman> backup Database;
rman> list backup;
Desc V$backup_set, Browser view backup
Incremental Backup:
rman> Backup incremental level 0 tablespace users; incremental: The increment must be followed by the
rman> list Backup of tablespace users;
sql> CREATE TABLE t1 (x int) tablespace users;
sql> INSERT INTO T1 values (1);
Sql> commit;
Rman> Backup Incremental level 1 tablespace users;
Rman> Backup Incremental level 1 tablespace users;
sql> CREATE TABLE t2 (x int) tablespace users;
sql> INSERT INTO T2 values (1);
Sql> commit;
Rman> Backup Incremental Level 1 cumulative tablespace users;
rman> List Backup of tablespace users;
Incremental update:
sql> CREATE TABLE t1 (x int) tablespace users;
sql> INSERT INTO T1 values (1);
Sql> commit;
Rman> Backup incremental Level 1 for recover (recovery) of copy with Tag (label) ' Update_copy ' tablespace users; first time to create 0 levels of backup
Rman> list (list) copy; record time and SCN
sql> INSERT INTO T1 values (2);
Sql> commit;
Rman> Backup incremental Level 1 for recover of the copy with tag ' update_copy ' tablespace users; the 2nd time you create a 1-tier backup
Rman> List Backup;backupset format
rman> recover copy of tablespace users with tag ' update_copy ';
Rman> list Copy;time and SCN updates
Script form:
Rman> Run {
Backup incremental Level 1 for recover of the copy with tag ' update_copy ' tablespace users;
Recover copy of tablespace users with tag ' update_copy ';
}
Backup Archive log:
rman> list Archivelog all;
rman> Backup Archivelog all delete all input;
rman> list Archivelog all;
rman> list backup;
View:
rman> list backup; Viewing a backup Set
rman> list copy; Looking at a mirrored copy
Rman> list Backup of tablespace users;
Rman> list Backup of datafile 4;
rman> list Archivelog all; View all archived logs
Check Backup:
rman> delete backup; Show All: view Rman Various configurations report: reports
rman> Delete copy;
rman> list backup;list copy;
Rman> report need backup; Based on policy check
rman> backup tablespace users;
Rman> report need backup;
Rman> CONFIGURE RETENTION POLICY to redundancy 2;
Rman> report need backup;
Rman> CONFIGURE RETENTION POLICY Clear;
Rman> report obsolete; Deletion of redundant >1
To delete a backup:
rman> Delete Backupset of tablespace users; Specify the deletion of numbers do not delete directly
rman> Delete backupset 1234;
rman> backup tablespace users;
rman> backup tablespace users;
Rman> Show All;
rman> Delete obsolete;
Crosscheck:
rman> Delete backup;
rman> backup tablespace users;
Rman> list Backup of tablespace users;
$ mv/u01/app/oracle/fast_recovery_area/orcl/backupset/... Renamed
rman> restore datafile 4; error
Rman> crosscheck Backup;
Rman> list Backup of tablespace users; retirement status
rman> list expired backup;
$ mv/u01/app/oracle/fast_recovery_area/orcl/backupset/... Restore formerly known
Rman> crosscheck Backup;
Rman> list Backup of tablespace users; Available status
rman> Delete expired backup;
Catalog
$ cp/u01/app/oracle/fast_recovery_area/orcl/backupset/... Copy
rman> Delete backup;
Rman> list Backup;backupset disappears
$ mv/u01/app/oracle/fast_recovery_area/orcl/backupset/... Restore formerly known
rman> Catalog recovery Area noprompt;
Rman> List Backup;backupset Recovery
Oracle Course archive, day 14th