Artículos
Rendimiento y Disponibilidad de Base de datos
Por Joel Pérez y Wissem El Khlifi
Publicado en julio 2013
Índice de contenidos
1. RMAN Database 12c: Recuperación de tablas ( Parte I )
2. RMAN Database 12c: Recuperación de tablas ( Parte II )
3. RMAN Database 12c: Recuperación de tablas ( Parte III )
4. RMAN Database 12c: Recuperación de tablas ( Parte IV )
Reciban estimados tecnólogos Oracle un cordial saludo. A través del presente artículo, tendremos la oportunidad de visualizar y adentrarnos un poco en el tema de recuperación de tablas provenientes de respaldos realizados con el utilitario RMAN ( Oracle Recovery Manager ).
“Database12c” la nueva versión de manejador de base de datos de Oracle Corporation, nosotros los tecnólogos Oracle nos preguntábamos “que mas…” podría Oracle adicionar como nuevas características?, de que forma Oracle nos iba a sorprender esta vez y como siempre, las nuevas características y nueva arquitectura no solo nos sorprenden sino que una vez mas nos llevan a otra era…, “Cloud Computing”…
Personalmente he tenido la oportunidad de trabajar con tecnología Oracle como DBA desde su versión 8. 8i la era del internet, 9i la era del internet con mayores elementos, recuerdo que uno de los componentes de mayor importancia fue la presentación de RAC9i “la era naciente de RAC…”, 10g nos sorprendió con el concepto de ASM… y filosofía Grid, 11g & 11g R2 sobre todo por sus mejoras de alto nivel relacionadas con RAC & Data Guard…, 12c… Cloud Computing, nuevas características… mas de 500 las cuales iremos cubriendo gradualmente a través de artículos y otros elementos de ayuda.
Entremos en materia… al momento de plantear una estrategia de respaldo y recuperación son diversos y múltiples los factores a tomar en cuenta para plantear y establecer una excelente estrategia. Y tal como siempre expreso en conferencias, artículos, y otros… “Jamás serás capaz de plantear una excelente estrategia de respaldo sino eres experto recuperando…”, es decir… el planteamiento de una excelente estrategia de recuperación se basa en establecer las condiciones y mecanismos, para poseer en cualquier momento en modo optimo los elementos necesarios para una recuperación rápida y efectiva de la base de datos en forma completa o parcial.
Al momento de plantear una estrategia de recuperación de base de datos se toma en cuenta los factores para una recuperación completa o parcial de la base de datos ( BBDD ), cuando se hace referencia a una recuperación parcial podríamos establecer que la parcialidad podria estar enfocada a: restauración completa de la estructura de la BBDD exceptuando “tablespaces”, TSPITR ( Tablespace Point-in-Time Recovery ) o parcialidad de su contenido ( objetos ) haciendo uso de Oracle “Flashback”.
Previo a la versión de base de datos 12cR1 la recuperación de un objeto no se podía realizar de forma directa desde un respaldo tomado con RMAN. La metodología usual consistía en realizar un “restore/recover” total o parcial de la BBDD y para así con un proceso posterior poder efectuar la extracción del mismo. Algunos mecanismos podrían ser los siguientes:
Algunas de las dificultades o implicaciones con el método anterior estaban basadas en:
Con la nueva característica de recuperación de tablas y particiones de tablas de RMAN Database 12c podremos realizar el proceso de forma directa con una sola línea de comando.
Para llevar a cabo la tarea de utilizar la nueva característica es fundamental contar un respaldo full de los “tablespaces”:
Y el “tablespace” correspondiente que posea la tabla o partición deseada a recuperar.
Los requisitos están basados en los elementos necesarios para conformar una nueva BBDD la cual será denominada como BBDD Auxiliar. La BBDD Auxiliar es una BBDD temporal creada para generar un “Data Pump export dump file” que será objeto de contenido de datos para la obtención finalmente del objeto deseado ( Tabla a Recuperar ). La BBDD Auxiliar no representa una BBDD que deba crearse previo al proceso de la ejecución del comando. La misma es creada de forma automática durante el proceso de “RECOVER” y los mecanismos de acción del mismo comando “RECOVER” remueven la misma al final del proceso.
La recuperación de tablas y/o particiones de tablas provenientes de un respaldo de RMAN son útiles en los siguientes escenarios:
Para la recuperación de tablas se utilizara el ya conocido comando “RECOVER” pero esta vez con funcionalidades nuevas propias de “Oracle Database 12c”. Para llevar a cabo la tarea de recuperación es necesario disponer de la siguiente información:
RMAN utiliza toda esta información para automatizar el proceso de recuperación de las tablas especificadas y/o particiones de tablas especificadas, como parte del proceso de recuperación, RMAN crea una base de datos auxiliar para alojar los objetos a ser restaurados.
Los pasos llevados a cabo por RMAN para la recuperación de tablas y/o particiones de tablas son los siguientes:
Veamos un ejemplo práctico de esta valiosa nueva característica.
Objetivo: Recuperar una tabla perdida en la BBDD “Target” con especial énfasis en las opciones para establecer locaciones diversas para “Datafiles” and “Redo Log files”
Fuente de Datos para la recuperación: Respaldo Realizado con RMAN
Comando a ser aplicado: “RECOVER TABLE”
Antes de proceder con la ejecución del ejemplo, hablemos un poco de la opción ( “REMAP TABLE” ). Cuando se recuperan tablas o particiones de tablas, existe la posibilidad de renombrar los mismos posterior a la operación de “Import”. La clausula “REMAP TABLE” permite renombrar tablas o particiones de tablas en la BBDD “Target”.
Para importar las tablas o particiones de tablas recuperadas en “tablespaces” distintos a los “tablespaces” originales de las mismas se establece la clausula “REMAP TABLESPACE” del comando “RECOVER”. Solo las tablas o particiones de tablas a ser recuperadas pueden ser re-mapeadas, los objetos existentes diversos a los que están siendo recuperados no sufren cambio alguno.
Si se posee una tabla en la BBDD “Target” con el mismo nombre de la tabla que esta siendo recuperada, RMAN desplegara un mensaje indicando que la clausula “REMAP TABLE” debe ser utilizada para adjudicar un nombre nuevo a la tabla que será recuperada.
Es importante destacar que cuando se utiliza la opción “REMAP” los “constraints” e índices con nombres establecidos no son importados para evitar conflictos con los ya existentes.
Nombre de BBDD “Pluggable” a ser usada en nuestro ejemplo: ORAWISS12C
Iniciemos...
Modo “Mount” & “Open” de la BBDD
sandbox1(orawiss):/home/oracle>sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Wed Jun 26 13:31:36 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
CON_ID DBID NAME OPEN_MODE
---------- ---------- ------------------------------ ----------
2 4061740350 PDB$SEED READ ONLY
3 1574282659 ORAWISS12C MOUNTED
SQL> alter PLUGGABLE database ORAWISS12C open;
Pluggable database altered.
SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
CON_ID DBID NAME OPEN_MODE
---------- ---------- ------------------------------ ----------
2 4061740350 PDB$SEED READ ONLY
3 1574282659 ORAWISS12C READ WRITE
SQL>
Creación
Creación de recursos ( usuario, “tablespace” & tabla ) necesarios para el escenario
SQL> alter session set container=ORAWISS12C; Session altered. SQL> create user wissem identified by wissem; User created. SQL> SQL> grant dba to wissem; Grant succeeded. SQL> SQL> CREATE TABLESPACE TBS_REC DATAFILE AUTOEXTEND ON MAXSIZE 100M; Tablespace created. SQL> SQL> create table wissem.test_rec3(ID NUMBER) TABLESPACE TBS_REC; Table created. SQL> SQL> insert into wissem.test_rec3 values (1); 1 row created. SQL> commit; Commit complete. SQL>
Realizando el respaldo de la BBDD
sandbox1(orawiss):/home/oracle>rman Recovery Manager: Release 12.1.0.1.0 - Production on Wed Jun 26 14:43:35 2013 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. RMAN> CONNECT TARGET "sys AS SYSBACKUP"; target database Password: connected to target database: ORAWISS (DBID=3257067578) RMAN> BACKUP PLUGGABLE DATABASE ORAWISS12C; Starting backup at 06/29/2013 06:57:37 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=267 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=35 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=275 device type=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: SID=23 device type=DISK allocated channel: ORA_DISK_5 channel ORA_DISK_5: SID=248 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00009 name=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/DATAFILE/sysaux.275.819112037 channel ORA_DISK_1: starting piece 1 at 06/29/2013 06:57:39 channel ORA_DISK_2: starting full datafile backup set channel ORA_DISK_2: specifying datafile(s) in backup set input datafile file number=00008 name=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/DATAFILE/system.274.819112037 channel ORA_DISK_2: starting piece 1 at 06/29/2013 06:57:40 channel ORA_DISK_3: starting full datafile backup set channel ORA_DISK_3: specifying datafile(s) in backup set input datafile file number=00012 name=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/DATAFILE/tbs_tst.290.819120929 channel ORA_DISK_3: starting piece 1 at 06/29/2013 06:57:40 channel ORA_DISK_4: starting full datafile backup set channel ORA_DISK_4: specifying datafile(s) in backup set input datafile file number=00013 name=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/DATAFILE/tbs_rec.287.819121381 channel ORA_DISK_4: starting piece 1 at 06/29/2013 06:57:40 channel ORA_DISK_5: starting full datafile backup set channel ORA_DISK_5: specifying datafile(s) in backup set input datafile file number=00010 name=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/DATAFILE/users.277.819112065 channel ORA_DISK_5: starting piece 1 at 06/29/2013 06:57:40 channel ORA_DISK_2: finished piece 1 at 06/29/2013 06:57:44 piece handle=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0_t ag20130629t065739_0.292.819356261 tag=TAG20130629T065739 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:04 channel ORA_DISK_5: finished piece 1 at 06/29/2013 06:57:44 piece handle=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0_t ag20130629t065739_0.288.819356261 tag=TAG20130629T065739 comment=NONE channel ORA_DISK_5: backup set complete, elapsed time: 00:00:04 channel ORA_DISK_1: finished piece 1 at 06/29/2013 06:57:48 piece handle=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0_t ag20130629t065739_0.293.819356261 tag=TAG20130629T065739 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:09 channel ORA_DISK_3: finished piece 1 at 06/29/2013 06:57:48 piece handle=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0_t ag20130629t065739_0.291.819356261 tag=TAG20130629T065739 comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 00:00:08 channel ORA_DISK_4: finished piece 1 at 06/29/2013 06:57:48 piece handle=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0_t ag20130629t065739_0.289.819356261 tag=TAG20130629T065739 comment=NONE channel ORA_DISK_4: backup set complete, elapsed time: 00:00:08 Finished backup at 06/29/2013 06:57:48 Starting Control File and SPFILE Autobackup at 06/29/2013 06:57:48 piece handle=+DATA/ORAWISS/AUTOBACKUP/2013_06_29/s_819356268.315.819356269 comment=NONE Finished Control File and SPFILE Autobackup at 06/29/2013 06:57:49 RMAN>
Perdida de Tabla
Para el presente caso trabajaremos en un escenario donde la tabla a ser recuperada aun existe en la BBDD “Target”, la deformación a los datos pudiesen corresponder al caso de:
Siendo así, la tabla original permanecerá en la BBDD y la tabla a ser recuperada poseerá otro nombre.
También se podrá dar el caso de que la tabla original accidentalmente haya sido removida de la BBDD y para el proceso de “Import” se desee adjudicar un nombre distinto.
Sintaxis
Antes de la ejecución veamos la sintaxis del comando a ser utilizado:
RMAN> RECOVER TABLE username.tablename UNTIL TIME 'TIMESTAMP…' AUXILIARY DESTINATION '/u01/tablerecovery' DATAPUMP DESTINATION '/u01/dpump' DUMP FILE 'tablename.dmp' NOTABLEIMPORT REMAP TABLE 'username.tablename': 'username.new_table_name';
TABLE username.tablename: Tabla objeto de recuperación
UNTIL TIME 'TIMESTAMP…': Tiempo hasta el cual se establecerá la recuperación de la tabla
AUXILIARY DESTINATION: Directorio de alojamiento para la BBDD Auxiliar a ser creada
DATAPUMP DESTINATION: Directorio de alojamiento para el “Data Pump export dump file” a ser generado
DUMP FILE: Nombre de “Data Pump export dump file” a ser generado
NOTABLEIMPORT: Opción de control para establecer el posible restaurado de la tabla y/o particiones en la BBDD “Target”
REMAP TABLE 'username.tablename': 'username.new_table_name': Opción para renombrar la tabla a restaurar en la BBDD “Target”
Ejecución
Note con atención la clausulas principales objeto de la edición IV de esta serie de artículos, las opciones “SET NEWNAME FOR DATABASE” & “SET AUXILIARY INSTANCE PARAMETER FILE”.
Hablemos un poco de ellos antes de dar paso a la ejecución.
“SET NEWNAME FOR DATABASE” es una clausula introducida como nueva característica en la versión 11g del manejador, anterior a “Database 11g” el SET NEWNAME se establecía solo para DATAFILES & TEMPFILES. A partir de la versión 11g de BBDD se puede establecer el mismo para todos los datafiles de la BBDD con un “wildcard” que establezca nombres automáticos para los “datafiles”. Esto optimiza la tarea de adjudicar nombres a los “datafiles”, cuando no existía “SET NEWNAME FOR DATABASE” había la necesidad de preparar scripts personalizados para dar nombres específicos a cada “datafile”, en caso de que las locaciones finales de estas no fuesen las mismas descritas en el “controlfile” o catalogo de RMAN utilizado para un proceso de recuperación o “RMAN Duplicate”. Para el presente caso utilizáremos una locación común a todos los “datafiles” pero el punto importante es divisar el posible uso de SET NEWNAME en el bloque donde se llevara a cabo el comando “RECOVER TABLE” de RMAN, es decir, todo lo anteriormente establecido y conocido para las clausulas SET NEWNAME son totalmente validas y aplicables para ser llevadas a cabo en un bloque donde se intente ejecutar el comando “RECOVER TABLE”.
“SET AUXILIARY INSTANCE PARAMETER FILE” es una opcion disponible desde versions de manejador anteriores lo cual permite establecer parametros temporales a la instancia para la ejecucion del bloque de RMAN en el cual este incluido. Para nuestro escenario lo utilizaremos para demostrar como cambiar los valores por defecto de las locaciones de los “Redo Log Files”
Finalmente respecto al punto de recuperación este caso estará basado en una tabla original llamada “TEST_REC3” y la recuperación será direccionada a una nueva tabla llamada “TEST_REC_NEW_3”
sandbox1(orawiss):/home/oracle/wissem/ORAWISS>cat auxinstparams.ora
LOG_FILE_NAME_CONVERT = '/home/oracle/wissem'
sandbox1(orawiss):/home/oracle>rman
Recovery Manager: Release 12.1.0.1.0 - Production on Sat Jun 29 06:22:47 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
RMAN> CONNECT TARGET "sys AS SYSBACKUP";
target database Password:
connected to target database: ORAWISS (DBID=3257067578)
RMAN> run {
2> SET NEWNAME FOR DATABASE TO '/home/oracle/wissem/%b';
3> SET AUXILIARY INSTANCE PARAMETER FILE TO
'/home/oracle/wissem/ORAWISS/auxinstparams.ora';
4> RECOVER TABLE WISSEM.TEST_REC3 OF PLUGGABLE DATABASE ORAWISS12C UNTIL TIME
"to_date('2013-06-29:06:58:37','YYYY-MM-DD:HH24:MI:SS')"
5> DATAPUMP DESTINATION '/tmp' DUMP FILE 'test3_dump.dmp' REMAP TABLE
'WISSEM'.'TEST_REC3':'TEST_REC_NEW_3';
6> }
executing command: SET NEWNAME
executing command: SET auxiliary parameter file
using target database control file instead of recovery catalog
Starting recover at 06/29/2013 09:25:55
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=248 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=276 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=34 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=274 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=44 device type=DISK
RMAN-05026: WARNING: presuming following set of tablespaces applies to specified
Point-in-Time
List of tablespaces expected to have UNDO segments
Tablespace SYSTEM
Tablespace UNDOTBS1
Creating automatic instance, with SID='slFe'
using contents of file /home/oracle/wissem/ORAWISS/auxinstparams.ora
initialization parameters used for automatic instance:
db_name=ORAWISS
db_unique_name=slFe_pitr_ORAWISS12C_ORAWISS
compatible=12.1.0.0.0
db_block_size=8192
db_files=200
sga_target=1G
processes=80
diagnostic_dest=/opt/app/oracle
#No auxiliary destination in use
enable_pluggable_database=true
_clone_one_pdb_recovery=true
ifile=/home/oracle/wissem/ORAWISS/auxinstparams.ora
starting up automatic instance ORAWISS
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2296576 bytes
Variable Size 281019648 bytes
Database Buffers 780140544 bytes
Redo Buffers 5480448 bytes
Automatic instance created
contents of Memory Script:
{
# set requested point in time
set until time "to_date('2013-06-29:06:58:37','YYYY-MM-DD:HH24:MI:SS')";
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET until clause
Starting restore at 06/29/2013 09:26:08
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=82 device type=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: SID=12 device type=DISK
allocated channel: ORA_AUX_DISK_3
channel ORA_AUX_DISK_3: SID=84 device type=DISK
allocated channel: ORA_AUX_DISK_4
channel ORA_AUX_DISK_4: SID=13 device type=DISK
allocated channel: ORA_AUX_DISK_5
channel ORA_AUX_DISK_5: SID=85 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece
+DATA/ORAWISS/AUTOBACKUP/2013_06_29/s_819356268.315.819356269
channel ORA_AUX_DISK_1: piece
handle=+DATA/ORAWISS/AUTOBACKUP/2013_06_29/s_819356268.315.819356269
tag=TAG20130629T065748
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:06
output file name=/opt/app/oracle/product/12.1/db_1/dbs/cntrlslFe.dbf
Finished restore at 06/29/2013 09:26:17
sql statement: alter database mount clone database
sql statement: alter system archive log current
contents of Memory Script:
{
# set requested point in time
set until time "to_date('2013-06-29:06:58:37','YYYY-MM-DD:HH24:MI:SS')";
# set destinations for recovery set and auxiliary set datafiles
set newname for datafile 1 to
"/home/oracle/wissem/system.258.819111197";
set newname for datafile 4 to
"/home/oracle/wissem/undotbs1.260.819111263";
set newname for datafile 3 to
"/home/oracle/wissem/sysaux.257.819111131";
set newname for datafile 8 to
"/home/oracle/wissem/system.274.819112037";
set newname for datafile 9 to
"/home/oracle/wissem/sysaux.275.819112037";
set newname for tempfile 1 to
"/home/oracle/wissem/temp.269.819111301";
set newname for tempfile 3 to
"/home/oracle/wissem/temp.276.819112043";
# switch all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 1, 4, 3, 8, 9;
switch clone datafile all;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to /home/oracle/wissem/temp.269.819111301 in control file
renamed tempfile 3 to /home/oracle/wissem/temp.276.819112043 in control file
renamed tempfile 2 to /home/oracle/wissem/pdbseed_temp01.dbf in control file
Starting restore at 06/29/2013 09:26:24
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3
using channel ORA_AUX_DISK_4
using channel ORA_AUX_DISK_5
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to
/home/oracle/wissem/system.258.819111197
channel ORA_AUX_DISK_1: restoring datafile 00004 to
/home/oracle/wissem/undotbs1.260.819111263
channel ORA_AUX_DISK_1: restoring datafile 00003 to
/home/oracle/wissem/sysaux.257.819111131
channel ORA_AUX_DISK_1: reading from backup piece
+DATA/ORAWISS/BACKUPSET/2013_06_26/nnndf0_tag20130626t123856_0.282.819117537
channel ORA_AUX_DISK_2: starting datafile backup set restore
channel ORA_AUX_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_2: restoring datafile 00008 to
/home/oracle/wissem/system.274.819112037
channel ORA_AUX_DISK_2: reading from backup piece
+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0_tag201
30629t065739_0.292.819356261
channel ORA_AUX_DISK_3: starting datafile backup set restore
channel ORA_AUX_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_3: restoring datafile 00009 to
/home/oracle/wissem/sysaux.275.819112037
channel ORA_AUX_DISK_3: reading from backup piece
+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0_tag201
30629t065739_0.293.819356261
channel ORA_AUX_DISK_2: piece
handle=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0
_tag20130629t065739_0.292.819356261 tag=TAG20130629T065739
channel ORA_AUX_DISK_2: restored backup piece 1
channel ORA_AUX_DISK_2: restore complete, elapsed time: 00:00:08
channel ORA_AUX_DISK_1: piece
handle=+DATA/ORAWISS/BACKUPSET/2013_06_26/nnndf0_tag20130626t123856_0.282.8191175
37 tag=TAG20130626T123856
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_AUX_DISK_3: piece
handle=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0
_tag20130629t065739_0.293.819356261 tag=TAG20130629T065739
channel ORA_AUX_DISK_3: restored backup piece 1
channel ORA_AUX_DISK_3: restore complete, elapsed time: 00:00:17
Finished restore at 06/29/2013 09:26:41
datafile 1 switched to datafile copy
input datafile copy RECID=10 STAMP=819365202 file
name=/home/oracle/wissem/system.258.819111197
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=819365202 file
name=/home/oracle/wissem/undotbs1.260.819111263
datafile 3 switched to datafile copy
input datafile copy RECID=12 STAMP=819365202 file
name=/home/oracle/wissem/sysaux.257.819111131
datafile 8 switched to datafile copy
input datafile copy RECID=13 STAMP=819365202 file
name=/home/oracle/wissem/system.274.819112037
datafile 9 switched to datafile copy
input datafile copy RECID=14 STAMP=819365202 file
name=/home/oracle/wissem/sysaux.275.819112037
contents of Memory Script:
{
# set requested point in time
set until time "to_date('2013-06-29:06:58:37','YYYY-MM-DD:HH24:MI:SS')";
# online the datafiles restored or switched
sql clone "alter database datafile 1 online";
sql clone "alter database datafile 4 online";
sql clone "alter database datafile 3 online";
sql clone 'ORAWISS12C' "alter database datafile
8 online";
sql clone 'ORAWISS12C' "alter database datafile
9 online";
# recover and open database read only
recover clone database tablespace "SYSTEM", "UNDOTBS1", "SYSAUX",
"ORAWISS12C":"SYSTEM", "ORAWISS12C":"SYSAUX";
sql clone 'alter database open read only';
}
executing Memory Script
executing command: SET until clause
sql statement: alter database datafile 1 online
sql statement: alter database datafile 4 online
sql statement: alter database datafile 3 online
sql statement: alter database datafile 8 online
sql statement: alter database datafile 9 online
Starting recover at 06/29/2013 09:26:43
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3
using channel ORA_AUX_DISK_4
using channel ORA_AUX_DISK_5
starting media recovery
archived log for thread 1 with sequence 15 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_15.279.819117567
archived log for thread 1 with sequence 16 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_16.278.819123911
archived log for thread 1 with sequence 17 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_17.294.819123955
archived log for thread 1 with sequence 18 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_18.296.819123981
archived log for thread 1 with sequence 19 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_19.295.819124251
archived log for thread 1 with sequence 20 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_20.297.819124297
archived log for thread 1 with sequence 21 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_21.299.819124453
archived log for thread 1 with sequence 22 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_22.286.819125213
archived log for thread 1 with sequence 23 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_23.281.819125305
archived log for thread 1 with sequence 24 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_24.280.819125733
archived log for thread 1 with sequence 25 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_25.300.819126163
archived log for thread 1 with sequence 26 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_26.302.819126453
archived log for thread 1 with sequence 27 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_27.303.819126779
archived log for thread 1 with sequence 28 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_28.304.819127037
archived log for thread 1 with sequence 29 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_29.305.819127245
archived log for thread 1 with sequence 30 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_30.306.819127355
archived log for thread 1 with sequence 31 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_31.307.819127743
archived log for thread 1 with sequence 32 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_32.308.819147661
archived log for thread 1 with sequence 33 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_33.309.819151283
archived log for thread 1 with sequence 34 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_34.283.819151373
archived log for thread 1 with sequence 35 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_35.310.819154805
archived log for thread 1 with sequence 36 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_36.311.819162069
archived log for thread 1 with sequence 37 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_37.312.819162155
archived log for thread 1 with sequence 38 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_38.313.819162215
archived log for thread 1 with sequence 39 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_39.317.819198033
archived log for thread 1 with sequence 40 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_40.318.819237639
archived log for thread 1 with sequence 41 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_28/thread_1_seq_41.319.819244815
archived log for thread 1 with sequence 42 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_28/thread_1_seq_42.320.819270063
archived log for thread 1 with sequence 43 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_28/thread_1_seq_43.321.819313233
archived log for thread 1 with sequence 44 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_28/thread_1_seq_44.322.819324105
archived log for thread 1 with sequence 45 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_45.323.819334825
archived log for thread 1 with sequence 46 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_46.324.819352847
archived log for thread 1 with sequence 47 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_47.298.819354187
archived log for thread 1 with sequence 48 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_48.301.819354219
archived log for thread 1 with sequence 49 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_49.316.819356435
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_15.279.819117567 thread=1
sequence=15
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_16.278.819123911 thread=1
sequence=16
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_17.294.819123955 thread=1
sequence=17
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_18.296.819123981 thread=1
sequence=18
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_19.295.819124251 thread=1
sequence=19
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_20.297.819124297 thread=1
sequence=20
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_21.299.819124453 thread=1
sequence=21
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_22.286.819125213 thread=1
sequence=22
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_23.281.819125305 thread=1
sequence=23
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_24.280.819125733 thread=1
sequence=24
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_25.300.819126163 thread=1
sequence=25
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_26.302.819126453 thread=1
sequence=26
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_27.303.819126779 thread=1
sequence=27
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_28.304.819127037 thread=1
sequence=28
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_29.305.819127245 thread=1
sequence=29
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_30.306.819127355 thread=1
sequence=30
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_31.307.819127743 thread=1
sequence=31
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_32.308.819147661 thread=1
sequence=32
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_33.309.819151283 thread=1
sequence=33
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_34.283.819151373 thread=1
sequence=34
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_26/thread_1_seq_35.310.819154805 thread=1
sequence=35
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_36.311.819162069 thread=1
sequence=36
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_37.312.819162155 thread=1
sequence=37
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_38.313.819162215 thread=1
sequence=38
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_39.317.819198033 thread=1
sequence=39
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_27/thread_1_seq_40.318.819237639 thread=1
sequence=40
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_28/thread_1_seq_41.319.819244815 thread=1
sequence=41
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_28/thread_1_seq_42.320.819270063 thread=1
sequence=42
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_28/thread_1_seq_43.321.819313233 thread=1
sequence=43
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_28/thread_1_seq_44.322.819324105 thread=1
sequence=44
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_45.323.819334825 thread=1
sequence=45
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_46.324.819352847 thread=1
sequence=46
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_47.298.819354187 thread=1
sequence=47
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_48.301.819354219 thread=1
sequence=48
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_49.316.819356435 thread=1
sequence=49
media recovery complete, elapsed time: 00:00:58
Finished recover at 06/29/2013 09:27:44
sql statement: alter database open read only
contents of Memory Script:
{
sql clone 'alter pluggable database ORAWISS12C open read only';
}
executing Memory Script
sql statement: alter pluggable database ORAWISS12C open read only
contents of Memory Script:
{
sql clone "create spfile from memory";
shutdown clone immediate;
startup clone nomount;
shutdown clone immediate;
startup clone nomount;
# mount database
sql clone 'alter database mount clone database';
}
executing Memory Script
sql statement: create spfile from memory
database closed
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2296576 bytes
Variable Size 285213952 bytes
Database Buffers 775946240 bytes
Redo Buffers 5480448 bytes
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2296576 bytes
Variable Size 285213952 bytes
Database Buffers 775946240 bytes
Redo Buffers 5480448 bytes
sql statement: alter database mount clone database
contents of Memory Script:
{
# set requested point in time
set until time "to_date('2013-06-29:06:58:37','YYYY-MM-DD:HH24:MI:SS')";
# set destinations for recovery set and auxiliary set datafiles
set newname for datafile 13 to
"/home/oracle/wissem/tbs_rec.287.819121381";
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 13;
switch clone datafile all;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
Starting restore at 06/29/2013 09:28:27
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=15 device type=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: SID=86 device type=DISK
allocated channel: ORA_AUX_DISK_3
channel ORA_AUX_DISK_3: SID=16 device type=DISK
allocated channel: ORA_AUX_DISK_4
channel ORA_AUX_DISK_4: SID=87 device type=DISK
allocated channel: ORA_AUX_DISK_5
channel ORA_AUX_DISK_5: SID=17 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00013 to
/home/oracle/wissem/tbs_rec.287.819121381
channel ORA_AUX_DISK_1: reading from backup piece
+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0_tag201
30629t065739_0.289.819356261
channel ORA_AUX_DISK_1: piece
handle=+DATA/ORAWISS/E011004AA64F0CF9E0433514DA0A096B/BACKUPSET/2013_06_29/nnndf0
_tag20130629t065739_0.289.819356261 tag=TAG20130629T065739
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 06/29/2013 09:28:30
datafile 13 switched to datafile copy
input datafile copy RECID=16 STAMP=819365310 file
name=/home/oracle/wissem/tbs_rec.287.819121381
contents of Memory Script:
{
# set requested point in time
set until time "to_date('2013-06-29:06:58:37','YYYY-MM-DD:HH24:MI:SS')";
# online the datafiles restored or switched
sql clone 'ORAWISS12C' "alter database datafile
13 online";
# recover and open resetlogs
recover clone database tablespace "ORAWISS12C":"TBS_REC", "SYSTEM", "UNDOTBS1",
"SYSAUX", "ORAWISS12C":"SYSTEM", "ORAWISS12C":"SYSAUX" delete archivelog;
alter clone database open resetlogs;
}
executing Memory Script
executing command: SET until clause
sql statement: alter database datafile 13 online
Starting recover at 06/29/2013 09:28:30
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3
using channel ORA_AUX_DISK_4
using channel ORA_AUX_DISK_5
starting media recovery
archived log for thread 1 with sequence 49 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_49.316.819356435
archived log for thread 1 with sequence 50 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_50.326.819357923
archived log for thread 1 with sequence 51 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_51.325.819358071
archived log for thread 1 with sequence 52 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_52.330.819359123
archived log for thread 1 with sequence 53 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_53.331.819359357
archived log for thread 1 with sequence 54 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_54.332.819362719
archived log for thread 1 with sequence 55 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_55.333.819362927
archived log for thread 1 with sequence 56 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_56.334.819363603
archived log for thread 1 with sequence 57 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_57.335.819364163
archived log for thread 1 with sequence 58 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_58.336.819364569
archived log for thread 1 with sequence 59 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_59.337.819364897
archived log for thread 1 with sequence 60 is already on disk as file
+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_60.338.819365183
archived log file
name=+DATA/ORAWISS/ARCHIVELOG/2013_06_29/thread_1_seq_49.316.819356435 thread=1
sequence=49
media recovery complete, elapsed time: 00:00:01
Finished recover at 06/29/2013 09:28:33
database opened
contents of Memory Script:
{
sql clone 'alter pluggable database ORAWISS12C open';
}
executing Memory Script
sql statement: alter pluggable database ORAWISS12C open
contents of Memory Script:
{
# create directory for datapump import
sql 'ORAWISS12C' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/tmp''";
# create directory for datapump export
sql clone 'ORAWISS12C' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/tmp''";
}
executing Memory Script
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp''
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp''
Performing export of tables...
EXPDP> Starting "SYS"."TSPITR_EXP_slFe_ibti":
EXPDP> Estimate in progress using BLOCKS method...
EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
EXPDP> Total estimation using BLOCKS method: 64 KB
EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
EXPDP> . . exported "WISSEM"."TEST_REC3" 5.031 KB 1 rows
EXPDP> Master table "SYS"."TSPITR_EXP_slFe_ibti" successfully loaded/unloaded
EXPDP> **********************************************************************
EXPDP> Dump file set for SYS.TSPITR_EXP_slFe_ibti is:
EXPDP> /tmp/test3_dump.dmp
EXPDP> Job "SYS"."TSPITR_EXP_slFe_ibti" successfully completed at Sat Jun 29
09:29:28 2013 elapsed 0 00:00:37
Export completed
contents of Memory Script:
{
# shutdown clone before import
shutdown clone abort
}
executing Memory Script
Oracle instance shut down
Performing import of tables...
IMPDP> Master table "SYSBACKUP"."TSPITR_IMP_slFe_ratz" successfully
loaded/unloaded
IMPDP> Starting "SYSBACKUP"."TSPITR_IMP_slFe_ratz":
IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
IMPDP> . . imported "WISSEM"."TEST_REC_NEW_3" 5.031 KB 1 rows
IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
IMPDP> Job "SYSBACKUP"."TSPITR_IMP_slFe_ratz" successfully completed at Sat
Jun 29 09:30:32 2013 elapsed 0 00:00:36
Import completed
Removing automatic instance
Automatic instance removed
auxiliary instance file /home/oracle/wissem/temp.276.819112043 deleted
auxiliary instance file /home/oracle/wissem/temp.269.819111301 deleted
auxiliary instance file /home/oracle/wissem/group_3.268.819111293 deleted
auxiliary instance file /home/oracle/wissem/group_3.267.819111293 deleted
auxiliary instance file /home/oracle/wissem/group_2.266.819111293 deleted
auxiliary instance file /home/oracle/wissem/group_2.265.819111293 deleted
auxiliary instance file /home/oracle/wissem/group_1.264.819111293 deleted
auxiliary instance file /home/oracle/wissem/group_1.263.819111293 deleted
auxiliary instance file /home/oracle/wissem/tbs_rec.287.819121381 deleted
auxiliary instance file /home/oracle/wissem/sysaux.275.819112037 deleted
auxiliary instance file /home/oracle/wissem/system.274.819112037 deleted
auxiliary instance file /home/oracle/wissem/sysaux.257.819111131 deleted
auxiliary instance file /home/oracle/wissem/undotbs1.260.819111263 deleted
auxiliary instance file /home/oracle/wissem/system.258.819111197 deleted
auxiliary instance file /opt/app/oracle/product/12.1/db_1/dbs/cntrlslFe.dbf
deleted
auxiliary instance file test3_dump.dmp deleted
Finished recover at 06/29/2013 09:30:34
RMAN> exit
Verificado de resultado
La tabla que fue anteriormente borrada fue recuperada por el proceso.
IMPDP> . . imported "WISSEM"."TEST_REC_NEW_3" 5.031 KB 1 rows
sandbox1(orawiss):/home/oracle>sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Wed Jun 26 15:31:36 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
SQL> alter session set container=ORAWISS12C;
Session altered.
SQL> select * from wissem.test_rec_new_3;
ID
----------
1
SQL>
Y los “datafiles” & “Redo Log files” fueron restaurados en la locación indicada:
2> SET NEWNAME FOR DATABASE TO '/home/oracle/wissem/%b'; sandbox1(orawiss):/home/oracle/wissem/ORAWISS>cat auxinstparams.ora LOG_FILE_NAME_CONVERT = '+DATA/ORAWISS/ONLINELOG','/home/oracle/wissem'
Output relacionado con las locaciones adjudicadas:
# set destinations for recovery set and auxiliary set datafiles set newname for datafile 1 to "/home/oracle/wissem/system.258.819111197"; set newname for datafile 4 to "/home/oracle/wissem/undotbs1.260.819111263"; set newname for datafile 3 to "/home/oracle/wissem/sysaux.257.819111131"; set newname for datafile 8 to "/home/oracle/wissem/system.274.819112037"; set newname for datafile 9 to "/home/oracle/wissem/sysaux.275.819112037"; set newname for tempfile 1 to "/home/oracle/wissem/temp.269.819111301"; set newname for tempfile 3 to "/home/oracle/wissem/temp.276.819112043"; … … auxiliary instance file /home/oracle/wissem/group_3.268.819111293 deleted auxiliary instance file /home/oracle/wissem/group_3.267.819111293 deleted auxiliary instance file /home/oracle/wissem/group_2.266.819111293 deleted auxiliary instance file /home/oracle/wissem/group_2.265.819111293 deleted auxiliary instance file /home/oracle/wissem/group_1.264.819111293 deleted auxiliary instance file /home/oracle/wissem/group_1.263.819111293 deleted
Conclusiones
Tal como se ha señalado en el desarrollo del artículo, esta nueva característica nos brinda la facilidad de recuperar tablas y/o particiones de tablas con un proceso directo haciendo uso optimo de recursos como: disco, memoria y otros relacionados con el proceso.
El comando “RECOVER TABLE” no solo tiene impacto en la acción directa que realiza, sino también en como lograra cambiar en concepto del papel que juegan los respaldos lógicos que muchas empresas llevaban a cabo para prevenir la posible recuperación de objetos sin tener que restaurar la BBDD completa.
Antes de finalizar el presente artículo veamos cuadro comparativo de las ventajas que posee el nuevo “RECOVER TABLE” con respecto a TSPITR ( Tablespace Point-in-Time Recovery )
| Actividad | TSPITR | “RECOVER TABLE” |
| Creación de BBDD para la Recuperación | Debe ser creada manualmente o con el DBCA ( Database Configuration Assistant ) | La BBDD Auxiliar es creada automáticamente |
| Establecimiento de valores para Archivos de Parametros ( SPfile & Init ) | El DBA tomara un tiempo para escoger valores modestos con el objetivo de no sobrecargar el sistema operativo a raíz de esta nueva BBDD a crear | Los valores del archivo de parámetro de la instancia auxiliar son adjudicados de forma automática. Los valores automaticos escogidos son bajos, óptimos y suficientes para llevar a cabo la tarea |
| Proceso de “Restore” de la BBDD | El DBA deberá tomar un tiempo para escoger si el restaurado se llevara a cabo en el mismo servidor donde esta alojada la BBDD de producción o en un servidor alterno. Si decidiese escoger el mismo servidor donde se encuentra la BBDD de producción el método ideal seria utilizar “RMAN Duplicate” para evitar complicaciones de cambios de nombres de la nueva BBDD. Si decidiese utilizar algún otro servidor podría escoger utilizar el mismo nombre de la BBDD de producción u otro alternativo. Hay que destacar que pudiera haber riesgo de perjurio contra la BBDD original si se ejecuta “RMAN Duplicate” existiendo estas 2 condiciones: • Estando la BBDD original con sus “datafiles” en “filesystem” • Valores de conversión mal configurados ( DB_FILE_NAME_CONVERT & LOG_FILE_NAME_CONVERT ) Si esas 2 condiciones sucediesen podría haber el riesgo de que “datafiles” de la BBDD original pudiesen ser sobrescritos. Si el DBA decidiese llevar a cabo “RMAN Duplicate” en el mismo servidor de producción se aconsejaría que el mismo tuviese un alto “expertise” utilizando dicha técnica. | El nombre de la BBDD Auxiliar es adjudicado automáticamente, no existe riesgo alguno de realizar el procedimiento en el mismo servidor de producción siempre y cuando se este atento con el uso de la clausula “NOTABLEIMPORT” |
| Restaurado de “Tablespaces” | El DBA tendrá que tomar una porción de tiempo para determinar en cual “tablespace” se encuentra el objeto a ser recuperado. En modo optimo se podrá utilizar “RESTORE DATABASE” realizando “skip” de tablespaces no deseados, dejando solo los principales de toda BBDD Oracle ( System, Sysaux, Undo, etc… ) y el o los “tablespaces” que contengan la o las tablas a ser recuperadas. Es importante destacar que en el “tablespace” de datos donde se encuentre la(s) tabla(s) a ser recuperadas podrán existir más objetos que conlleven a la necesidad de que el proceso consuma mas espacio en disco y tiempo de restauración. | El proceso de “Restore/Recover” es automático, restaurando solo los “tablespaces” principales de la BBDD y el “tablespace” que contenga la(s) tabla(s) a ser recuperadas pero en dicho “tablespace” de datos solo se encontrara(n) el o los objetos deseados de recuperación. Por lo tanto el proceso es óptimo en espacio en disco y tiempo de restauración. |
| Generación de “Data Pump export dump file” | El DBA a través de un proceso manual deberá crear un directorio ( “Create Directory …” ) y realizara manualmente el proceso de exportar y/o importar la tabla en la BBDD original o también llamada “Target” | El proceso de creación del directorio, “export” e “import” es automático y todo se configura en el mismo comando “RECOVER TABLE” |
| Remoción de la BBDD | El DBA deberá remover la BBDD manualmente o a través del DBCA | El proceso del comando “RECOVER TABLE” remueve automáticamente la BBDD Auxiliar creada |
Joel es un experto en DBA con más de 12 años de experiencia, especializado en las áreas de bases de datos con especial énfasis en la solución de alta disponibilidad (RAC, Data Guard, y otros). Es un conferencista habitual en eventos de Oracle como: OTN LAD TOUR y otros. Es el primer latinoamericano en ser nombrado "Experto OTN" en el año 2003 y Oracle ACE Director.
Wissem es un Senior DBA con más de 12 años de experiencia, especializado en soluciones RAC & Data Guard. Actualmente labora para “Schneider Electric / APC Global operations”. Wissem ha trabajado también para varias empresas internacionales líderes en sectores de Bancas, Telecomunicaciones, Internet y Energía. Wissem fue el primer Oracle ACE en España y es un OCP DBA.