4.7.3 Using a Carousel of Thinly Provisioned Pluggable Database Snapshots

Within Oracle Database, you can create a library of pluggable database (PDB) snapshots, known as a PDB snapshot carousel. A PDB snapshot is a point-in-time copy of a PDB. The source PDB can be open read-only or read/write while the snapshot is created. A PDB snapshot carousel is useful for maintaining a library of recent PDB copies for point-in-time recovery and cloning.

For example, the following command creates a snapshot carousel based on pdb1 where a new snapshot is taken every 2 hours.

SQL> ALTER PLUGGABLE DATABASE pdb1
     SNAPSHOT MODE EVERY 2 hours;

When Oracle Database uses Exascale storage, the PDB snapshot operation automatically uses native Exascale functionality to snapshot the underlying Oracle Database files. A PDB snapshot carousel based on Exascale storage can contain up to 4096 PDB snapshots. Once the carousel reaches its limit, each new snapshot automatically replaces the oldest snapshot.

The snapshots reside in the same Exascale vault as the underlying source data files, and Exascale uses redirect-on-write techniques to create and maintain the thinly provisioned snapshot data files. As a result, the snapshot operation is instantaneous, regardless of the size of the underlying data files. Also, each snapshot consumes no additional space. Space is only consumed when new data is written to the source PDB or to a writable clone based on a snapshot.

Within the Oracle Database, the snapshot data files appear in the standard Oracle Database dictionary views, such as DBA_PDB_SNAPSHOTFILE. Additionally, you can examine various Exascale-specific file details in the V$EXA_FILE Oracle Database dictionary view.

Within Exascale, you can use the ESCLI lssnapshots command to view the association between the snapshots and their underlying source files.

Note:

If you create a thinly provisioned PDB snapshot on an Oracle Data Guard primary database, the snapshot metadata propagates to the standby. However, the snapshot is not accessible at the standby site, even after an Oracle Data Guard role transition (switchover or failover).

To utilize a snapshot from the PDB snapshot carousel as a writable PDB, you must create a clone (snapshot copy) based on the snapshot. For example:

SQL> CREATE PLUGGABLE DATABASE pdbCloneFromSnap FROM pdb1
     USING SNAPSHOT pdb1SnapshotN SNAPSHOT COPY;

In the example, if pdb1SnapshotN identifies a thinly provisioned PDB snapshot on Exascale storage, the new PDB (pdbCloneFromSnap) is also thinly provisioned.

Note that creating a clone (snapshot copy) based on the PDB snapshot requires access to archived redo log files from the time of the snapshot to ensure consistency across the PDB data files.