(Terry) RMAN recovery notes comprehensive learning

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

[Backup Terry notes) RMAN integrated learning

[Restore Terry notes) RMAN integrated learning

[Configure Terry RMAN integrated learning notes)

The basic concept and mechanism, rman recovery

In RMAN 1, recovery has two main action, usually in the mount:

restore: Use the backup set file, replace the damaged data file.
recover: Application of archive or redo, recover the database to the state before the collapse.
2 fully restored or incomplete recovery
Complete recovery is the application of the redo log file and all.
Incomplete recovery is the application files and redo log, the main grammar is restore/recover... Until…, incomplete recovery in open when the required resetlogs.
To find the nearest available backup set 3.rman when the recovery will be (unless the until clause). If the backup set has a backup segment there is a IO error, rman will automatically find the redundancy backup segments, and replication repair, if there is no redundancy, data block before the corresponding to the backup set.
Recover, if the use of the incremental backup, rman will first look for incremental backup.
Two, recovery, case grammar
1 a simple database restore completely example (open archives):
rman target / configure controlfile autobackup on; configure controlfile autobackup format for device type disk to 'c:\backup\%F'; allocate channel c1 device type disk format 'c:\backup\bak_%T_%u_%s_%p'; backup database plus archivelog delete all input format 'c:\backup\bak_%T_%u_%s_%p'; RMAN> shutdown immediate Database closed database has been removed Oracle Instance is closed /*First,rmanThe gift, And close the database, Deletion of system01.dbf, sysaux01.dbf, undotbs01.dbf, users01.dbf, temp, SPFILE, controlfile*/ RMAN> startup nomount; / * even without SPFILE, Using the RMAN database instance will also start to minimum state. */ restore spfile from 'c:\backup\C-197157272-20130906-00'; restore controlfile from 'c:\backup\C-197157272-20130906-00'; /*Because the RMAN backup information recorded in the control file, So we need to specify the recovery catalog when recovery parameter files, control files*/ RMAN> restore database; Start restore In the 06-9Month -13 The distribution of the channel: ORA_DISK_1 Channel ORA_DISK_1: SID=133 The device type=DISK Channel ORA_DISK_1: Are beginning to restore the data file backup set channel ORA_DISK_1: Is the specified data file restore from the backup set channel ORA_DISK_1: The data file 00001 Reduced to C:\U01\ORADATA\KKTERRY\SYSTEM01.DBF Channel ORA_DISK_1: The data file 00002 Reduced to C:\U01\ORADATA\KKTERRY\SYSAUX01.DBF Channel ORA_DISK_1: The data file 00003 Reduced to C:\U01\ORADATA\KKTERRY\UNDOTBS01.DBF Channel ORA_DISK_1: The data file 00004 Reduced to C:\U01\ORADATA\KKTERRY\USERS01.DBF Channel ORA_DISK_1: Reading backup segments C:\BACKUP\BAK_20130906_11OJ5P6K_33_1 Channel ORA_DISK_1: Duan Jubing = C:\BACKUP\BAK_20130906_11OJ5P6K_33_1 Mark = TAG20130906T110244 Channel ORA_DISK_1: The restored backup segments 1 Channel ORA_DISK_1: Restore completed, When in use: 00:00:07 Complete restore In the 06-9Month -13 RMAN> recover database; /*Not successful, Because the deleted redo, There is a need to restore the redo log, If you do not delete redo, Will return to success. */ sqlplus / as sysdba alter database open resetlogs; /*If the non archive mode, need to control file to restore previously backup before executing restore, and in the recover, open resetlogs*/

2 restore tablespace:
sql 'alter tablespace xxx offline immediate';
restore tablespace xxx;
recover tablespace xxx;
sql 'alter tablespace xxx online';
3 restore data files:
sql 'alter database datafile 6 offline';
restore datafile 6;
recover datafile 6;
sql 'alter database datafile 6 onlien';
If the disk is damaged to specify the new location:
set new name for datafile 6 to '/xxx/xxx.dbf';
restore datafile 6;
switch datafile 6;
recover datafile6;
4 restore archived logs, typically logminer or DG libraries need to archive log.
set archivelog destination to '/xxx/xxx';
restore archivelog sequence between 10 and 20;
5 recovery control files and parameters
restore spfile/controlfile from autobackup;
restore spfile/controlfile to '/xxx/xxx' from autobackup;
/*If you modify the default location of the AutoBackup, the RMAN can not find autobuckup*/
1Copy parameters, control. The backup files to the default location$ORACLE_HOME/dbs(linux/unix), $ORACLE_HOME/database(win)
2Manual setting recovery position.: restore spfile/controlfile from '/xxx/xxx';

6 there is no backup file, data file is missing
/*From the data file creation, to the loss, all archive intermediate if in, can not backup can be restored (except system/sysaux/undo/users)*/
alter database create datafile '/xxx/xxx' as '/xxx/xxx';
recover datafile x;

7.redo is missing, the database could not directly or collapse.
/*Unable to backup because of the characteristics of redo, redo, only in the group to do a few members are redundant, if lost will see the character. */
1)Non current loss(v$log, v$logfile): 
startup mount
alter database clear logfile group x;
alter database open;
 2)Current is missing
recover database until cancel;
alter database open resetlogs;
alter system set '_allow_resetlogs_corruption'=true scope=spfile

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Denny at November 30, 2013 - 3:29 AM