SQL> SHUTDOWN IMMEDIATE SQL> STARTUP MOUNT SQL> ALTER DATABASE ARCHIVELOG; SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=2880 SCOPE=BOTH; SQL> ALTER DATABASE FLASHBACK ON; SQL> ALTER DATABASE OPEN;
If the CDB is in ARCHIVELOG mode, there is no need to restart it.
• You cannot flash back the root alone without flashing back the entire CDB.
• Flashback Database operations on a CDB may not be permitted if point-in-time recovery has been performed on any of its PDBs. When point-in-time recovery is performed on a PDB, you cannot directly rewind the CDB to a point that is earlier than the point at which DBPITR for the PDB was performed.
A common user is dropped.
1. Flashback CDB: CDB mounted in exclusive mode
SQL> STARTUP MOUNT SQL> FLASHBACK DATABASE TO SCN 53943;
2. To review changes: Open CDB and PDBs in READ ONLY
SQL> ALTER DATABASE OPEN READ ONLY; SQL> ALTER PLUGGABLE DATABASE ALL OPEN READ ONLY;
3. To finalize: Flash back again if necessary and open CDB with RESETLOGS.
RMAN> SHUTDOWN IMMEDIATE RMAN> STARTUP MOUNT RMAN> FLASHBACK DATABASE TO SCN 10; RMAN> ALTER DATABASE OPEN RESETLOGS; RMAN> ALTER PLUGGABLE DATABASE ALL OPEN;
A common schema has been accidently dropped in the root. You have to flash back the CDB to the time before the common user was dropped impacting all PDBs.
You can use the RMAN FLASHBACK DATABASE command to execute the Flashback Database operation. You can use SEQUENCE and THREAD to specify a redo log sequence number and thread as a lower limit.
Alternatively, you can use the SQL FLASHBACK DATABASE command to return the database to a past time or SCN. If you use the TO SCN clause, you must provide a number. If you specify TO TIMESTAMP, you must provide a time stamp value. You can also specify a restore point name.
• The CDB must be mounted in exclusive mode to issue the FLASHBACK DATABASE command and opened read-only to review changes. The CDB must be opened read/write with the RESETLOGS option when finished.
• When the CDB is opened in READ ONLY mode, the PDBs are still mounted. Open PDBs in READ ONLY mode, too, to review changes.
*While performing a hot CDB backup, you cannot close any PDB.