1) Setup RMAN variables (show all):
CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN auto backup for control file and spfile (if used to start the database).
CONFIGURE BACKUP OPTIMIZATION OFF; # default
RMAN skips backups of archived logs and Read Only Tablespaces that have already backed up.
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
Archivelog deletetions when you have standby databases.
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
Setup parallelism for a device type specifies the number of server sessions to be used for I/O to that device type.
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+RAC_Sharelocation/snapcf_jdb.f'';
RMAN creates a copy of the control file for read consistency, this is the snapshot controlfile.
Due to the changes made to the controlfile backup mechanism in 11gR2 any instances in the cluster may write to the snapshot controlfile. Therefore, the snapshot controlfile file needs to be visible to all instances.In 11gR2 onwards, the controlfile backup happens without holding the control file enqueue.
For non-RAC database, this doesn't change anything.But, for RAC database, the snapshot controlfile location must be in a shared file system that will be accessible from all the nodes.
The snapshot controlfile MUST be accessible by all nodes of a RAC database.
2) RMAN weekly full backup script :rman target / << EOF
run {
crosscheck backup;
crosscheck archivelog all;
allocate channel c1 type disk format '/bkup/%d/rman/rman_%d_inc0_%T_%u.bk';
allocate channel c2 type disk format '/bkup/%d/rman/rman_%d_inc0_%T_%u.bk';
backup incremental level=0 as [COMPRESSED] BACKUPSET database;
sql 'alter system archive log current';
backup current controlfile format '/bkup/%d/rman/rman_%d_ctl_%T_%u.bk';
release channel c1;
release channel c2;
delete noprompt backup completed before 'SYSDATE-14';
delete noprompt archivelog until time 'SYSDATE-2';
}
EOF
2)Differential backup - FASTER BACKUP but thet take longer at recovery. It need a full backup and all differential backup for recovery:
backup incremental level 1 database; (default backp type is differential)
3)Cumulative backup - FASTER RESTORE - It needs full (level 0) backup and last cumulative
(level 1) backup for recovery:
backup incremental level 1 CUMULATIVE as BACKUPSET database
5) crosscheck archivelog all : RMAN will check the archivelogs whether they are physically available on disk.If the archivelogs are no longer on disk, then the status in the rman catalog and controlfile will be marked from"A" (available) to "X" (expired).
crosscheck archivelog all;
delete expired archivelog all;
crosscheck backup;
corsscheck copy;
RMAN error messages:
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
6) Delete old archivelog files using rman:
delete noprompt archivelog until time 'SYSDATE-1';
7) LIST : use for rman repository to provide lists of backups, archived logs, and database incarnations :list backup;
list backupset;
list copy;
list expired backup;
list incarnation of database;
No comments:
Post a Comment