Sie sind auf Seite 1von 5

Scripts Back UP ( Rman ) FISICO

# # # # # El siguiente script de BackUP est desarrollado para utilzar con Rman Contempla el BackUP de la base de datos y Control File Contempla el BackUP de los Archive Logs y Archivo de Parametros El script corre con un No Recovery Catalog, y utiliza el Control File como repositorio. Se considera que la BASE DE DATOS comprenden 6 DataFiles.

configure default device type to disk; configure device type disk to parallelism 2; configure retention policy to recovery windows of 30 days; rman target / nocatalog # Domingo Level 0 BackUP y control file run { allocate channel d1 type disk; backup incremental level 0 cumulative filesperset 1 skip inaccessible tag Domingo_Level_0 format c:\disk_A\BKP\Domingo\df_t%t_s%s_p%p (database); # BackUP Copia Imagen del Control File copy current controlfile to c:\disk_A\BKP\Domingo\Ctl\Domingo.ctl; release channel d1; } # Back UP Archivelog y Archivo de Parametros run { allocate channel d2 type disk; sql alter system archive log current; backup filesperst 10 format c:\disk_A\BKP\Domingo\al_t%t_s%s_p%p ( archivelog all delete input ); backup spfile; release channel d2; } # Lunes Level 2 BackUP y control file run { allocate channel d1 type disk; backup incremental level 2 cumulative filesperset 1 skip inaccessible tag Lunes_Level_2 format c:\disk_A\BKP\Lunes\df_t%t_s%s_p%p (database); # BackUP Copia Imagen del Control File copy current controlfile to c:\disk_A\BKP\Lunes\Ctl\Lunes.ctl; release channel d1; }

# Back UP Archivelog y Archivo de Parametros run { allocate channel d2 type disk; sql alter system archive log current; backup filesperst 10 format c:\disk_A\BKP\Lunes\al_t%t_s%s_p%p ( archivelog all delete input ); backup spfile; release channel d2; } # Martes Level 2 BackUP y control file run { allocate channel d1 type disk; backup incremental level 2 cumulative filesperset 1 skip inaccessible tag Martes_Level_2 format c:\disk_A\BKP\Martes\df_t%t_s%s_p%p (database); # BackUP Copia Imagen del Control File copy current controlfile to c:\disk_A\BKP\Martes\Ctl\Martes.ctl; release channel d1; } # Back UP Archivelog y Archivo de Parametros run { allocate channel d2 type disk; sql alter system archive log current; backup filesperst 10 format c:\disk_A\BKP\Martes\al_t%t_s%s_p%p ( archivelog all delete input ); backup spfile; release channel d2; } # Miercoles Level 2 BackUP y control file run { allocate channel d1 type disk; backup incremental level 2 cumulative filesperset 1 skip inaccessible tag Miercoles_Level_2 format c:\disk_A\BKP\Miercoles\df_t%t_s%s_p%p (database); # BackUP Copia Imagen del Control File copy current controlfile to c:\disk_A\BKP\Miercoles\Ctl\Miercoles.ctl; release channel d1; }

# Back UP Archivelog y Archivo de Parametros run { allocate channel d2 type disk; sql alter system archive log current; backup filesperst 10 format c:\disk_A\BKP\Miercoles\al_t%t_s%s_p%p ( archivelog all delete input ); backup spfile; release channel d2; } # Jueves Level 1 BackUP y control file run { allocate channel d1 type disk; backup incremental level 1 cumulative filesperset 1 skip inaccessible tag Jueves_Level_1 format c:\disk_A\BKP\Jueves\df_t%t_s%s_p%p (database); # BackUP Copia Imagen del Control File copy current controlfile to c:\disk_A\BKP\Jueves\Ctl\Jueves.ctl; release channel d1; } # Back UP Archivelog y Archivo de Parametros run { allocate channel d2 type disk; sql alter system archive log current; backup filesperst 10 format c:\disk_A\BKP\Jueves\al_t%t_s%s_p%p ( archivelog all delete input ); backup spfile; release channel d2; } # Viernes Level 2 BackUP y control file run { allocate channel d1 type disk; backup incremental level 2 cumulative filesperset 1 skip inaccessible tag Viernes_Level_2 format c:\disk_A\BKP\Viernes\df_t%t_s%s_p%p (database); # BackUP Copia Imagen del Control File copy current controlfile to c:\disk_A\BKP\Viernes\Ctl\Martes.ctl; release channel d1; }

# Back UP Archivelog y Archivo de Parametros run { allocate channel d2 type disk; sql alter system archive log current; backup filesperst 10 format c:\disk_A\BKP\Viernes\al_t%t_s%s_p%p ( archivelog all delete input ); backup spfile; release channel d2; } # Sabado Level 2 BackUP y control file run { allocate channel d1 type disk; backup incremental level 2 cumulative filesperset 1 skip inaccessible tag Sabado_Level_2 format c:\disk_A\BKP\Sabado\df_t%t_s%s_p%p (database); # BackUP Copia Imagen del Control File copy current controlfile to c:\disk_A\BKP\Sabado\Ctl\Sabado.ctl; release channel d1; } # Back UP Archivelog y Archivo de Parametros run { allocate channel d2 type disk; sql alter system archive log current; backup filesperst 10 format c:\disk_A\BKP\Sabado\al_t%t_s%s_p%p ( archivelog all delete input ); backup spfile; release channel d2; } Scripts Back UP ( Export / Import ) LOGICO

Los das martes / jueves / sbado se realiza la siguiente rutina de Back UP lgico de la Base de Datos. Se tienen en cuenta que ya existe el usurio BackUP creado en la Base de Datos con los roles y privilegios para poder utilizar los utilitarios de exp / imp.

Martes: C:\> exp userid=backup/backup full=y file=db_martes.dmp log=martes.log direct=y


Jueves:

C:\> exp userid=backup/backup full=y file=db_jueves.dmp log=jueves.log direct=y

Sabados: C:\> exp userid=backup/backup full=y file=db_sabado.dmp log=sabado.log direct=y Recuperacin imp userid=backup/backup full=y log=imp.log
Restauracin y recuperacin con RMAN
rman target / nocatalog run { # restauracion de la base de datos a un punto especifico en el tiempo. allocate channel d1 type disk; set until time INGRESAR FECHA Y HORA; # El formato a ingresar deber ser del tipo Feb 20 2005 11:00:00 sql alter database mount; restore database; switch datafile all; recover database; sql alter database open resetlogs; release channel d1; }

Das könnte Ihnen auch gefallen