Vous êtes sur la page 1sur 5

RECOVERY MANAGER

Ingresando al RMAN
RMAN> rman target/

CONFIGURANDO EL DESTINO Y EL TAMAO DE LOS ARCHIVADOS


Parmetros: db_recovery_file_dest db_recovery_file_dest_size Ejemplo :
DESTINO DEL ARCHIVADO ALTER SYSTEM SET db_recovery_file_dest = 'C:\backup' SCOPE = SPFILE; TAMAO ALTER SYSTEM SET db_recovery_file_dest_size = 2G SCOPE = SPFILE;

REINICIAR LA BD Visualizar con el explorador las carpetas creadas. CONSULTANDO EL CAMBIO: SQL> archive log list; -- Fuerza el registro de archive log file SQL> show parameter recovery_file_dest;

CONFIGURANDO EL RETENTION POLICY


Establece el tiempo que debe mantener las copias del Backup. RMAN> configure retention policy to recovery window of 3 days; RMAN> configure retention policy to redundancy 2; RMAN> show all; SQL> SELECT * FROM V$RMAN_CONFIGURATION; Listando los backups obsoletos RMAN> report obsolete; Cambiar la fecha del sistema y reportear los obsoletos RMAN> report obsolete;

CONFIGURANDO AUTOBACKUP DEL CONTROL FILE


Ejecuta backup automtico del archivo de control cada vez que ejecuta un Backup RMAN> show all; RMAN> configure controlfile autobackup on; RMAN> backup current controlfile; Revisar carpeta c: \backup\autobackup RMAN> configure controlfile autobackup Off; RMAN> report obsolete; RMAN> delete obsolete;

CONFIGURANDO EL DESTINO DEL BACKUP SNAPSHOOT CONTROL FILE


Archivo Controlfile RMAN> show snapshot controlfile name; RMAN> configure snapshot controlfile name to 'C:\Backup\snapcontrolfile.ctl'; RMAN> backup current controlfile; Verificar en la carpeta 'C:\Backup\ el archivo creado RMAN> configure snapshot controlfile name clear;

DIFERENCIAS ENTRE BACKUP SET y BACKUP IMAGE


BACKUP IMAGE: Es una copia tan igual a la que se efectuara con SO. Backup de BD : Backup Tablespace : Backup Datafile : Backup Controlfile: Backup Spfile: BACKUP AS COPY DATABASE; BACKUP AS COPY TABLESPACE xx; BACKUP AS COPY DATAFILE #; BACKUP AS COPY CURRENT CONTROLFILE; BACKUP AS COPY SPFILE;

RMAN> backup archivelog all; BACKUPSET: Es un Backup solo legible por RMAN y puede ser enviado a disco y tape. Backup de BD : Backup Tablespace : Backup Datafile : Backup Controlfile: Backup Spfile: BACKUP AS BACKUPSET DATABASE; BACKUP AS BACKUPSET TABLESPACE xx; ( Backupset ) BACKUP AS BACKUPSET DATAFILE #; ( Backupset ) BACKUP CURRENT CONTROLFILE; ( Backupset ) BACKUP AS BACKUPSET SPFILE;

WHOLE BACKUP
Es un backup complete de la BD ( Datafile + Controlfile ) RMAN> backup database plus archivelog;

PLANIFICANDO BACKUPS INCREMENTALES


Nivel 0 : Full Backup RMAN> backup incremental level 0 as compressed backupset database; RMAN> backup incremental level 0 database;

Nivel 1 : Incremental RMAN> backup incremental level 1 as compressed backupset database; RMAN> backup incremental level 1 database; Nivel 1 : Acumulativo RMAN> backup incremental level 1 cumulative as compressed backupset database; RMAN> backup incremental level 1 cumulative database;

HABILITANDO BLOCK CHANGE TRACKING


Esta opcin active un Nuevo proceso ( CTWR ) que guarda en un archivo plano las direcciones de los bloques modificados desde la ltima copia de backup, con la intencin de acelerar el sgte backup. SQL> alter database enable block change tracking using file c:\backup\traza.dat SQL> select * from v$block_change_tracking;

CROSSCHECK RMAN
RMAN> crosscheck backup; RMAN> crosscheck copy; RMAN> crosscheck archive log;

ELIMINANDO BACKUPS
RMAN> delete obsolete; RMAN> delete copy;

RMAN> delete backupset;

REPORTES DE RMAN
RMAN> list backupset of tablespace users; RMN> list backup summary; Crear un nuevo TABLESPACE ( tbs_comercial ) RMAN> list backupset of tablespace tbs_comercial; RMAN> backup as backupset tablespace tbs_comercial; RMAN> list backupset of tablespace tbs_comercial;

RECOVERY EN EL TIEMPO
Restore database until time to_date( 09/29/2012 2:55, MM/DD/YYYY HH24:MI); Recover database until time to_date( 09/29/2012 2:55, MM/DD/YYYY HH24:MI); Alter database open resetlogs;

RESTAURANDO UN DATAFILE
SQL> ALTER DATABASE DATAFILE 'E:\ORACLE\PRODUCT\10.2.0\DB_2\DATABASE\DF_COMERCIAL' OFFLINE;
RMAN> RESTORE DATAFILE 'E:\ORACLE\PRODUCT\10.2.0\DB_2\DATABASE\DF_COMERCIAL'; RMAN> RECOVER DATAFILE 'E:\ORACLE\PRODUCT\10.2.0\DB_2\DATABASE\DF_COMERCIAL';

SQL> ALTER DATABASE DATAFILE 'E:\ORACLE\PRODUCT\10.2.0\DB_2\DATABASE\DF_COMERCIAL' ONLINE;

RECOVERY data block


RMAN> blockrecover corruption list; RMAN> blockrecover datafile 3 block 4;

CONFIGURACIN PARA COPIAS DE BACKUP EN PARALELO:


Estableciendo RMAN> Configure device type disk parallelism 2; RMAN> configure channel 1 device type disk format 'C:\fra\01\rman1_%U.bk'; RMAN> configure channel 2 device type disk format 'C:\fra\02\rman2_%U.bk';;

CONFIGURANDO BACKUP OPTIMIZACION


Solo backapea archivos que no cambian como los datafiles read only, si ya fue backupeado anteriormente, disminuyendo el tiempo de ejecucin. RMAN> configure backup optimization on; Aplica a datafiles, archive logs y backup sets. RMAN> backup database force; Fuerza el backup a todos los files.