Rman Recovery Guide

Páginas: 8 (1903 palabras) Publicado: 29 de septiembre de 2012
RMAN Recovery Methods
When performing a restore operation, it is best to open two telnet sessions, one for SQL commands, and one for RMAN commands. For the rest of this document, RMAN commands will be prefaced with the RMAN> prompt, and SQL commands will be prefaced with the SQL> prompt. A $ indicates that the command is executed from the Unix prompt.
Restoring and Recovering All DatafilesIn this scenario, it is assumed that your control files are still accessible. You have a backup, done for example with backup database plus archivelog;
Your first step is to make sure that the target database is shut down:
$ sqlplus “/ as SYSDBA”
SQL> shutdown abort;
ORACLE instance shut down.
Next, you need to start up your target database in mount mode. RMAN cannot restore datafilesunless the database is at least in mount mode, because RMAN needs to be able to access the control file to determine which backup sets are necessary to recover the database. If the control file isn't available, you have to recover it first. Issue the STARTUP MOUNT command shown in the following example to mount the database:
SQL> startup mount;
Oracle instance started.
Database mounted.
Sincebackup set files are created in an RMAN-specific format, you must use RMAN to restore the datafiles. To use RMAN, connect to the target database:
$ rman target / rcvcat rcvcat/rcvcat@oemprod
The remainder of this example shows how to restore all of the datafiles of the target database. When the restore command is executed, RMAN will automatically go to its last good backup set and restore thedatafiles to the state they were in when that backup set was created.
When restoring database files, RMAN reads the datafile header and makes the determination as to whether the file needs to be restored. The recovery is done by allocating a channel for I/O and then issuing the RMAN restore database command.
With Oracle9i and above, you don't need to allocate a channel explicitly. Instead, youcan use the default channel mode:
RMAN> restore database;
RMAN> recover database;
SQL> alter database open;
For Oracle8i, the ALLOCATE, RESTORE, and RECOVER commands need to be enclosed by the run{} command:
RMAN> run {
  allocate channel d1 type disk;
  restore database;
  recover database;
}
alter database open;
Once the recovery has been completed, execute a complete RMAN backup toestablish a new baseline.
Restoring Specific Tablespaces
In this scenario, it is assumed that your control files are still accessible. You have a backup, done for example with backup database plus archivelog;
Take the tablespace that needs recovery offline, restore the tablespace, recover the tablespace, and bring the tablespace online. If you cannot take the tablespace offline, then shutdownabort the database and restore in mount mode.
First try to take the tablespace offline;
$ sqlplus "/ as sysdba"
SQL> alter tablespace tab offline;
If this works, continue with the RMAN recovery:
$ rman target / rcvcat rcvcat/rcvcat@oemprod
RMAN> restore tablespace tab;
RMAN> recover tablespace tab;
SQL> alter tablespace tab online;
If taking the tablespace offline fails, follow thesesteps:
$ sqlplus “/ as SYSDBA”
SQL> shutdown abort;
SQL> startup mount;
$ rman target / rcvcat rcvcat/rcvcat@oemprod
RMAN> restore tablespace tab;
RMAN> recover tablespace tab;
SQL> alter database open;
Once the recovery has been completed, execute a complete RMAN backup to establish a new baseline.
Restoring Specific Datafiles
In this scenario, it is assumed that your control files arestill accessible. You have a backup, done for example with backup database plus archivelog;
Take the datafile that needs recovery offline, restore the datafile, recover the datafile, and bring the datafile online. If you cannot take the datafile offline, then shutdown abort the database and restore in mount mode.
First try to take the datafile offline:
SQL> alter database datafile...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Stroke recovery guide
  • Recovery
  • recovery
  • Recovery
  • recovery
  • Guide
  • Guido
  • Guido

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS