From Oracle 12.2 onwards we can flashback a Pluggable database(PDB). And flashback is very easy and simple if LOCAL UNDO is enabled(which is also a new feature in Oracle 12.2).

Let’s start the DEMO.

DEMO:

1. Check whether local undo is enabled or not.

For more info – Local undo and shared undo in oracle 12.2

 

2. Check whether flashback is enabled or not.

In a multitenant database, flashback can be enabled at container level only.

2. Create a restore point in the pluggable database.

3. Do some DML changes on the PDB.

4. Now do the flashback to the restore point(we created in the previous stage).

5. Check data again(whether we are seeing the old data or not):

What if LOCAL_UNDO is not enabled?

In oracle 12.2 if local_undo is not enabled, then we can use AUXILIARY DESTINATION parameter , which will create an auxiliary instance with container database’s system,sysaux and undo tablespace, and then restore the PDB using rollback transactions. However this flahback will take a long time and will consume additional space on the auxiliary destination.

steps FOR SHARED UNDO: