Oracle
12c conserva muchas de las funcionalidades de Backups & Recovery de
versiones anteriores y le agrega nuevas para poder soportar a la Arquitectura
Multitenant.
Además,
Oracle 12c trae también nuevas opciones de Backup & Recovery muy
interesantes como:
- Backups Multiplataforma.
- Recovery Table.
- Mejoras en el clonado desde una base de datos
Activa.
- Mejoras en el manejo de Backups
incrementales.
- Sentencias SQL sobre RMAN
En
este primer artículo (sobre backups) quiero explicar los fundamentos bases de
Backup & Recovery para bases de datos Multitenant.
En
posteriores artículos explicará con más detalle las nuevas funcionalidades que
acabo de nombrar
Lo
primero que debemos de configurar antes de empezar a realizar backups es
activar el modo Archive Log.
Activación del modo Archive log
Como
he explicado en artículos anteriores, para la arquitectura Multitentant es
necesario tener grupos de redologs para el CDB y todos los PDBs. Los grupos de redologs se configuran dentro
del contenedor ROOT.
Dentro
de los redologs se almacenan las transacciones de todas las bases de datos pluggable. Cada transacción posee el identificador del
contenedor para poder reconocer a que base de datos Pluggable pertenece.
Ya que los redologs se almacenan en el contendor ROOT, es necesario contar con la base de datos CDB en modo MOUNT para poder activar el modo Archive.
[oracle@oracle12c ~]$ sqlplus / as
sysdba
SQL*Plus: Release 12.1.0.1.0 Production
on Mon Jun 30 05:06:30 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1068937216
bytes
Fixed Size 2296576 bytes
Variable Size 666895616 bytes
Database Buffers 394264576 bytes
Redo Buffers 5480448 bytes
Database mounted.
Definimos
el Fast Recovery Area
SQL> alter system set
db_recovery_file_dest_size=10G;
System altered.
SQL>
alter system set db_recovery_file_dest='/u03/fast_recovery_area';
System altered.
SQL> show parameter db_recovery_file
NAME TYPE VALUE
------------------------------------
----------- ------------------------
db_recovery_file_dest string /u03/fast_recovery_area
db_recovery_file_dest_size big integer 10G
Una
vez definido el FRA activamos el modo Archive.
SQL> alter database archivelog;
Database altered.
Abrimos
la base de datos CDB y todos los PDBs
SQL> alter database open;
Database altered.
SQL> alter pluggable database ALL
open;
Pluggable database altered.
Verificamos
el modo Archive
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 205
Next log sequence to archive 207
Current log sequence 207
Ejecución de Backups.
La ejecución
de backups depende si estamos conectados en el contendor ROOT o en un PDB.
Opciones de backup en el ROOT
Conectados
al contenedor ROOT podemos realizar los siguientes backups.
1. Backup Full de la base de datos y todos los
PDBs.
RMAN> connect target /
connected to target database: CDB1
(DBID=821677457)
RMAN> CONFIGURE CONTROLFILE
AUTOBACKUP ON;
using target database control file
instead of recovery catalog
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are
successfully stored
RMAN> backup as compressed backupset
database plus archivelog delete input;
Starting backup at 30-JUN-14
current log archived
using target database control file
instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=93 device
type=DISK
channel ORA_DISK_1: starting compressed
archived log backup set
channel ORA_DISK_1: specifying archived
log(s) in backup set
En el
log del backup podemos observar cómo se realiza el backup de todos los
contendores.
2. Backup solo del
contenedor ROOT
RMAN>
backup pluggable database "CDB$ROOT";
Starting backup at 01-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting full
datafile backup set
channel ORA_DISK_1: specifying
datafile(s) in backup set
input datafile file number=00003
name=/u02/oradata/cdb1/sysaux01.dbf
input datafile file number=00001
name=/u02/oradata/cdb1/system01.dbf
input datafile file number=00005
name=/u02/oradata/cdb1/undotbs01.dbf
input datafile file number=00006
name=/u02/oradata/cdb1/users01.dbf
channel ORA_DISK_1: starting piece 1 at
01-JUL-14
channel ORA_DISK_1: finished piece 1 at
01-JUL-14
piece handle=/u03/fast_recovery_area/CDB1/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T041041_9v4yrl5b_.bkp
tag=TAG20140701T041041 comment=NONE
channel ORA_DISK_1: backup set complete,
elapsed time: 00:01:15
Finished backup at 01-JUL-14
3. Backup de los PDBs
definidos en el comando.
RMAN> backup pluggable database PDB1,PDB2;
Starting backup at 01-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting full
datafile backup set
channel ORA_DISK_1: specifying
datafile(s) in backup set
input datafile file number=00008
name=/u02/oradata/cdb1/pdb1/sysaux01.dbf
input datafile file number=00007
name=/u02/oradata/cdb1/pdb1/system01.dbf
input datafile file number=00030
name=/u02/oradata/cdb1/pdb1/data_01_1.dbf
input datafile file number=00011
name=/u02/oradata/cdb1/pdb1/data01.dbf
channel ORA_DISK_1: starting piece 1 at
01-JUL-14
channel ORA_DISK_1: finished piece 1 at
01-JUL-14
piece
handle=/u03/fast_recovery_area/CDB1/FA406513FB2E0E41E0430C0144AC6FEA/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T041823_9v4z6zpy_.bkp
tag=TAG20140701T041823 comment=NONE
channel ORA_DISK_1: backup set complete,
elapsed time: 00:00:45
channel ORA_DISK_1: starting full
datafile backup set
channel ORA_DISK_1: specifying
datafile(s) in backup set
input datafile file number=00010
name=/u02/oradata/cdb1/PDB2/sysaux01.dbf
input datafile file number=00009
name=/u02/oradata/cdb1/PDB2/system01.dbf
channel ORA_DISK_1: starting piece 1 at
01-JUL-14
channel ORA_DISK_1: finished piece 1 at
01-JUL-14
piece
handle=/u03/fast_recovery_area/CDB1/FA40BA2C25DD7EC5E0430C0144ACFAF8/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T041823_9v4z8f4q_.bkp
tag=TAG20140701T041823 comment=NONE
channel ORA_DISK_1: backup set complete,
elapsed time: 00:00:35
Finished backup at 01-JUL-14
4. Backup de tablespace
del contendor ROOT
RMAN> connect target /
connected to target database: CDB1
(DBID=821677457)
RMAN> backup tablespace SYSAUX;
Starting backup at 01-JUL-14
using target database control file
instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=71 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=00003
name=/u02/oradata/cdb1/sysaux01.dbf
channel ORA_DISK_1: starting piece 1 at
01-JUL-14
channel ORA_DISK_1: finished piece 1 at
01-JUL-14
piece
handle=/u03/fast_recovery_area/CDB1/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T043226_9v501ckr_.bkp
tag=TAG20140701T043226 comment=NONE
channel ORA_DISK_1: backup set complete,
elapsed time: 00:00:35
Finished backup at 01-JUL-14
5. Backup de tablespace
de un PDB, desde el contendor ROOT
RMAN> connect target /
connected to target database: CDB1
(DBID=821677457)
RMAN> backup tablespace PDB1:DATA_01;
Starting backup at 01-JUL-14
using target database control file
instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=62 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=00030
name=/u02/oradata/cdb1/pdb1/data_01_1.dbf
channel ORA_DISK_1: starting piece 1 at
01-JUL-14
channel ORA_DISK_1: finished piece 1 at
01-JUL-14
piece
handle=/u03/fast_recovery_area/CDB1/FA406513FB2E0E41E0430C0144AC6FEA/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T044738_9v50xv2v_.bkp
tag=TAG20140701T044738 comment=NONE
channel ORA_DISK_1: backup set complete,
elapsed time: 00:00:01
Finished backup at 01-JUL-14
Opciones de backup conectado a un PDB.
1. Backup de todo el PDB.
[oracle@oracle12c backupset]$ rman
target sys@PDB1
Recovery Manager: Release 12.1.0.1.0 -
Production on Tue Jul 1 05:37:55 2014
Copyright (c) 1982, 2013, Oracle and/or
its affiliates. All rights reserved.
target database Password:
connected to target database: CDB1
(DBID=821677457)
RMAN> backup database;
Starting backup at 01-JUL-14
using target database control file
instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=62 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=00008
name=/u02/oradata/cdb1/pdb1/sysaux01.dbf
input datafile file number=00007
name=/u02/oradata/cdb1/pdb1/system01.dbf
input datafile file number=00030
name=/u02/oradata/cdb1/pdb1/data_01_1.dbf
input datafile file number=00011
name=/u02/oradata/cdb1/pdb1/data01.dbf
channel ORA_DISK_1: starting piece 1 at
01-JUL-14
channel ORA_DISK_1: finished piece 1 at
01-JUL-14
2. Backup de tablespace en el PDB
[oracle@oracle12c backupset]$ rman
target sys@PDBORCL
Recovery Manager: Release 12.1.0.1.0 -
Production on Tue Jul 1 05:41:03 2014
Copyright (c) 1982, 2013, Oracle and/or
its affiliates. All rights reserved.
target database Password:
connected to target database: CDB1
(DBID=821677457)
RMAN> backup tablespace DATA_01;
Starting backup at 01-JUL-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 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=00029
name=/u02/oradata/ORCL/datafile/data_01_1.dbf
channel ORA_DISK_1: starting piece 1 at
01-JUL-14
channel ORA_DISK_1: finished piece 1 at
01-JUL-14
Ejecución de Recuperación.
Con
los backups que hemos realizado podemos realizar los diferentes tipos de recuperación.
Recuperación de los Controlfiles
Simularemos
la pérdida total de los controlfiles
[oracle@oracle12c cdb1]$ ls -l control*
-rw-r----- 1 oracle oinstall 17973248
Jul 1 14:26 control01.ctl
-rw-r----- 1 oracle oinstall 17973248
Jul 1 14:26 control02.ctl
[oracle@oracle12c cdb1]$ rm control*
Bajamos
la base de datos de manera forzada.
SQL>
shut abort
ORACLE
instance shut down.
Nos
conectamos al RMAN y levantamos la base de datos CDB en estado NOMOUNT antes de
recuperar los controlfiles.
RMAN> connect target /
connected to target database (not
started)
RMAN> startup nomount
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2296576 bytes
Variable Size 666895616 bytes
Database Buffers 394264576 bytes
Redo Buffers 5480448 bytes
Realizamos
el restore de los controlfiles de los backups ejecutados.
RMAN> restore controlfile from autobackup;
Starting restore at 01-JUL-14
using target database control file
instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device
type=DISK
recovery area destination:
/u03/fast_recovery_area
database name (or database unique name)
used for search: CDB1
channel ORA_DISK_1: AUTOBACKUP
/u03/fast_recovery_area/CDB1/autobackup/2014_07_01/o1_mf_s_851751712_9v543k20_.bkp
found in the recovery area
AUTOBACKUP search with format
"%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control
file from AUTOBACKUP /u03/fast_recovery_area/CDB1/autobackup/2014_07_01/o1_mf_s_851751712_9v543k20_.bkp
channel ORA_DISK_1: control file restore
from AUTOBACKUP complete
output file
name=/u02/oradata/cdb1/control01.ctl
output file
name=/u02/oradata/cdb1/control02.ctl
Finished
restore at 01-JUL-14
Colocamos
la base de datos en estado MOUNT, recuperamos el CDB y levantamos la base de
datos con Open Resetlogs.
RMAN> alter database MOUNT;
Statement processed
released channel: ORA_DISK_1
RMAN> recover database;
starting media recovery
archived log for thread 1 with sequence
217 is already on disk as file /u02/oradata/cdb1/redo01.log
archived log file
name=/u02/oradata/cdb1/redo01.log thread=1 sequence=217
media recovery complete, elapsed time:
00:00:01
Finished recover at 01-JUL-14
RMAN>
alter database open RESETLOGS;
Statement processed
Recuperación de tablespaces SYSTEM y UNDO
Los
tablespaces SYSTEM y UNDO se deben de restaurar en estado MOUNT. Los
tablespaces pueden pertenecer al contendor ROOT o a un PDB.
Simulamos
la pérdida del UNDO del ROOT y el SYSTEM del PDB1
[oracle@oracle12c cdb1]$ ls -l undo*
-rw-r----- 1 oracle oinstall 781197312
Jul 1 15:37 undotbs01.dbf
[oracle@oracle12c cdb1]$ rm
undotbs01.dbf
[oracle@oracle12c cdb1]$ ls -l
pdb1/system*
-rw-r----- 1 oracle oinstall 283123712
Jul 1 15:35 pdb1/system01.dbf
[oracle@oracle12c cdb1]$ rm ./pdb1/system01.dbf
Iniciamos
la base de datos CDB en estado MOUNT.
RMAN> startup mount;
Oracle instance started
database mounted
Total System Global Area 1068937216 bytes
Fixed Size 2296576 bytes
Variable Size 666895616 bytes
Database Buffers 394264576 bytes
Redo Buffers 5480448 bytes
Realizamos
la restauración del tablespace UNDO
RMAN> restore tablespace UNDOTBS1;
Starting restore at 01-JUL-14
using target database control file
instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device
type=DISK
channel ORA_DISK_1: starting datafile
backup set restore
channel ORA_DISK_1: specifying
datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile
00005 to /u02/oradata/cdb1/undotbs01.dbf
channel ORA_DISK_1: reading from backup
piece
/u03/fast_recovery_area/CDB1/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T150531_9v654cm0_.bkp
channel ORA_DISK_1: piece
handle=/u03/fast_recovery_area/CDB1/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T150531_9v654cm0_.bkp
tag=TAG20140701T150531
channel ORA_DISK_1: restored backup
piece 1
channel ORA_DISK_1: restore complete,
elapsed time: 00:00:55
Finished restore at 01-JUL-14
Realizamos
la restauración del tablespace SYSTEM del PDB1.
RMAN> restore tablespace PDB1:SYSTEM;
Starting restore at 01-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile
backup set restore
channel ORA_DISK_1: specifying
datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile
00007 to /u02/oradata/cdb1/pdb1/system01.dbf
channel ORA_DISK_1: reading from backup
piece
/u03/fast_recovery_area/CDB1/FA406513FB2E0E41E0430C0144AC6FEA/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T144652_9v64l3ky_.bkp
channel ORA_DISK_1: piece
handle=/u03/fast_recovery_area/CDB1/FA406513FB2E0E41E0430C0144AC6FEA/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T144652_9v64l3ky_.bkp
tag=TAG20140701T144652
channel ORA_DISK_1: restored backup
piece 1
channel ORA_DISK_1: restore complete,
elapsed time: 00:01:05
Finished restore at 01-JUL-14
Finalmente
aplicamos el recovery total de la base de datos, para luego abrir el CDB y
todos los PDBs
RMAN> recover database;
Starting recover at 01-JUL-14
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence
3 is already on disk as file
/u03/fast_recovery_area/CDB1/archivelog/2014_07_01/o1_mf_1_3_9v653mj4_.arc
archived log for thread 1 with sequence
4 is already on disk as file
/u03/fast_recovery_area/CDB1/archivelog/2014_07_01/o1_mf_1_4_9v653sro_.arc
archived log for thread 1 with sequence
5 is already on disk as file
/u03/fast_recovery_area/CDB1/archivelog/2014_07_01/o1_mf_1_5_9v653wrk_.arc
archived log for thread 1 with sequence
6 is already on disk as file
/u03/fast_recovery_area/CDB1/archivelog/2014_07_01/o1_mf_1_6_9v653zr9_.arc
RMAN> alter database open;
Statement processed
RMAN> alter pluggable database ALL open;
Statement processed
Recuperación de tablespaces de DATOS.
Para la
recuperación de tablespaces de DATOS en un PDB, es necesario colocar el
tablespace en modo OFFLINE.
Simularemos
la pérdida del tablespace DATA_01 en PDBORCL
[oracle@oracle12c datafile]$ ls -l data*
-rw-r----- 1 oracle oinstall 104865792
Jul 1 15:50 data_01_1.dbf
[oracle@oracle12c datafile]$ rm
data_01_1.dbf
Nos
conectamos al PDB y colocamos el tablespace DATA_01 en modo Offline.
SQL> connect sys@PDBORCL as sysdba
Enter password:
Connected.
SQL> alter tablespace DATA_01 offline
immediate;
Tablespace altered.
Nos
conectamos al ROOT desde el RMAN y recuperamos el tablespace del pluggable
PDBORCL
[oracle@oracle12c datafile]$ rman target
/
Recovery Manager: Release 12.1.0.1.0 -
Production on Tue Jul 1 16:04:31 2014
Copyright (c) 1982, 2013, Oracle and/or
its affiliates. All rights reserved.
connected to target database: CDB1
(DBID=821677457)
RMAN> restore tablespace PDBORCL:DATA_01;
Starting restore at 01-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile
backup set restore
channel ORA_DISK_1: specifying
datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile
00029 to /u02/oradata/ORCL/datafile/data_01_1.dbf
channel ORA_DISK_1: reading from backup
piece /u03/fast_recovery_area/CDB1/FAD074A33FA4101EE0430D0144AC9C0F/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T153534_9v66wpy5_.bkp
channel ORA_DISK_1: piece
handle=/u03/fast_recovery_area/CDB1/FAD074A33FA4101EE0430D0144AC9C0F/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T153534_9v66wpy5_.bkp
tag=TAG20140701T153534
channel ORA_DISK_1: restored backup
piece 1
channel ORA_DISK_1: restore complete,
elapsed time: 00:00:15
Finished restore at 01-JUL-14
RMAN> recover tablespace PDBORCL:DATA_01;
Starting recover at 01-JUL-14
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time:
00:00:00
Nos
volvemos a conectar al pluggable database PDBOCL y levantamos el tablespace
DATA_01
SQL> connect sys@PDBORCL as sysdba
Enter password:
Connected.
SQL>
SQL> alter tablespace DATA_01 online;
Tablespace altered.
Recuperación de un PDB en el tiempo
Oracle
12c tiene la nueva funcionalidad de recuperar un PDB en el tiempo.
Esta recuperación
no afecta al CDB o a las demás bases de datos PDBs. Es necesario tener el PDB a recuperar en
estado CLOSE.
La recuperación
de un PDB en el tiempo sigue la misma lógica de la recuperación de un
tablespace en el tiempo.
- Crea una instancia dummy.
- Recupera toda la BD en el tiempo.
- Se extrae el PDB a recuperar y se reemplaza
en la base de datos CDB origen.
- El PDB se abre con Resetlogs.
La encarnación
de la base de datos PDB es independiente a la encarnación de la base de datos
CDB. Para la arquitectura Multitenant la
encarnación de un PDB es una sub-encarnación de la base de datos CDB y ambas se
almacenan en los controlfiles.
Primero
definimos a qué punto en el tiempo deseamos regresar la base de datos PDB.
SQL> select SEQUENCE#, FIRST_CHANGE#,
NEXT_CHANGE#
2 from v$archived_log
3 order by SEQUENCE#;
SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
----------
------------- ------------
22
2469304 2477460
23
2477460 2477463
24
2477463 2477468
25 2477468 2477473
26
2477473 2487597
27
2487597 2487603
28
2487603 2487608
29
2487608 2491359
30
2491359 2491362
31
2491362 2491365
32
2491365 2513112
Recuperaremos
la base de datos pluggable PDB2 al SCN 2477468.
Antes de recuperar el PDB en el tiempo, crearemos una tabla para comprobar
que ha regresado un tiempo anterior.
SQL> connect sys@PDB2 as sysdba
Enter password:
Connected.
SQL> create tablespace DATA1 datafile
'/u02/oradata/cdb1/PDB2/data1_1.dbf' size 10M;
Tablespace created.
SQL> create table USU2.TABLA1 (
2 a int,
3 b varchar2(15)) tablespace
DATA1;
Table created.
Procedemos
a bajar la base de datos PDB2
SQL> connect / as sysdba
Connected.
SQL>
alter pluggable database PDB2 close;
Pluggable database altered.
Lanzamos
el comando de recuperación de un PDB en el tiempo. Tenemos que indicar en qué directorio se va a
crear la instancia Dummy.
[oracle@oracle12c temporal]$ rman target
/
Recovery Manager: Release 12.1.0.1.0 -
Production on Wed Jul 2 11:05:28 2014
Copyright (c) 1982, 2013, Oracle and/or
its affiliates. All rights reserved.
connected to target database: CDB1
(DBID=821677457)
RMAN> RUN {
SET UNTIL SCN = 2477468;
RESTORE PLUGGABLE DATABASE PDB2;
RECOVER PLUGGABLE DATABASE PDB2 AUXILIARY
DESTINATION = '/u02/oradata/temporal';
alter pluggable database PDB2 open
resetlogs;
}
executing command: SET until clause
Starting restore at 02-JUL-14
using target database control file
instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=52 device
type=DISK
Starting restore at 02-JUL-14
using channel ORA_DISK_1
...
Starting restore at 02-JUL-14
using channel ORA_AUX_DISK_1
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 /u02/oradata/temporal/CDB1/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring
datafile 00005 to /u02/oradata/temporal/CDB1/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring
datafile 00006 to /u02/oradata/temporal/CDB1/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup
piece
/u03/fast_recovery_area/CDB1/backupset/2014_07_01/o1_mf_nnndf_TAG20140701T150531_9v654cm0_.bkp
...
Removing automatic instance
Automatic instance removed
auxiliary instance file /u02/oradata/temporal/CDB1/datafile/o1_mf_sysaux_9v8cmrd9_.dbf
deleted
auxiliary instance file
/u02/oradata/temporal/CDB1/controlfile/o1_mf_9v8ch7hw_.ctl deleted
Finished recover at 02-JUL-14
Una vez
finalizada la recuperación, revisamos que el PDB2 se encuentre en estado
abierto.
SQL> select CON_ID, NAME, OPEN_MODE
2 from V$PDBS
3 order by CON_ID;
CON_ID NAME
OPEN_MODE
----------
------------------------------ ----------
2 PDB$SEED READ ONLY
3 PDB1
READ WRITE
4 PDB2 READ WRITE
6 PDBORCL READ WRITE
Revisamos
si la en la base de datos PDB2 se encuentran el tablespace y la tabla creados
para el ejemplo.
SQL> connect sys@PDB2 as sysdba
Enter password:
Connected.
SQL> select tablespace_name from
dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
TEMP
TEMP02
SQL> desc USU2.TABLA1
ERROR:
ORA-04043: object USU2.TABLA1 does not
exist
Como se
observa el tablespace DATA1 y la tabla USU2.TABLA1 no se encuentran creados
porque hemos regresado el PDB a un punto en el tiempo en que no existían.
Con
este articulo quería explicar las
funciones básicas de Backup & Recovery para la arquitectura Multitenant
Oracle 12c.
En
posteriores articules mostrare otras funcionalidades nuevas para RMAN en Oracle
12c.
Espero les pueda
servir de ayuda.
No hay comentarios.:
Publicar un comentario