concept
You can now recover a PDB to a specific point-in-time. This feature is a high availability enhancement for consolidation and extends point-in-time recovery functionality to PDBs. You can now restore the PDB to a specific point in time. This feature is a high availability enhancement to consolidation and extends point time recovery to PDBs. The steps to perform point-in-time recovery of PDBs are similar to the ones for performing DBPITR, with the differences described in this section. When you recover one or more PDBs to a specified point-in-time, the remaining PDBs in the CDB are not affected and they can be open and operational. After recovery, the old backups of the PDB remain valid and can be used if a media failure occurs. You do not need to create new backups. If you have performed point-in-time recovery for a PDB, then you cannot directly flashback the whole CDB to a point that is beyond the point in time to which the PDB was recovered. You must use the steps described in "Performing Flashback Database Operations on a CDB When a PDB Was Recovered Using DBPITR". When performing DBPITR on one or more PDBs in a CDB, backups of the root and the seed database (PDB$SEED) of the CDB that contains the PDBs are required. In a Data Guard environment, you may need to flash back the entire standby database or restore the PDB for the standby database to follow a primary database with a PDB that was restored to a point in time. The steps for performing a point in time recovery of a PDBs are similar to those for performing a DBPITR, with the differences described in this section. When you restore one or more PDBs to a specified point in time, the remaining PDBs in the CDB are unaffected and can be opened and operated on. After recovery, the old backup of PDB is still valid and can be used in case of media failure. You do not need to create a new backup. If you perform a point in time recovery on the PDB, you cannot directly reverse the entire CDB to a point beyond the PDB recovery point. You must use the steps described in "Performing Flashback Database Operations on a CDB When a PDB Was Recovered Using DBPITR". ". When DBPITR is executed on one or more PDBs in CDB, the root and seed databases (PDB $seed) of CDB containing PDBs need to be backed up. In a data protection environment, you may need to return to the entire standby database or restore the PDB of the standby database to track the primary database and restore the PDB to a point in time.
Experiment
1)backups PDB [oracle@dg1 ~]$ rman target / Recovery Manager: Release 12.2.0.1.0 - Production on Thu Aug 3 16:10:08 2017 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. connected to target database: CNDBA (DBID=211273844) RMAN> BACKUP PLUGGABLE DATABASE pdbcndba; Starting backup at 03-AUG-17 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=00010 name=/u01/app/oracle/oradata/cndba/pdbcndba/sysaux01.dbf input datafile file number=00009 name=/u01/app/oracle/oradata/cndba/pdbcndba/system01.dbf input datafile file number=00011 name=/u01/app/oracle/oradata/cndba/pdbcndba/undotbs01.dbf input datafile file number=00012 name=/u01/app/oracle/oradata/cndba/pdbcndba/users01.dbf channel ORA_DISK_1: starting piece 1 at 03-AUG-17 channel ORA_DISK_1: finished piece 1 at 03-AUG-17 piece handle=/u01/app/oracle/product/12.1.0/db_1/dbs/06sb07ol_1_1 tag=TAG20170803T170629 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15 Finished backup at 03-AUG-17 Starting Control File and SPFILE Autobackup at 03-AUG-17 piece handle=/u01/app/oracle/product/12.1.0/db_1/dbs/c-211273844-20170803-04 comment=NONE Finished Control File and SPFILE Autobackup at 03-AUG-17 2)Create users, tables [oracle@dg1 ~]$ sqlplus /nolog SQL*Plus: Release 12.2.0.1.0 Production on Thu Aug 3 17:17:10 2017 Copyright (c) 1982, 2016, Oracle. All rights reserved. SQL> conn /as sysdba Connected. SQL> CREATE USER test IDENTIFIED BY test DEFAULT TABLESPACE users QUOTA UNLIMITED ON users; User created. SQL> grant dba to test; Grant succeeded. SQL> conn test/test@pdbcndba Connected. SQL> set time on; 15:45:14 SQL> create table leo1 (id number(10)); Table created. 15:45:22 SQL> insert into leo1 values(10); 1 row created. 15:45:28 SQL> commit; Commit complete. 15:45:31 SQL> select * from leo1; ID ---------- 10 3) Switch Archive 15:45:45 SQL> conn /as sysdba Connected. 15:45:52 SQL> alter system switch logfile; System altered. 15:45:54 SQL> alter system switch logfile; System altered. 4)Delete table disease record time 15:45:56 SQL> alter session set container=pdbcndba; Session altered. 15:47:49 SQL> conn test/test@pdbcndba Connected. 15:49:08 SQL> select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual; TO_CHAR(SYSDATE,'YY ------------------- 2017-08-03 15:49:17 16:23:13 SQL> drop table leo1 purge; Table dropped. 5)Point in time based recovery PDB [oracle@dg1 ~]$ rman target / Recovery Manager: Release 12.2.0.1.0 - Production on Thu Aug 3 16:57:57 2017 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. connected to target database: CNDBA (DBID=211273844) RMAN> ALTER PLUGGABLE DATABASE pdbcndba CLOSE; using target database control file instead of recovery catalog Statement processed --Restore to delete table 16:23:13 RMAN> run{ SET UNTIL TIME "TO_DATE('03-08-2017 16:23:13','DD-MM-YYYY HH24:MI:SS')"; RESTORE PLUGGABLE DATABASE pdbcndba; RECOVER PLUGGABLE DATABASE pdbcndba AUXILIARY DESTINATION '/tmp'; ALTER PLUGGABLE DATABASE pdbcndba OPEN RESETLOGS; } executing command: SET until clause Starting restore at 03-AUG-17 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=27 device type=DISK skipping datafile 11; already restored to file /u01/app/oracle/oradata/cndba/pdbcndba/undotbs01.dbf skipping datafile 12; already restored to file /u01/app/oracle/oradata/cndba/pdbcndba/users01.dbf 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 00009 to /u01/app/oracle/oradata/cndba/pdbcndba/system01.dbf channel ORA_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/cndba/pdbcndba/sysaux01.dbf channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/12.1.0/db_1/dbs/01sb02a3_1_1 channel ORA_DISK_1: piece handle=/u01/app/oracle/product/12.1.0/db_1/dbs/01sb02a3_1_1 tag=TAG20170803T153323 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:45 Finished restore at 03-AUG-17 Starting recover at 03-AUG-17 using channel ORA_DISK_1 starting media recovery archived log for thread 1 with sequence 3 is already on disk as file /u01/app/oracle/product/12.1.0/db_1/dbs/arch1_3_946811064.dbf archived log for thread 1 with sequence 4 is already on disk as file /u01/app/oracle/product/12.1.0/db_1/dbs/arch1_4_946811064.dbf archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/product/12.1.0/db_1/dbs/arch1_5_946811064.dbf media recovery complete, elapsed time: 00:00:05 Finished recover at 03-AUG-17 Statement processed 6)Verify data is restored successfully 16:35:44 SQL> conn /as sysdba Connected. 16:35:47 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDBCNDBA READ WRITE NO 16:38:46 SQL> alter session set container=pdbcndba; Session altered. 16:39:00 SQL> 16:39:00 SQL> conn test/test@pdbcndba Connected. 16:39:10 SQL> select * from leo1; ID ---------- 10
Reference link:
http://docs.oracle.com/database/121/BRADV/rcmflash.htm#BRADV89755
https://oracle-base.com/articles/12c/multitenant-rman-backup-recovery-cdb-and-pdb-12cr1